掲示板

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

thumbnail
6年前 に Rajesh Chaurasia によって更新されました。

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

Regular Member 投稿: 183 参加年月日: 11/08/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 ?
thumbnail
6年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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
6年前 に Rajesh Chaurasia によって更新されました。

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

Regular Member 投稿: 183 参加年月日: 11/08/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?
thumbnail
6年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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!
4年前 に Mohamed RAGUIG によって更新されました。

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

New Member 投稿: 1 参加年月日: 19/07/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.
thumbnail
3年前 に Vishal Srivastava によって更新されました。

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

Junior Member 投稿: 26 参加年月日: 14/07/07 最新の投稿
Kindly use DDMStorageAdapter instead of BaseStorageAdapter!!
thumbnail
3年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Vishal Srivastava:

Kindly use DDMStorageAdapter instead of BaseStorageAdapter!!


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