List of usage examples for com.liferay.portal.kernel.util PortalUtil getLiferayPortletResponse
public static LiferayPortletResponse getLiferayPortletResponse(PortletResponse portletResponse)
From source file:com.liferay.site.item.selector.web.internal.display.context.BaseSitesItemSelectorViewDisplayContext.java
License:Open Source License
@Override public PortletURL getPortletURL() throws PortletException { return PortletURLUtil.clone(portletURL, PortalUtil.getLiferayPortletResponse(getPortletResponse())); }
From source file:com.liferay.wiki.web.internal.portlet.action.ActionUtil.java
License:Open Source License
public static String getHtmlDiffResult(double sourceVersion, double targetVersion, PortletRequest portletRequest, PortletResponse portletResponse, WikiEngineRenderer wikiEngineRenderer) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY); long nodeId = ParamUtil.getLong(portletRequest, "nodeId"); String title = ParamUtil.getString(portletRequest, "title"); WikiPage sourcePage = WikiPageServiceUtil.getPage(nodeId, title, sourceVersion); WikiPage targetPage = WikiPageServiceUtil.getPage(nodeId, title, targetVersion); LiferayPortletResponse liferayPortletResponse = PortalUtil.getLiferayPortletResponse(portletResponse); PortletURL viewPageURL = liferayPortletResponse.createRenderURL(); viewPageURL.setParameter("mvcRenderCommandName", "wiki/view"); WikiNode sourceNode = sourcePage.getNode(); viewPageURL.setParameter("nodeName", sourceNode.getName()); PortletURL editPageURL = liferayPortletResponse.createRenderURL(); editPageURL.setParameter("mvcRenderCommandName", "wiki/edit_page"); editPageURL.setParameter("nodeId", String.valueOf(nodeId)); editPageURL.setParameter("title", title); String attachmentURLPrefix = WikiUtil.getAttachmentURLPrefix(themeDisplay.getPathMain(), themeDisplay.getPlid(), nodeId, title); return wikiEngineRenderer.diffHtml(sourcePage, targetPage, viewPageURL, editPageURL, attachmentURLPrefix); }