use of com.liferay.portal.kernel.portlet.PortletBag in project liferay-ide by liferay.
the class GadgetLocalServiceImpl method getPortlet.
protected Portlet getPortlet(String uuid, long companyId, String name) throws Exception {
Portlet portlet = _portletsPool.get(uuid);
if (portlet != null) {
return portlet;
}
String portletId = getPortletId(uuid);
portlet = PortletLocalServiceUtil.clonePortlet(_GADGET_PORTLET_ID);
portlet.setCompanyId(companyId);
portlet.setPortletId(portletId);
portlet.setTimestamp(System.currentTimeMillis());
PortletApp portletApp = PortletLocalServiceUtil.getPortletApp(ClpSerializer.getServletContextName());
portlet.setPortletApp(portletApp);
portlet.setPortletName(portletId);
portlet.setDisplayName(portletId);
portlet.setPortletClass(GadgetPortlet.class.getName());
Map<String, String> initParams = portlet.getInitParams();
initParams.put(InvokerPortlet.INIT_INVOKER_PORTLET_NAME, _GADGET_PORTLET_NAME);
addPortletExtraInfo(portlet, portletApp, name);
_portletsPool.put(uuid, portlet);
PortletBag portletBag = PortletBagPool.get(_GADGET_PORTLET_ID);
portletBag = (PortletBag) portletBag.clone();
portletBag.setPortletName(portletId);
portletBag.setPortletInstance(new GadgetPortlet());
PortletBagPool.put(portletId, portletBag);
return portlet;
}
Aggregations