掲示板

Programatically retrieve the list of available portlets

11年前 に Ratheesh Vijayakumaran Nair によって更新されました。

Programatically retrieve the list of available portlets

New Member 投稿: 19 参加年月日: 12/05/31 最新の投稿
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
11年前 に Christianto Sahat によって更新されました。

RE: Programatically retrieve the list of available portlets

Regular Member 投稿: 179 参加年月日: 07/09/25 最新の投稿
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
11年前 に Ratheesh Vijayakumaran Nair によって更新されました。

RE: Programatically retrieve the list of available portlets

New Member 投稿: 19 参加年月日: 12/05/31 最新の投稿
Thanks a lot, I'll try that.