Foros de discusión

How to programatically add liferay portlet Instance dynamically and install

Padmanabha V N, modificado hace 11 años.

How to programatically add liferay portlet Instance dynamically and install

New Member Mensajes: 11 Fecha de incorporación: 15/02/11 Mensajes recientes
Hi

I have a liferay portlet instance created dynamically and added to the layout programatically as follows

String portletId = objUtil.addPortlet("/prj/reports", "XYZPortlet_WAR_ecpmportlet", "column-2",groupId, "type: " + getSelectedType());

So it adds a portlet to the /reports page. I want to add a button below the portlet called "send to dashboard" on clicking the button I want to Install this portlet to the user dashboard permanently.

Note: There can any number of portlet instances added to the /reports page.

As you see XYZPortlet is the id of the portlet defined in liferay-portlet.xml, liferay-display.xml which remains same for all the portlets I add to the reports page.

I want to dynamically assign a new Id to the portlet instance and install it permanently to the dashboard layout.

Can anyone please suggest a way to do this?

Thanks

Padmanabha V N
thumbnail
mohammad azaruddin, modificado hace 11 años.

RE: How to programatically add liferay portlet Instance dynamically and ins

Expert Mensajes: 492 Fecha de incorporación: 17/09/12 Mensajes recientes
Hi

This topic is been discussed previously in the forum
you could try this
link1
link2
Padmanabha V N, modificado hace 11 años.

RE: How to programatically add liferay portlet Instance dynamically and ins

New Member Mensajes: 11 Fecha de incorporación: 15/02/11 Mensajes recientes
Hi mohamed

Thanks for the reply

I actally want to assign a new portlet id to the new portlet i am adding and i want it to be appear on the more portlets drop down individually.