Use the below code for Inter Portlet Communication (IPC) for Portlets on Different Page:-
String plidName = "Sample_WAR_Sampleportlet";
long plidForward = getPortletId(plidName);
PortletURL url = new PortletURLImpl(request,plidName, plidForward, PortletRequest.ACTION_PHASE);
---------------------------------------------------------------------------------
public static long getPortletId(String portletId) {
PortletPreferences prfs = null;
try {
DetachedCriteria dCriteria = DetachedCriteria
.forClass(PortletPreferences.class);
dCriteria.add(Restrictions.eq("portletId", portletId));
DynamicQuery dynamicQuery = new DynamicQueryImpl(dCriteria);
List list = PortletPreferencesLocalServiceUtil.dynamicQuery(dynamicQuery);
if (!list.isEmpty()) {
prfs = (PortletPreferences) list.get(0);
}
} catch (Exception e) {
e.printStackTrace();
}
return prfs.getPlid();
}
Wednesday, November 24, 2010
Inter Portlet Communication (IPC) for Portlets on Different Page
Posted by Arun on 10:32:00 AM
0 comments:
Post a Comment