Foren

How to get plid of portlte if portlet is instanicable?

thumbnail
meera prince, geändert vor 11 Jahren.

How to get plid of portlte if portlet is instanicable?

Liferay Legend Beiträge: 1111 Beitrittsdatum: 08.02.11 Neueste Beiträge
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, geändert vor 11 Jahren.

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

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
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, geändert vor 11 Jahren.

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

Liferay Legend Beiträge: 1111 Beitrittsdatum: 08.02.11 Neueste Beiträge
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, geändert vor 11 Jahren.

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

Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
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, geändert vor 11 Jahren.

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

Liferay Legend Beiträge: 1111 Beitrittsdatum: 08.02.11 Neueste Beiträge
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, geändert vor 11 Jahren.

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

Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
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, geändert vor 11 Jahren.

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

Liferay Legend Beiträge: 1111 Beitrittsdatum: 08.02.11 Neueste Beiträge
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, geändert vor 11 Jahren.

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

Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
If you remove portlet from page then instance id will be changed ..
thumbnail
meera prince, geändert vor 11 Jahren.

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

Liferay Legend Beiträge: 1111 Beitrittsdatum: 08.02.11 Neueste Beiträge
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, geändert vor 11 Jahren.

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

Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
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, geändert vor 11 Jahren.

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

Liferay Legend Beiträge: 1111 Beitrittsdatum: 08.02.11 Neueste Beiträge
Ya your rite..
Thank you Jitendra Rajput