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