Search in sources :

Example 1 with PortletBag

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;
}
Also used : GadgetPortlet(com.liferay.opensocial.gadget.portlet.GadgetPortlet) InvokerPortlet(com.liferay.portlet.InvokerPortlet) Portlet(com.liferay.portal.model.Portlet) GadgetPortlet(com.liferay.opensocial.gadget.portlet.GadgetPortlet) PortletBag(com.liferay.portal.kernel.portlet.PortletBag) PortletApp(com.liferay.portal.model.PortletApp)

Aggregations

GadgetPortlet (com.liferay.opensocial.gadget.portlet.GadgetPortlet)1 PortletBag (com.liferay.portal.kernel.portlet.PortletBag)1 Portlet (com.liferay.portal.model.Portlet)1 PortletApp (com.liferay.portal.model.PortletApp)1 InvokerPortlet (com.liferay.portlet.InvokerPortlet)1