Fórum

adding one more text box for admin

sasmita swain, modificado 11 Anos atrás.

adding one more text box for admin

Regular Member Postagens: 183 Data de Entrada: 24/02/12 Postagens Recentes
Hi
How to add one more text box in out of box portlet for admin???not for user,actually i want to add description field for admin..what admin will enter the data it should go to the database..

can is it possible by custom attribute?

Thanks

Sasmita
thumbnail
Gnaniyar Zubair, modificado 11 Anos atrás.

RE: adding one more text box for admin

Liferay Master Postagens: 722 Data de Entrada: 19/12/07 Postagens Recentes
Sorry Your question is not clear to give the better solution. which out of box portlet do u mean ?

Do you want to add description field for user ?


- Gnaniyar Zubair
sasmita swain, modificado 11 Anos atrás.

RE: adding one more text box for admin

Regular Member Postagens: 183 Data de Entrada: 24/02/12 Postagens Recentes
Gnaniyar Zubair:
Sorry Your question is not clear to give the better solution. which out of box portlet do u mean ?

Do you want to add description field for user ?


- Gnaniyar Zubair


Thanks for reply

i want to add description field in shopping portlet(subcategory) for admin..admin will enter some description in description field


Thanks

Sasmita
thumbnail
Gnaniyar Zubair, modificado 11 Anos atrás.

RE: adding one more text box for admin

Liferay Master Postagens: 722 Data de Entrada: 19/12/07 Postagens Recentes
You have to override through EXT or HOOK .

If only jsp changes then go for simple JSP hook and take the original file from here html/portlet/shopping /<jspfile> .
sasmita swain, modificado 11 Anos atrás.

RE: adding one more text box for admin

Regular Member Postagens: 183 Data de Entrada: 24/02/12 Postagens Recentes
Gnaniyar Zubair:
You have to override through EXT or HOOK .

If only jsp changes then go for simple JSP hook and take the original file from here html/portlet/shopping /<jspfile> .


How to add for description column in database?it is oob portlet..

Thanks

Sasmita
thumbnail
Gnaniyar Zubair, modificado 11 Anos atrás.

RE: adding one more text box for admin

Liferay Master Postagens: 722 Data de Entrada: 19/12/07 Postagens Recentes
Through EXT plugin, you can modify anthing. You will have all the control for OOTB portlets.

you can modify the service.xml of shopping portlet or handle different table where you need to store unique key of shopping cart and description field .

Please refer :

http://www.liferay.com/community/forums/-/message_boards/message/4533829


http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/ext-plugins
thumbnail
Gnaniyar Zubair, modificado 11 Anos atrás.

RE: adding one more text box for admin

Liferay Master Postagens: 722 Data de Entrada: 19/12/07 Postagens Recentes
But now using Service Builder is depreciated in EXT plugin. May be next version will not available.

So better you can use new table and store additional information.
sasmita swain, modificado 11 Anos atrás.

RE: adding one more text box for admin

Regular Member Postagens: 183 Data de Entrada: 24/02/12 Postagens Recentes
Gnaniyar Zubair:
But now using Service Builder is depreciated in EXT plugin. May be next version will not available.

So better you can use new table and store additional information.



Thanks for your reply

but in hook how to create new table for storing additional information?

Thanks

Sasmita
thumbnail
Gnaniyar Zubair, modificado 11 Anos atrás.

RE: adding one more text box for admin

Liferay Master Postagens: 722 Data de Entrada: 19/12/07 Postagens Recentes
Creating table is not through hook. design and create the table manually.

1. Add the new text box(description ) in jsp file

2. Override the Action through Struts Action Hook or EXT.

For eg, if you want to extend EditItemAction of Shopping Cart, then extend this /shopping/edit_item struts path using Struts Action hook,
Struts Action Hook: http://www.liferay.com/community/wiki/-/wiki/Main/Struts+Action+Hook+Tips


3. get description field value in Action file (For eg. EditItemAction.java) and store into your table in normal way.(query)

[indent][indent]instead of using direct query and creating table manually, you can use like this to create the table and store the data :
a.Create separate Service.xml with shoppingcart id and description
b.do build-service.
c.copy that <your-entity>service.jar into tomcat/lib folder
d. then <yourentity>LocalServiceUtil.addItem(shoppingCartId,description);[/indent][/indent]