Fórumok

How to get plid of portlte if portlet is instanicable?

thumbnail
meera prince, módosítva 11 év-val korábban

How to get plid of portlte if portlet is instanicable?

Liferay Legend Bejegyzések: 1111 Csatlakozás dátuma: 2011.02.08. Legújabb bejegyzések
Hi All ,

I want know the plid of portlet. here my portlet is istanciable.
i want create some url dyanamically from plid . to get plid dynamically i need to pass PortletId. But my portlet is instanciable.
How to get url of portlet dynamically ?

Regards,
Meera Prince
thumbnail
Juhi Kumari, módosítva 11 év-val korábban

RE: How to get plid of portlte if portlet is instanicable?

Expert Bejegyzések: 347 Csatlakozás dátuma: 2011.12.12. Legújabb bejegyzések
Hi,
Using themeDisplay object you can get it.
themeDisplay.getPortletDisplay().getId()


It will return Id of portlet like
Receiver_WAR_Receiverportlet_INSTANCE_Cqz8
So in every instance of your portlet you will get dynamic portlet id with instance id .

Regards
Juhi
thumbnail
meera prince, módosítva 11 év-val korábban

RE: How to get plid of portlte if portlet is instanicable?

Liferay Legend Bejegyzések: 1111 Csatlakozás dátuma: 2011.02.08. Legújabb bejegyzések
Hi thank you for reply.

but here i want another portletDisplay object not current portletDisplay objet.
my intention is from portlet id i want get PortletDisplay object.
thumbnail
Jitendra Rajput, módosítva 11 év-val korábban

RE: How to get plid of portlte if portlet is instanicable?

Liferay Master Bejegyzések: 875 Csatlakozás dátuma: 2011.01.07. Legújabb bejegyzések
Plid you can also get it by passing friendly URL in LayoutLocalServiceUtil.getFriendlyURLLayout method . Once you have Layout object you can easily get plid from it.
thumbnail
meera prince, módosítva 11 év-val korábban

RE: How to get plid of portlte if portlet is instanicable?

Liferay Legend Bejegyzések: 1111 Csatlakozás dátuma: 2011.02.08. Legújabb bejegyzések
Hi Jitendra Rajput

Here i don't know where my portlet is placed means which layout my portlet available. i don't know the any information related to layout.
i just know only portlet id but my portlet is instanciable.


Regards,
Meera Prince
thumbnail
Jitendra Rajput, módosítva 11 év-val korábban

RE: How to get plid of portlte if portlet is instanicable?

Liferay Master Bejegyzések: 875 Csatlakozás dátuma: 2011.01.07. Legújabb bejegyzések
Did you tried by using below method from PortalUtil. ?

PortalUtil.getPlidFromPortletId(long groupId, String portletId)


1) Try without passing instance id in portlet id (portlet_WAR_name)
2) Try by passing portlet id along with instance details.
thumbnail
meera prince, módosítva 11 év-val korábban

RE: How to get plid of portlte if portlet is instanicable?

Liferay Legend Bejegyzések: 1111 Csatlakozás dátuma: 2011.02.08. Legújabb bejegyzések
HI Jitendra Rajput,

I tried that one. but in that i should pass PortletId that append with instance key. but here my question is i know portlet id and i can make instance id always same.
some time i delete portlet and i placed new one.
thumbnail
Jitendra Rajput, módosítva 11 év-val korábban

RE: How to get plid of portlte if portlet is instanicable?

Liferay Master Bejegyzések: 875 Csatlakozás dátuma: 2011.01.07. Legújabb bejegyzések
If you remove portlet from page then instance id will be changed ..
thumbnail
meera prince, módosítva 11 év-val korábban

RE: How to get plid of portlte if portlet is instanicable?

Liferay Legend Bejegyzések: 1111 Csatlakozás dátuma: 2011.02.08. Legújabb bejegyzések
ya you are rite that is my problem. if portlet is non instancable portlet id always same until i change in portlet.xml.

my requirement is i am doing some thing in one portlet after complistion of this i need to navidate to other portlet that is in diffrent layout. here i don't know this layout id and i know only portletId but my portlet is instanciable so i unable to find instance string.
thumbnail
Jitendra Rajput, módosítva 11 év-val korábban

RE: How to get plid of portlte if portlet is instanicable?

Liferay Master Bejegyzések: 875 Csatlakozás dátuma: 2011.01.07. Legújabb bejegyzések
As per my knowledge there can be 2 option .

1) Either remember friendly URL for layout
2) Make your portlet non instanciable

Update me if you know get better solution for your problem emoticon
thumbnail
meera prince, módosítva 11 év-val korábban

RE: How to get plid of portlte if portlet is instanicable?

Liferay Legend Bejegyzések: 1111 Csatlakozás dátuma: 2011.02.08. Legújabb bejegyzések
Ya your rite..
Thank you Jitendra Rajput