Fórum

Liferay 7 forms custom consumer

thumbnail
Miroslav Ligas, modificado 7 Anos atrás.

Liferay 7 forms custom consumer

New Member Postagens: 17 Data de Entrada: 23/02/12 Postagens Recentes
Hi All

How is it possible to create a custom Form consumer? I think it should be possible to define a new one but I can wrap my head around the code to find to how.

Anybody can help?
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: Liferay 7 forms custom consumer

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
What do you mean, a form consumer?
thumbnail
Miroslav Ligas, modificado 7 Anos atrás.

RE: Liferay 7 forms custom consumer

New Member Postagens: 17 Data de Entrada: 23/02/12 Postagens Recentes
Hi David

I mean a class (probably a StorageAdapter) that will get the result and can then process and store it.

But I can't figure out how to write a custom StorageAdapter.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: Liferay 7 forms custom consumer

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
It's actually quite straight forward, I just did one for a client last week.

What parts are you struggling with, maybe I can help you clear the hurdles?
thumbnail
Miroslav Ligas, modificado 7 Anos atrás.

RE: Liferay 7 forms custom consumer

New Member Postagens: 17 Data de Entrada: 23/02/12 Postagens Recentes
Hi David

Yes, it is quite easy. I had a play with it and it seems that you just need to create the component and return the storageType.

Is it possible to introduce your own storage type? How can I then configure the Form framework to use the custom storage type?
It seems that if I add a new storage adapter under the same type (JSON) they both are going to get triggered but I don't want the data to end up in Liferay.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: Liferay 7 forms custom consumer (Resposta)

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
Yes, you can define your own storage type. I tend to create custom ones that wrap the JSON storage type, that way I get entry point to the forms data yet still let Liferay do the heavy lifting when it comes to serialization and persistence.

After your custom storage type is deployed, when you are creating a new form if you use the peapod in the upper-right corner you can get to a configuration area where you choose the storage type. Note that this can only be set I believe when the form is first created and not afterwards, especially not after a form has been initially submitted.
thumbnail
Miroslav Ligas, modificado 7 Anos atrás.

RE: Liferay 7 forms custom consumer

New Member Postagens: 17 Data de Entrada: 23/02/12 Postagens Recentes
Found the setting. I'm still not used to to the top tight menu. Never look there emoticon

Thx!