Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
Julien S
Getting all active portlets on a portal
23 dicembre 2010 3.37
Risposta

Julien S

Punteggio: New Member

Messaggi: 15

Data di Iscrizione: 21 dicembre 2010

Messaggi recenti

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
1<portlet>
2        <portlet-name>31</portlet-name>
3        <struts-path>image_gallery</struts-path>
4        <include>false</include>
5        <active>false</active>
6    </portlet>



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


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
RE: Getting all active portlets on a portal
23 dicembre 2010 7.16
Risposta

Julien S

Punteggio: New Member

Messaggi: 15

Data di Iscrizione: 21 dicembre 2010

Messaggi recenti

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...
Jelmer Kuperus
RE: Getting all active portlets on a portal
23 dicembre 2010 10.13
Risposta

Jelmer Kuperus

Punteggio: Liferay Legend

Messaggi: 1187

Data di Iscrizione: 10 marzo 2010

Messaggi recenti

You can use isSystem()