Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Do Nguyen
Get all porlet instances id of portal
5. April 2013 23:44
Antwort

Do Nguyen

Rang: New Member

Nachrichten: 4

Eintrittsdatum: 26. Dezember 2011

Neue Beiträge

Hi all,
I want to get all portlet intances available of my page, here is my code:
 1
 2List<Portlet> portletList = null;
 3     try{
 4         portletList =PortletLocalServiceUtil.getPortlets();
 5     }catch(Exception e){}
 6     for(Portlet portlet : portletList){
 7         System.out.println("Portlet instance Id >>> "+portlet.getInstanceId());
 8         System.out.println("Portlet Display Name >>> "+portlet.getDisplayName());
 9         System.out.println("Portlet Id >>> "+portlet.getPortletId());
10         System.out.println("Portlet Name >>> "+portlet.getPortletName());
11}

When i added a document & library display portlet (id: 110) on my page, screen is print Portlet instance Id >>> null. How to print Portlet instance Id >>> 110_INSTANCE_asdjU8 ?
Please help me!
Thanks.
Apoorva Prakash
RE: Get all porlet instances id of portal
6. April 2013 04:51
Antwort

Apoorva Prakash

Rang: Liferay Master

Nachrichten: 659

Eintrittsdatum: 15. Juni 2010

Neue Beiträge

Do Nguyen:
Hi all,
I want to get all portlet intances available of my page, here is my code:
 1
 2List<Portlet> portletList = null;
 3     try{
 4         portletList =PortletLocalServiceUtil.getPortlets();
 5     }catch(Exception e){}
 6     for(Portlet portlet : portletList){
 7         System.out.println("Portlet instance Id >>> "+portlet.getInstanceId());
 8         System.out.println("Portlet Display Name >>> "+portlet.getDisplayName());
 9         System.out.println("Portlet Id >>> "+portlet.getPortletId());
10         System.out.println("Portlet Name >>> "+portlet.getPortletName());
11}

When i added a document & library display portlet (id: 110) on my page, screen is print Portlet instance Id >>> null. How to print Portlet instance Id >>> 110_INSTANCE_asdjU8 ?
Please help me!
Thanks.


Hi Nguyen,

Hope this blog post may help you.

Thanks and Regards,
Apoorva Prakash
Do Nguyen
RE: Get all porlet instances id of portal
6. April 2013 07:28
Antwort

Do Nguyen

Rang: New Member

Nachrichten: 4

Eintrittsdatum: 26. Dezember 2011

Neue Beiträge

You are my hero emoticon. It worked!
Thank you very much.
Apoorva Prakash
RE: Get all porlet instances id of portal
6. April 2013 10:43
Antwort

Apoorva Prakash

Rang: Liferay Master

Nachrichten: 659

Eintrittsdatum: 15. Juni 2010

Neue Beiträge

Do Nguyen:
You are my hero emoticon. It worked!
Thank you very much.


Welcome mate! emoticon