Forums de discussion

Saving Liferay 7 forms json to a separate db rather than liferay

thumbnail
Rajesh Chaurasia, modifié il y a 6 années.

Saving Liferay 7 forms json to a separate db rather than liferay

Regular Member Publications: 183 Date d'inscription: 18/08/11 Publications récentes
Hi All

I have a use case where i am required to save the form data - json -to a separate db rather than liferay db.
For this use case i figured out that Liferay 7 forms can be used but my use case is little different due to above scenario.
Can we still use liferay 7 forms with some modification ?
thumbnail
David H Nebinger, modifié il y a 6 années.

RE: Saving Liferay 7 forms json to a separate db rather than liferay

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
No modifications necessary.

Just create an implementation of the com.liferay.dynamic.data.mapping.storage.StorageAdapter. When creating your form, you can select this storage adapter for the form.

Your storage adapter can then do anything to persist and access the data. Check out the com.liferay.dynamic.data.mapping.storage.impl.JSONStorageAdapter to see how to serialize to/from json and how the Liferay implementation handles the persistence.






Come meet me at the 2017 LSNA!
thumbnail
Rajesh Chaurasia, modifié il y a 6 années.

RE: Saving Liferay 7 forms json to a separate db rather than liferay

Regular Member Publications: 183 Date d'inscription: 18/08/11 Publications récentes
Hi David ,

Thanks for the reply.
So i can persist the data entered in form into a separate database.
Also can you let me know if i can apply some business rules on the form like if i have a field weight - can i apply a business rule like weight should not exceed 100 kg upper limit at front end and also at backend?
thumbnail
David H Nebinger, modifié il y a 6 années.

RE: Saving Liferay 7 forms json to a separate db rather than liferay

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
Not sure that's going to be possible there; the expectation is that code will persist the form, not really reject form data.







Come meet me at the 2017 LSNA!
Mohamed RAGUIG, modifié il y a 4 années.

RE: Saving Liferay 7 forms json to a separate db rather than liferay

New Member Envoyer: 1 Date d'inscription: 15/07/19 Publications récentes
Hello everybody,
I have a requirement related to this thread, i want to change the storage table of my form, i'm using Liferay 7.2. I tried to implement the StorageAdapter interface but all my imported classes are deprecated, in addition to this building and deploying my service to my server didn't add the storage option in the form settings.
thumbnail
Vishal Srivastava, modifié il y a 3 années.

RE: Saving Liferay 7 forms json to a separate db rather than liferay

Junior Member Publications: 26 Date d'inscription: 07/07/14 Publications récentes
Kindly use DDMStorageAdapter instead of BaseStorageAdapter!!
thumbnail
David H Nebinger, modifié il y a 3 années.

RE: Saving Liferay 7 forms json to a separate db rather than liferay

Liferay Legend Publications: 14916 Date d'inscription: 02/09/06 Publications récentes
Vishal Srivastava:

Kindly use DDMStorageAdapter instead of BaseStorageAdapter!!


3 years ago when this was posted, DDMStorageAdapter didn't exist yet.