留言板
Saving Liferay 7 forms json to a separate db rather than liferay
Rajesh Chaurasia,修改在6 年前。
Saving Liferay 7 forms json to a separate db rather than liferay
Regular Member 帖子: 183 加入日期: 11-8-18 最近的帖子
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 ?
David H Nebinger,修改在6 年前。
RE: Saving Liferay 7 forms json to a separate db rather than liferay
Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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!
Rajesh Chaurasia,修改在6 年前。
RE: Saving Liferay 7 forms json to a separate db rather than liferay
Regular Member 帖子: 183 加入日期: 11-8-18 最近的帖子
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?
David H Nebinger,修改在6 年前。
RE: Saving Liferay 7 forms json to a separate db rather than liferay
Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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!
Mohamed RAGUIG,修改在4 年前。
RE: Saving Liferay 7 forms json to a separate db rather than liferay
New Member 发布: 1 加入日期: 19-7-15 最近的帖子
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.
Vishal Srivastava,修改在3 年前。
RE: Saving Liferay 7 forms json to a separate db rather than liferay
Junior Member 帖子: 26 加入日期: 14-7-7 最近的帖子
Kindly use DDMStorageAdapter instead of BaseStorageAdapter!!
David H Nebinger,修改在3 年前。
RE: Saving Liferay 7 forms json to a separate db rather than liferay
Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子Vishal Srivastava:
Kindly use DDMStorageAdapter instead of BaseStorageAdapter!!
3 years ago when this was posted, DDMStorageAdapter didn't exist yet.