Search in sources :

Example 1 with PortletURL

use of javax.portlet.PortletURL in project liferay-ide by liferay.

the class KBArticleAssetRendererFactory method getURLAdd.

@Override
public PortletURL getURLAdd(LiferayPortletRequest liferayPortletRequest, LiferayPortletResponse liferayPortletResponse) throws PortalException, SystemException {
    ThemeDisplay themeDisplay = (ThemeDisplay) liferayPortletRequest.getAttribute(WebKeys.THEME_DISPLAY);
    if (!AdminPermission.contains(themeDisplay.getPermissionChecker(), themeDisplay.getScopeGroupId(), ActionKeys.ADD_KB_ARTICLE)) {
        return null;
    }
    PortletURL portletURL = PortletURLFactoryUtil.create(liferayPortletRequest, PortletKeys.KNOWLEDGE_BASE_ADMIN, getControlPanelPlid(themeDisplay), PortletRequest.RENDER_PHASE);
    portletURL.setParameter("mvcPath", "/admin/edit_article.jsp");
    return portletURL;
}
Also used : ThemeDisplay(com.liferay.portal.theme.ThemeDisplay) PortletURL(javax.portlet.PortletURL)

Example 2 with PortletURL

use of javax.portlet.PortletURL in project liferay-ide by liferay.

the class AlbumTrashHandler method getRestoreContainedModelLink.

@Override
public String getRestoreContainedModelLink(PortletRequest portletRequest, long classPK) throws PortalException, SystemException {
    Album album = AlbumLocalServiceUtil.getAlbum(classPK);
    PortletURL portletURL = getRestoreURL(portletRequest, classPK);
    portletURL.setParameter("albumId", String.valueOf(album.getAlbumId()));
    return portletURL.toString();
}
Also used : Album(org.liferay.jukebox.model.Album) PortletURL(javax.portlet.PortletURL)

Example 3 with PortletURL

use of javax.portlet.PortletURL in project liferay-ide by liferay.

the class SongTrashHandler method getRestoreContainerModelLink.

@Override
public String getRestoreContainerModelLink(PortletRequest portletRequest, long classPK) throws PortalException, SystemException {
    Song song = SongLocalServiceUtil.getSong(classPK);
    PortletURL portletURL = getRestoreURL(portletRequest, classPK);
    portletURL.setParameter("songId", String.valueOf(song.getSongId()));
    return portletURL.toString();
}
Also used : Song(org.liferay.jukebox.model.Song) PortletURL(javax.portlet.PortletURL)

Example 4 with PortletURL

use of javax.portlet.PortletURL in project liferay-ide by liferay.

the class KBArticleURLHelper method createViewWithCommentsURL.

public PortletURL createViewWithCommentsURL(KBArticle kbArticle) throws PortalException, SystemException {
    PortletURL portletURL = createViewURL(kbArticle);
    portletURL.setParameter("expanded", Boolean.TRUE.toString());
    return portletURL;
}
Also used : PortletURL(javax.portlet.PortletURL)

Example 5 with PortletURL

use of javax.portlet.PortletURL in project liferay-ide by liferay.

the class KBArticleURLHelper method createViewURL.

public PortletURL createViewURL(KBArticle kbArticle) throws PortalException, SystemException {
    PortletURL portletURL = _renderResponse.createRenderURL();
    String portletId = PortalUtil.getPortletId(_renderRequest);
    if (portletId.startsWith(PortletKeys.KNOWLEDGE_BASE_ADMIN) || portletId.startsWith(PortletKeys.KNOWLEDGE_BASE_SECTION)) {
        portletURL.setParameter("mvcPath", _templatePath + "view_article.jsp");
    }
    if (portletId.startsWith(PortletKeys.KNOWLEDGE_BASE_ADMIN)) {
        portletURL.setParameter("redirect", PortalUtil.getCurrentURL(_renderRequest));
    }
    if (Validator.isNull(kbArticle.getUrlTitle()) || portletId.equals(PortletKeys.KNOWLEDGE_BASE_ADMIN)) {
        portletURL.setParameter("resourceClassNameId", String.valueOf(kbArticle.getClassNameId()));
        portletURL.setParameter("resourcePrimKey", String.valueOf(kbArticle.getResourcePrimKey()));
    } else {
        portletURL.setParameter("urlTitle", kbArticle.getUrlTitle());
        if (kbArticle.getKbFolderId() != KBFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
            KBFolder kbFolder = KBFolderServiceUtil.getKBFolder(kbArticle.getKbFolderId());
            portletURL.setParameter("kbFolderUrlTitle", kbFolder.getUrlTitle());
        }
    }
    return portletURL;
}
Also used : KBFolder(com.liferay.knowledgebase.model.KBFolder) PortletURL(javax.portlet.PortletURL)

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