Hello.
If I have a page's unique name, how can I obtain its localized name from Websphere Portal Server?
I tried creating a Method build in my portlet and specifying the below code, but it did not work.
try {
Context ctx = new InitialContext();
PortletServiceHome psh = (PortletServiceHome)ctx.lookup("portletservice/com.ibm.portal.portlet.service.model.ContentModelProvider");
// the above call isn't working, but if it was, the following was going to be attempted
ContentModelProvider provider = (ContentModelProvider) psh.getPortletService(ContentModelProvider.class);
ContentModel model = provider.getContentModel(renderRequest, renderResponse);
Locator locator = model.getLocator();
ContentPage cPage = locator.findByUniqueName(aUniquePageName);
String pageLocalizedTitle = cPage.getTitle(Locale);
}
catch (Exception e) {
...
}
The above code was adapted from the sample on Websphere Portal 6.1.0 InfoCenter on this page:
http://publib.boulder.ibm.com/infocenter/wpdoc/v6r1/index.jsp?topic=/com.ibm.wp.ent.doc/dev/dgn_ptl.html
WebSphere Portal 6.1.0 > Developing portlets > Model SPI overview > Obtaining a model from the portal
The above ctx.lookup(..) call results in the following exception:
java.lang.ClassCastException: com.ibm.wps.services.portletserviceregistry.home.PortletServiceHomeImpl incompatible with com.ibm.portal.portlet.service.PortletServiceHome
Any help would be greatly appreciated.
K