Foren

How to get the "plid" for page??

carol u, geändert vor 15 Jahren.

How to get the "plid" for page??

New Member Beiträge: 3 Beitrittsdatum: 26.08.08 Neueste Beiträge
I want to get the plid for my page,How do I do that?
saumil nitin baxi, geändert vor 15 Jahren.

RE: How to get the "plid" for page??

Junior Member Beiträge: 31 Beitrittsdatum: 07.04.08 Neueste Beiträge
Hi ,

Use the below code to get plid



ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute (
     com.liferay.portal.kernel.util.WebKeys.THEME_DISPLAY);            
Layout layout = themeDisplay.getLayout(); 
long plid = layout.getPlid() ;
thumbnail
ankit yakkundi, geändert vor 13 Jahren.

RE: How to get the "plid" for page??

Regular Member Beiträge: 221 Beitrittsdatum: 05.03.10 Neueste Beiträge
Hi..
Where do i have to copy the code??? Can i directly copy it in view.jsp page of the portlet???
Basically i want to open a portlet when i click on the link of simple jsp portlet.
Can anyone suggest how to do that???


As far as i know i will need portlet name and plid.
Can anyone suggest me the code for view.jsp????


Any idea or suggestions are welcome..
Thanks in advance..
thumbnail
Rishi Dev Gupta, geändert vor 13 Jahren.

RE: How to get the "plid" for page??

Expert Beiträge: 255 Beitrittsdatum: 23.11.08 Neueste Beiträge
I have done this for struts portlet and you can modify the code accordingly



PortletURL regionURL = new PortletURLImpl(request, "ABD", plid, PortletRequest.RENDER_PHASE);
regionURL.setPortletMode(PortletMode.VIEW);
regionURL.setWindowState(WindowState.MAXIMIZED);
regionURL.setParameter("struts_action", "/ext/undp/se/classification/benchmark");



on the anchor tag use the url created above




<a href="<%=regionURL.toString()%>"><liferay-ui:message key="open-me" />	</a>
thumbnail
ankit yakkundi, geändert vor 13 Jahren.

RE: How to get the "plid" for page??

Regular Member Beiträge: 221 Beitrittsdatum: 05.03.10 Neueste Beiträge
Hi..
Can you please specify what all changes i need to make?? I am very much confussed...
I am attaching two files ie view.jsp and error.bmp file..

please review and let me know the changes...

i want to open wiki portlet whose name is 36 from asimple jsp portlet.
thumbnail
Aditya Bhardwaj, geändert vor 8 Jahren.

RE: How to get the "plid" for page??

Junior Member Beiträge: 78 Beitrittsdatum: 08.01.15 Neueste Beiträge
Hi,
I know its too late but may be this can help somebody. If your page name is for example about than you can get the plid as:-

String pageName="/about";
long plid = 0L;
try {
plid = LayoutLocalServiceUtil.getFriendlyURLLayout(themeDisplay.getScopeGroupId(), false, pageName).getPlid();
System.out.println("Pliid==>"+plid);
} catch (Exception e) {
e.printStackTrace();
}