Search in sources :

Example 26 with PortletURL

use of javax.portlet.PortletURL in project liferay-blade-samples by liferay.

the class BladeActionDisplayContext method _getOnclick.

private String _getOnclick() {
    PortletURL portletURL = PortletURLFactoryUtil.create(request, "blade_document_action_portlet_BladeDocumentActionPortlet", _themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);
    String fileName = fileVersion.getFileName();
    String mimeType = fileVersion.getMimeType();
    String version = fileVersion.getVersion();
    Date date = fileVersion.getCreateDate();
    String createdDate = date.toString();
    String createdUserName = fileVersion.getUserName();
    String statusLabel = WorkflowConstants.getStatusLabel(fileVersion.getStatus());
    portletURL.setParameter("fileName", fileName);
    portletURL.setParameter("mimeType", mimeType);
    portletURL.setParameter("version", version);
    portletURL.setParameter("statusLabel", statusLabel);
    portletURL.setParameter("createdDate", createdDate);
    portletURL.setParameter("createdUserName", createdUserName);
    try {
        portletURL.setWindowState(LiferayWindowState.POP_UP);
    } catch (WindowStateException wse) {
        _log.log(LogService.LOG_ERROR, wse.getMessage(), wse);
    }
    StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append("Liferay.Util.openWindow({");
    stringBuilder.append("dialog: {cache: false,width:800,modal: true},");
    stringBuilder.append("title: 'basic information',id: ");
    stringBuilder.append("'testPopupIdUnique',uri: '");
    stringBuilder.append(portletURL.toString() + "'});");
    return stringBuilder.toString();
}
Also used : WindowStateException(javax.portlet.WindowStateException) PortletURL(javax.portlet.PortletURL) Date(java.util.Date)

Aggregations

PortletURL (javax.portlet.PortletURL)26 ThemeDisplay (com.liferay.portal.theme.ThemeDisplay)6 KBArticle (com.liferay.knowledgebase.model.KBArticle)5 PortalException (com.liferay.portal.kernel.exception.PortalException)5 KBFolder (com.liferay.knowledgebase.model.KBFolder)4 SystemException (com.liferay.portal.kernel.exception.SystemException)3 WindowStateException (javax.portlet.WindowStateException)3 PortletPreferences (javax.portlet.PortletPreferences)2 Album (org.liferay.jukebox.model.Album)2 Song (org.liferay.jukebox.model.Song)2 JSONObject (com.liferay.portal.kernel.json.JSONObject)1 LiferayPortletURL (com.liferay.portal.kernel.portlet.LiferayPortletURL)1 FileEntry (com.liferay.portal.kernel.repository.model.FileEntry)1 FileVersion (com.liferay.portal.kernel.repository.model.FileVersion)1 ThemeDisplay (com.liferay.portal.kernel.theme.ThemeDisplay)1 Layout (com.liferay.portal.model.Layout)1 LayoutTypePortlet (com.liferay.portal.model.LayoutTypePortlet)1 Portlet (com.liferay.portal.model.Portlet)1 PortalPreferences (com.liferay.portlet.PortalPreferences)1 BlogsEntry (com.liferay.portlet.blogs.model.BlogsEntry)1