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);
}
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;
}
Aggregations