Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Saving Liferay 7 forms json to a separate db rather than liferay
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 ?
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 ?
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!
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!
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?
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?
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!
Come meet me at the 2017 LSNA!
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.
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.
Kindly use DDMStorageAdapter instead of BaseStorageAdapter!!
Vishal Srivastava:
Kindly use DDMStorageAdapter instead of BaseStorageAdapter!!
3 years ago when this was posted, DDMStorageAdapter didn't exist yet.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™