Foros de discusión

Programatically retrieve the list of available portlets

Ratheesh Vijayakumaran Nair, modificado hace 11 años.

Programatically retrieve the list of available portlets

New Member Mensajes: 19 Fecha de incorporación: 31/05/12 Mensajes recientes
I have a requirement to allow the user to pick the portlets that he wants to see in a page. The idea is to create an application for the user and allow them to select a layout and the available portlets to be dragged into the layout area and make that as his custom page. So if the user accesses that custom page, I should display the portlet application that he chose in the layout he chose. I was able to get the list of available layout by using the List<LayoutTemplate> layoutTemplates = LayoutTemplateLocalServiceUtil.getLayoutTemplates(); I would like to know if there is a similar way to retrieve the list of available portlets so that can be shown as a list for the user to select to be added to his custom page. Is there a way to programmatically retrieve it?

Thanks
Ratheesh
thumbnail
Christianto Sahat, modificado hace 11 años.

RE: Programatically retrieve the list of available portlets

Regular Member Mensajes: 179 Fecha de incorporación: 25/09/07 Mensajes recientes
You can use PortletLocalServiceUtil.getPortlets() to display all the portlets inside the portal.

But I believe you don't want to display system portlet into the users. In that case you can use


    PortletLocalServiceUtil.getPortlets(long companyId, boolean showSystem, boolean showPortal) 
   

set showSystem and showPortal to false
Ratheesh Vijayakumaran Nair, modificado hace 11 años.

RE: Programatically retrieve the list of available portlets

New Member Mensajes: 19 Fecha de incorporación: 31/05/12 Mensajes recientes
Thanks a lot, I'll try that.