Foros de discusión

Getting all active portlets on a portal

Julien S, modificado hace 13 años.

Getting all active portlets on a portal

New Member Mensajes: 15 Fecha de incorporación: 21/12/10 Mensajes recientes
Hey there hello

I'm trying to get, as the subject says it, all the active portlets on a portal.
I've tried to set to inactive all the default portlets of Liferay, using the Control Panel and using the liferay-portlet-ext like this
<portlet>
		<portlet-name>31</portlet-name>
		<struts-path>image_gallery</struts-path>
		<include>false</include>
		<active>false</active>
	</portlet>



And then, tried to access the rest of the portlets using
for (Portlet portlet : PortletLocalServiceUtil.getPortlets()){
			if (portlet.isActive()){
//BLABLA
			}
		}


but I only get ALL the porlets, including those that should be inactive.

Do I miss something?
I'm on Liferay 6.0.5, Tomcat 6.0.26

Thanks for helping!
Julien S, modificado hace 13 años.

RE: Getting all active portlets on a portal

New Member Mensajes: 15 Fecha de incorporación: 21/12/10 Mensajes recientes
Ok, so, an answer that leads to another problem.

By using the getPortlets(themeDisplay.getCompanyId()), I can filter on the active protlets.

BUT, now, how can I make the difference between the portlets/application I can add on a page, and the others, that are on the control panel page?
I can't see any differences between them...
thumbnail
jelmer kuperus, modificado hace 13 años.

RE: Getting all active portlets on a portal (Respuesta)

Liferay Legend Mensajes: 1191 Fecha de incorporación: 10/03/10 Mensajes recientes
You can use isSystem()