本文整理汇总了Java中com.liferay.portal.model.LayoutConstants.DEFAULT_PLID属性的典型用法代码示例。如果您正苦于以下问题:Java LayoutConstants.DEFAULT_PLID属性的具体用法?Java LayoutConstants.DEFAULT_PLID怎么用?Java LayoutConstants.DEFAULT_PLID使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.liferay.portal.model.LayoutConstants
的用法示例。
在下文中一共展示了LayoutConstants.DEFAULT_PLID属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveListViewRedirectPage
/**
* Verifica se a comunidade atual possui alguma página com o portlet de
* todas as comunidades. Se encontrar alguma, faz o redirect para a página.
* Se não encontrar envia para a página de listagem padrão onde são exibidas
* somente as salas da comunidade atual.
*
* @throws SystemException
* @throws PortalException
* @throws IOException
*
*/
private void resolveListViewRedirectPage(ActionRequest req, ActionResponse rsp) throws PortalException, SystemException, IOException {
ThemeDisplay td = (ThemeDisplay) req.getAttribute(WebKeys.THEME_DISPLAY);
long plid = PortalUtil.getPlidFromPortletId(td.getScopeGroupId(), CD_CHAT_ROOM_COMPLETE_LIST_PORTLET_ID);
if (plid != LayoutConstants.DEFAULT_PLID) {
PortletURL portletURL = PortletURLFactoryUtil.create(req, CD_CHAT_ROOM_COMPLETE_LIST_PORTLET_ID, plid, PortletRequest.ACTION_PHASE);
portletURL.setParameter("javax.portlet.action", "listChatRooms");
portletURL.setParameter("p_p_lifecycle", "1");
String url = portletURL.toString();
rsp.sendRedirect(url);
} else {
rsp.setRenderParameter(ChatPortletConstants.VIEW_PARAM, ChatRoomView.LIST.getUrlParamValue());
}
}
示例2: montarlinkParaSala
private String montarlinkParaSala(Long roomId, String lifecycle, String parameterKey, String parameterValue, String parameter_p_p_LifeCycle) {
String url = StringPool.BLANK;
try {
ChatRoom chatRoom = ChatRoomLocalServiceUtil.getChatRoom(roomId);
long groupId = chatRoom.getGroupId();
long plid = PortalUtil.getPlidFromPortletId(groupId, CD_CHAT_ROOM_PORTLET_ID);
if (plid != LayoutConstants.DEFAULT_PLID) {
PortletRequest request = (PortletRequest) LiferayFacesContext.getInstance().getExternalContext().getRequest();
PortletURL portletURL = PortletURLFactoryUtil.create(request, CD_CHAT_ROOM_PORTLET_ID, plid, lifecycle);
portletURL.setParameter(parameterKey, parameterValue);
portletURL.setParameter("roomId", roomId.toString());
portletURL.setParameter("p_p_lifecycle", parameter_p_p_LifeCycle);
url = portletURL.toString();
// LiferayFacesContext.getInstance().getExternalContext().redirect(url);
// // colocar quando sair nova versão do bridge jsf do liferay
// (stateless)
LinkSalasCacheUtil.setLinkEntrar(roomId, url);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return url;
}
示例3: getURLCalifications
public static final PortletURL getURLCalifications(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, LearningActivity activity) throws Exception {
long plid = PortalUtil.getPlidFromPortletId(activity.getGroupId(), ACTIVITY_VIEWER_PORTLET_ID);
log.debug("PLID: "+plid);
if (plid == LayoutConstants.DEFAULT_PLID) {
throw new NoSuchLayoutException();
}
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(plid, LMS_EDITACTIVITY_PORTLET_ID, PortletRequest.RENDER_PHASE);
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
portletURL.setParameter("actionEditingActivity", StringPool.FALSE);
portletURL.setParameter("actionEditingModule", StringPool.FALSE);
portletURL.setParameter("actionCalifications", StringPool.TRUE);
portletURL.setParameter("actId",Long.toString( activity.getActId()));
long userId = PrincipalThreadLocal.getUserId();
if(Validator.isNotNull(userId)) {
//portletURL.setParameter("mvcPath", "/html/editactivity/editactivity.jsp");
portletURL.setParameter("califications", StringPool.TRUE);
portletURL.setParameter("editing", StringPool.FALSE);
portletURL.setParameter("resId",Long.toString( activity.getActId()));
portletURL.setParameter("resModuleId",Long.toString( activity.getModuleId()));
}
portletURL.setParameter("p_o_p_id",ACTIVITY_VIEWER_PORTLET_ID);
//log.debug(" getURLCalifications: "+portletURL);
return portletURL;
}
示例4: getURLEditActivity
public static final PortletURL getURLEditActivity(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, LearningActivity activity) throws Exception {
PortletURL portletURL = null;
if(activity!=null){
long plid = PortalUtil.getPlidFromPortletId(activity.getGroupId(), ACTIVITY_VIEWER_PORTLET_ID);
log.debug("PLID: "+plid);
if (plid == LayoutConstants.DEFAULT_PLID) {
throw new NoSuchLayoutException();
}
portletURL = liferayPortletResponse.createLiferayPortletURL(plid, LMS_EDITACTIVITY_PORTLET_ID, PortletRequest.RENDER_PHASE);
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("actId",Long.toString( activity.getActId()));
portletURL.setParameter("moduleId",Long.toString( activity.getModuleId()));
portletURL.setParameter("actionEditingActivity", StringPool.TRUE);
portletURL.setParameter("actionCalifications", StringPool.FALSE);
portletURL.setParameter("actionEditingModule", StringPool.FALSE);
portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
long userId = PrincipalThreadLocal.getUserId();
if(Validator.isNotNull(userId)) {
portletURL.setParameter("mvcPath", "/html/editactivity/editactivity.jsp");
portletURL.setParameter("editing", StringPool.TRUE);
portletURL.setParameter("resId",Long.toString( activity.getActId()));
portletURL.setParameter("resModuleId",Long.toString( activity.getModuleId()));
}
portletURL.setParameter("p_o_p_id",ACTIVITY_VIEWER_PORTLET_ID);
//log.debug(" getURLEditActivity: "+portletURL);
}
return portletURL;
}
示例5: getURLCreateActivity
public static final PortletURL getURLCreateActivity(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, Module module) throws Exception {
PortletURL portletURL = null;
if(module!=null){
long plid = PortalUtil.getPlidFromPortletId(module.getGroupId(), ACTIVITY_VIEWER_PORTLET_ID);
log.debug("PLID: "+plid);
if (plid == LayoutConstants.DEFAULT_PLID) {
throw new NoSuchLayoutException();
}
portletURL = liferayPortletResponse.createLiferayPortletURL(plid, LMS_EDITACTIVITY_PORTLET_ID, PortletRequest.RENDER_PHASE);
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("actionEditingActivity", StringPool.TRUE);
portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
portletURL.setParameter("mvcPath", "/html/lmsactivitieslist/newactivity.jsp");
portletURL.setParameter("resModuleId",Long.toString(module.getModuleId()));
portletURL.setParameter("actId",Long.toString(0));
portletURL.setParameter("resId",Long.toString(0));
portletURL.setParameter("p_o_p_id",ACTIVITY_VIEWER_PORTLET_ID);
log.debug(" getURLCreateActivity: "+portletURL);
}
return portletURL;
}
示例6: getURLEditModule
public static final PortletURL getURLEditModule(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, Module module) throws Exception {
PortletURL portletURL = null;
if(module!=null){
long plid = PortalUtil.getPlidFromPortletId(module.getGroupId(), ACTIVITY_VIEWER_PORTLET_ID);
log.debug("PLID: "+plid);
if (plid == LayoutConstants.DEFAULT_PLID) {
throw new NoSuchLayoutException();
}
portletURL = liferayPortletResponse.createLiferayPortletURL(plid, LMS_EDITMODULE_PORTLET_ID, PortletRequest.RENDER_PHASE);
portletURL.setWindowState(WindowState.NORMAL);
portletURL.setParameter("actionEditingModule", StringPool.TRUE);
portletURL.setParameter("actionEditingActivity", StringPool.FALSE);
portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
portletURL.setParameter("actionCalifications", StringPool.FALSE);
portletURL.setParameter("view", "editmodule");
portletURL.setParameter("moduleId",Long.toString(module.getModuleId()));
portletURL.setParameter("actId","");
portletURL.setParameter("resourcePrimKey",Long.toString(module.getModuleId()));
portletURL.setParameter("editType","edit");
portletURL.setParameter("p_o_p_id",ACTIVITY_VIEWER_PORTLET_ID);
//log.debug(" getURLEditModule: "+portletURL);
}
return portletURL;
}
示例7: getUltimaPaginaVisitada
/**
* Obtem a última URL acessada pelo usuário, antes da página de cadastro
*
* @param req
* @return
* @throws SystemException
* @throws PortalException
*/
public static long getUltimaPaginaVisitada() throws PortalException, SystemException {
LiferayFacesContext facesContext = LiferayFacesContext.getInstance();
long companyId = facesContext.getCompanyId();
PortletRequest req = facesContext.getPortletRequest();
LastPath lp = (LastPath) req.getPortletSession().getAttribute(WebKeys.LAST_PATH, PortletSession.APPLICATION_SCOPE);
// Plid da página para onde redirecionar de volta: ou para a
// página de onde veio
// ou para a página incial
long plid = LayoutConstants.DEFAULT_PLID;
if (lp != null) {
plid = getPlidFromFriendlyURL(companyId, lp.getContextPath() + lp.getPath());
_log.info("PLID : " + plid + " lp " + lp.getContextPath() + lp.getPath());
} else {
_log.info("LP NULL");
}
// Página inicial
if (plid == LayoutConstants.DEFAULT_PLID) {
Group grupoGuest = GroupLocalServiceUtil.getGroup(companyId, GroupConstants.GUEST);
try {
Layout layout = LayoutLocalServiceUtil.getFriendlyURLLayout(grupoGuest.getGroupId(), false, "/principal");
plid = layout.getPlid();
} catch (NoSuchLayoutException e) {
plid = LayoutLocalServiceUtil.getDefaultPlid(grupoGuest.getGroupId(), false);
}
}
return plid;
}
示例8: montarlinkParaBotaoVoltar
private String montarlinkParaBotaoVoltar() {
String url = StringPool.BLANK;
try {
ThemeDisplay themeDisplay = (ThemeDisplay) LiferayFacesContext.getInstance().getPortletRequest().getAttribute(WebKeys.THEME_DISPLAY);
long plid = themeDisplay.getPlid();
if (plid != LayoutConstants.DEFAULT_PLID) {
PortletRequest request = (PortletRequest) LiferayFacesContext.getInstance().getExternalContext().getRequest();
PortletURL portletURL = PortletURLFactoryUtil.create(request, CD_CHAT_ROOM_COMPLETE_LIST_PORTLET_ID, plid, PortletRequest.RENDER_PHASE);
url = portletURL.toString();
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return url;
}
示例9: getURLViewInContext
@Override
public String getURLViewInContext(
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse,
String noSuchEntryRedirect) {
try {
long plid = PortalUtil.getPlidFromPortletId(
_song.getGroupId(), PortletKeys.SONGS);
if (plid == LayoutConstants.DEFAULT_PLID) {
return StringPool.BLANK;
}
PortletURL portletURL = PortletURLFactoryUtil.create(
liferayPortletRequest, PortletKeys.SONGS, plid,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("jspPage", "/html/songs/view_song.jsp");
portletURL.setParameter(
"songId", String.valueOf(_song.getSongId()));
return portletURL.toString();
}
catch (Exception e) {
}
return StringPool.BLANK;
}
示例10: getURLViewInContext
@Override
public String getURLViewInContext(
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse,
String noSuchEntryRedirect) {
try {
long plid = PortalUtil.getPlidFromPortletId(
_album.getGroupId(), PortletKeys.ALBUMS);
if (plid == LayoutConstants.DEFAULT_PLID) {
return StringPool.BLANK;
}
PortletURL portletURL = PortletURLFactoryUtil.create(
liferayPortletRequest, PortletKeys.ALBUMS, plid,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("jspPage", "/html/albums/view_album.jsp");
portletURL.setParameter(
"albumId", String.valueOf(_album.getAlbumId()));
return portletURL.toString();
}
catch (Exception e) {
}
return StringPool.BLANK;
}
示例11: getURLViewInContext
@Override
public String getURLViewInContext(
LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse,
String noSuchEntryRedirect) {
try {
long plid = PortalUtil.getPlidFromPortletId(
_artist.getGroupId(), PortletKeys.ARTISTS);
if (plid == LayoutConstants.DEFAULT_PLID) {
return StringPool.BLANK;
}
PortletURL portletURL = PortletURLFactoryUtil.create(
liferayPortletRequest, PortletKeys.ARTISTS, plid,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("jspPage", "/html/artists/view_artist.jsp");
portletURL.setParameter(
"artistId", String.valueOf(_artist.getArtistId()));
return portletURL.toString();
}
catch (Exception e) {
}
return StringPool.BLANK;
}