Foros de discusión
service builder inside hook
sasmita swain, modificado hace 11 años.
service builder inside hook
Regular Member Mensajes: 183 Fecha de incorporación: 24/02/12 Mensajes recientes
Hi all
I am working onLR6.1...can we create service builder inside hook?i want to add extra column in liferay shopping category table..
how to do?
Thanks
Sasmita
I am working onLR6.1...can we create service builder inside hook?i want to add extra column in liferay shopping category table..
how to do?
Thanks
Sasmita
Drew Blessing, modificado hace 11 años.
RE: service builder inside hook
Junior Member Mensajes: 78 Fecha de incorporación: 27/01/11 Mensajes recientes
Hi sasmita. The short answer is, yes, you can use service builder in a hook plugin. However, Service Builder is only used for creating your own entities (completely new). Since you want to modify an existing model you probably want to explore Expando. Expando will in essence allow you to add a "column(s)" to an existing table. Understand though that Liferay does the logic in its service layer to bring expando and the original object together so you will not actually see an added column if you look at the database directly (it's really just adding an attribute to the model). When you access the object via code the object will have the correct expanded data attached as expected.
Someone else can probably provide a good working example of Expando but there is some excellent documentation to get you started. http://www.liferay.com/community/wiki/-/wiki/Main/Adding+an+custom+attribute+to+a+Community
Someone else can probably provide a good working example of Expando but there is some excellent documentation to get you started. http://www.liferay.com/community/wiki/-/wiki/Main/Adding+an+custom+attribute+to+a+Community
sasmita swain, modificado hace 11 años.
RE: service builder inside hook
Regular Member Mensajes: 183 Fecha de incorporación: 24/02/12 Mensajes recientesDrew Blessing:
Hi sasmita. The short answer is, yes, you can use service builder in a hook plugin. However, Service Builder is only used for creating your own entities (completely new). Since you want to modify an existing model you probably want to explore Expando. Expando will in essence allow you to add a "column(s)" to an existing table. Understand though that Liferay does the logic in its service layer to bring expando and the original object together so you will not actually see an added column if you look at the database directly (it's really just adding an attribute to the model). When you access the object via code the object will have the correct expanded data attached as expected.
Someone else can probably provide a good working example of Expando but there is some excellent documentation to get you started. http://www.liferay.com/community/wiki/-/wiki/Main/Adding+an+custom+attribute+to+a+Community
Thanks for your reply
for expando i have create custom attiribute from controlpannel for user..but i want to add new filed for admin..by using custom attribute when i am adding values in to text box it is not inserting to expando values
Thanks
Sasmita
Hitoshi Ozawa, modificado hace 11 años.
RE: service builder inside hook
Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
This thread probably should belong in the Developer forum instead of here because it doesn't concern Liferay community here.
Drew Blessing, modificado hace 11 años.
RE: service builder inside hook
Junior Member Mensajes: 78 Fecha de incorporación: 27/01/11 Mensajes recientes
I agree with Hitoshi. This is definitely a development question. To get more developer eyes on this and to get the best possible help, please post this question in the developer's forum here: Development
Also, be sure to mention expando since that's what you need. Expando can be done 100% code-based without the use of the Control Panel you have mentioned using for custom fields/attributes. The developer's forum will provide some help. Or, try the Freenode IRC channel #liferay for some possible real-time help.
Also, be sure to mention expando since that's what you need. Expando can be done 100% code-based without the use of the Control Panel you have mentioned using for custom fields/attributes. The developer's forum will provide some help. Or, try the Freenode IRC channel #liferay for some possible real-time help.
David H Nebinger, modificado hace 11 años.
RE: service builder inside hook
Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientesDrew Blessing:
The short answer is, yes, you can use service builder in a hook plugin.
Hey, Drew, I thought that a hook did not provide the proper context for hosting services?
sasmita swain, modificado hace 11 años.
RE: service builder inside hook
Regular Member Mensajes: 183 Fecha de incorporación: 24/02/12 Mensajes recientes
Hi
I want to add one more column in shopping category table..how to do by using expando..
can you give some example
Thanks
Sasmita
I want to add one more column in shopping category table..how to do by using expando..
can you give some example
Thanks
Sasmita
Drew Blessing, modificado hace 11 años.
RE: service builder inside hook
Junior Member Mensajes: 78 Fecha de incorporación: 27/01/11 Mensajes recientesDavid H Nebinger:
Hey, Drew, I thought that a hook did not provide the proper context for hosting services?
Dave, You may be right. The context I was considering would be a plugin with a portlet and hook all together. In a standalone hook it may not work.