Search in sources :

Example 1 with PortletDisplay

use of com.liferay.portal.theme.PortletDisplay in project liferay-ide by liferay.

the class BaseGadgetPortlet method doRender.

protected void doRender(RenderRequest renderRequest, RenderResponse renderResponse) throws Exception {
    checkExpando(renderRequest, renderResponse);
    ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
    Portlet portlet = PortletLocalServiceUtil.getPortletById(themeDisplay.getCompanyId(), portletDisplay.getId());
    Gadget gadget = getGadget(renderRequest);
    if (gadget == null) {
        return;
    }
    GadgetSpec gadgetSpec = ShindigUtil.getGadgetSpec(gadget.getUrl());
    overrideConfiguration(gadgetSpec, portlet, portletDisplay);
    renderRequest.setAttribute(WebKeys.GADGET, gadget);
    String view = getView(renderRequest, gadgetSpec);
    renderRequest.setAttribute(WebKeys.VIEW, view);
}
Also used : GadgetSpec(org.apache.shindig.gadgets.spec.GadgetSpec) Gadget(com.liferay.opensocial.model.Gadget) Portlet(com.liferay.portal.model.Portlet) MVCPortlet(com.liferay.util.bridges.mvc.MVCPortlet) PortletDisplay(com.liferay.portal.theme.PortletDisplay) ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Example 2 with PortletDisplay

use of com.liferay.portal.theme.PortletDisplay in project liferay-ide by liferay.

the class BaseKBPortlet method buildEditURL.

protected String buildEditURL(ActionRequest actionRequest, ActionResponse actionResponse, KBArticle kbArticle) throws PortalException, SystemException {
    ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();
    String editURL = PortalUtil.getLayoutFullURL(themeDisplay);
    editURL = HttpUtil.setParameter(editURL, "p_p_id", portletDisplay.getId());
    editURL = HttpUtil.setParameter(editURL, actionResponse.getNamespace() + "mvcPath", templatePath + "edit_article.jsp");
    editURL = HttpUtil.setParameter(editURL, actionResponse.getNamespace() + "redirect", getRedirect(actionRequest, actionResponse));
    editURL = HttpUtil.setParameter(editURL, actionResponse.getNamespace() + "resourcePrimKey", kbArticle.getResourcePrimKey());
    editURL = HttpUtil.setParameter(editURL, actionResponse.getNamespace() + "status", WorkflowConstants.STATUS_ANY);
    return editURL;
}
Also used : PortletDisplay(com.liferay.portal.theme.PortletDisplay) ThemeDisplay(com.liferay.portal.theme.ThemeDisplay)

Aggregations

PortletDisplay (com.liferay.portal.theme.PortletDisplay)2 ThemeDisplay (com.liferay.portal.theme.ThemeDisplay)2 Gadget (com.liferay.opensocial.model.Gadget)1 Portlet (com.liferay.portal.model.Portlet)1 MVCPortlet (com.liferay.util.bridges.mvc.MVCPortlet)1 GadgetSpec (org.apache.shindig.gadgets.spec.GadgetSpec)1