Foros de discusión

Getting portlet title of an article in webcontent.

Durai pandian, modificado hace 11 años.

Getting portlet title of an article in webcontent.

Junior Member Mensajes: 53 Fecha de incorporación: 26/10/12 Mensajes recientes
Hi friends,
When an article is published in web content , I need to get the portlet title of the web content (for eg : I gave 'News letter' as title). I need to get this title in my java class(created ext for JournalArticleLocalServiceBaseImpl); can u please tell me how to do it.
Thank you!!
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: Getting portlet title of an article in webcontent.

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
I'm not sure what you mean by "portlet title"? Do you mean title of web content?

Try
JournalArticleLocalServiceUtil.getArticle(....).getTitle(languageId);
Durai pandian, modificado hace 11 años.

RE: Getting portlet title of an article in webcontent.

Junior Member Mensajes: 53 Fecha de incorporación: 26/10/12 Mensajes recientes
Hi Hitoshi ,
Im asking you the customized title of the web content portlet which is by default Web Content at the top. For more information this is available in portletpreferences table. I need to retrieve this for particular article when when it is published.

Thank you
Gwowen Fu, modificado hace 11 años.

RE: Getting portlet title of an article in webcontent.

Expert Mensajes: 315 Fecha de incorporación: 27/12/10 Mensajes recientes
How about
String portletId = (String) request.getAttribute(WebKeys.PORTLET_ID);
String portletTitle = PortletLocalServiceUtil.getPortletById(portletId).getPortletInfo().getTitle();
Durai pandian, modificado hace 11 años.

RE: Getting portlet title of an article in webcontent.

Junior Member Mensajes: 53 Fecha de incorporación: 26/10/12 Mensajes recientes
Hi Gwowen,
Is portletid is unique? Is there any chance that different portlets can have the same portlet id? explain me please
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: Getting portlet title of an article in webcontent.

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
portlet id is unique but it won't be Web Content because web content portlet is instanceable (that is, several web portlets can be placed in one page). I think it's suffixed with unique instance id to make it unique.
Durai pandian, modificado hace 11 años.

RE: Getting portlet title of an article in webcontent.

Junior Member Mensajes: 53 Fecha de incorporación: 26/10/12 Mensajes recientes
Gwowen Fu:
How about
String portletId = (String) request.getAttribute(WebKeys.PORTLET_ID);
String portletTitle = PortletLocalServiceUtil.getPortletById(portletId).getPortletInfo().getTitle();


In that case i could not find how to find the request attribute in my java class created in the ext file. can u please direct me?
Gwowen Fu, modificado hace 11 años.

RE: Getting portlet title of an article in webcontent.

Expert Mensajes: 315 Fecha de incorporación: 27/12/10 Mensajes recientes
I haven't done any ext plugin so I don't know what's available. Could anyone else reply?
Durai pandian, modificado hace 11 años.

RE: Getting portlet title of an article in webcontent.

Junior Member Mensajes: 53 Fecha de incorporación: 26/10/12 Mensajes recientes
Please any one reply how i can get the request attribute
thumbnail
Priyanka Dhingra, modificado hace 11 años.

RE: Getting portlet title of an article in webcontent.

Liferay Master Mensajes: 501 Fecha de incorporación: 20/12/11 Mensajes recientes
you can try giving the request object as a parameter to the function, if there is a problem in getting this in ext.

it will be better if you can specify which ext you are referring to