当前位置: 首页>>代码示例>>Java>>正文


Java PortletURL.toString方法代码示例

本文整理汇总了Java中javax.portlet.PortletURL.toString方法的典型用法代码示例。如果您正苦于以下问题:Java PortletURL.toString方法的具体用法?Java PortletURL.toString怎么用?Java PortletURL.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.portlet.PortletURL的用法示例。


在下文中一共展示了PortletURL.toString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getURLViewInContext

import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public final String getURLViewInContext(
		LiferayPortletRequest liferayPortletRequest,
		LiferayPortletResponse liferayPortletResponse,
		String noSuchEntryRedirect) throws Exception {
	ThemeDisplay themeDisplay = (ThemeDisplay) liferayPortletRequest.getAttribute(WebKeys.THEME_DISPLAY);
	PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(_layout.getPlid(), _portletId, PortletRequest.RENDER_PHASE);
	portletURL.setParameter("actId",Long.toString( _learningactivity.getActId()));
	portletURL.setParameter("moduleId",Long.toString( _learningactivity.getModuleId()));
	portletURL.setParameter("actionEditingActivity", StringPool.FALSE);
	portletURL.setParameter("actionEditingDetails", StringPool.FALSE);
	portletURL.setParameter("actionEditingModule", StringPool.FALSE);
	portletURL.setParameter("actionCalifications", StringPool.FALSE);
	portletURL.setParameter("activityStarted", StringPool.TRUE);		
	
	String mvcPath = getMvcPathView(themeDisplay.getUserId(),liferayPortletResponse,liferayPortletRequest.getWindowState());
	if(Validator.isNotNull(mvcPath)){
		portletURL.setParameter("mvcPath",mvcPath);
	}
	
	prepareRuntimePortlet(portletURL);
	return portletURL.toString();
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:24,代码来源:LearningActivityBaseAssetRenderer.java

示例2: getLinkForOffset

import javax.portlet.PortletURL; //导入方法依赖的package包/类
public String getLinkForOffset(int newOffset, RenderResponse response) {
  String thisLink;
  if (response == null) {
    thisLink = addParameter(link, "pagedListInfoId", String.valueOf(this.getId())) +
        (getExpandedSelection() ? "&pagedListSectionId=" + this.getId() : "") +
        "&offset=" + (newOffset > 0 ? newOffset : 0);
  } else {
    PortletURL renderURL = response.createRenderURL();
    Map<String, String[]> params;
    if (renderParameters == null) {
      params = new HashMap<String, String[]>();
    } else {
      params = new HashMap<String, String[]>(renderParameters);
    }
    params.put("pagedListInfoId", new String[]{this.getId()});
    params.put("pagedListSectionId", new String[]{this.getId()});
    params.put("offset", new String[]{String.valueOf(newOffset > 0 ? newOffset : 0)});
    params.put("page", new String[]{String.valueOf(newOffset > 0 ? newOffset % 10 : 0)});
    renderURL.setParameters(params);
    thisLink = renderURL.toString();
  }
  return thisLink;
}
 
开发者ID:Concursive,项目名称:concourseconnect-community,代码行数:24,代码来源:PagedListInfo.java

示例3: resolveListViewRedirectPage

import javax.portlet.PortletURL; //导入方法依赖的package包/类
/**
 * 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());
	}
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:28,代码来源:ChatRoomPortlet.java

示例4: montarlinkParaSala

import javax.portlet.PortletURL; //导入方法依赖的package包/类
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;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:25,代码来源:RedirecionaSalasPortalBean.java

示例5: EditPage

import javax.portlet.PortletURL; //导入方法依赖的package包/类
public EditPage() {

		// Obtém a página de visualização
		RenderResponse rRes = UIUtils.getRenderResponse();
		PortletURL pURL = rRes.createRenderURL();
		try {
			pURL.setPortletMode(PortletMode.VIEW);
		} catch (PortletModeException e) {
		}
		viewUrl = pURL.toString();

		PortletPreferences pp = UIUtils.getPortletPreferences();

		initFeedbackPanel();
		initForm();
		initMensagem(pp);
		initUrl(pp);
		initVoltar();
	}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:20,代码来源:EditPage.java

示例6: getAssetViewURL

import javax.portlet.PortletURL; //导入方法依赖的package包/类
/**
 * Gets the search result's view URL
 *
 * @param document The searched document
 * @param request The request
 * @param response The response
 * @param currentLayout The current page
 * @param tabId The search tab ID
 *
 * @return The search result URL
 */
private String getAssetViewURL(Document document, PortletRequest request, PortletResponse response, Layout currentLayout, String tabId, String keywords) {
    String className = document.get(Field.ENTRY_CLASS_NAME);
    long classPK = GetterUtil.getLong(document.get(Field.ENTRY_CLASS_PK));
    String currentUrl = this.portal.getCurrentURL(request);
    String returnedUrl;

    if(ASSET_TYPE.equals(className) && classPK > 0) {
        try {
            String portletId = (String) request.getAttribute(WebKeys.PORTLET_ID);
            PortletURL viewInPortletUrlObj = this.portletUrlFactory.create(request, portletId, currentLayout, LIFECYCLE_RENDER);
            viewInPortletUrlObj.setParameter(PortletRequestParameter.VIEW_MODE.getName(), ViewMode.VIEW_JOURNAL.getParamValue());
            viewInPortletUrlObj.setParameter(Field.ENTRY_CLASS_PK, Long.toString(classPK));
            viewInPortletUrlObj.setParameter(PortletRequestParameter.TAB_ID.getName(), tabId);
            viewInPortletUrlObj.setParameter(PortletRequestParameter.KEYWORDS.getName(), keywords);
            String viewInPortletUrl = viewInPortletUrlObj.toString();

            AssetRendererFactory<?> assetRendererFactory = AssetRendererFactoryRegistryUtil.getAssetRendererFactoryByClassName(className);
            AssetRenderer<?> assetRenderer = assetRendererFactory.getAssetRenderer(classPK);
            returnedUrl = assetRenderer.getURLViewInContext((LiferayPortletRequest) request, (LiferayPortletResponse) response, viewInPortletUrl);
        } catch(Exception e) {
            returnedUrl = currentUrl;
        }
    } else {
        returnedUrl = currentUrl;
    }

    return returnedUrl;
}
 
开发者ID:savoirfairelinux,项目名称:flashlight-search,代码行数:40,代码来源:JournalArticleSearchResultProcessor.java

示例7: getCertificateURL

import javax.portlet.PortletURL; //导入方法依赖的package包/类
public String getCertificateURL(LiferayPortletResponse liferayPortletResponse,String uuid)
{
	UserCompetence uc=findByUuid(uuid);
	if(uc!=null)
	{
		PortletURL resourcePortletURL=liferayPortletResponse.createResourceURL("usercompetence_WAR_liferaylmsportlet");
		resourcePortletURL.setParameter("uuid",uuid);
		return resourcePortletURL.toString();
	}
	else
	{
		return "";
	}
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:15,代码来源:UserCompetenceLocalServiceImpl.java

示例8: getURLViewInContext

import javax.portlet.PortletURL; //导入方法依赖的package包/类
@Override
public String getURLViewInContext(
		LiferayPortletRequest liferayPortletRequest,
		LiferayPortletResponse liferayPortletResponse,
		String noSuchEntryRedirect) throws Exception {
	PortletURL viewPortletURL = liferayPortletResponse.createRenderURL("taskactivity_WAR_liferaylmsportlet");
	viewPortletURL.setWindowState(LiferayWindowState.NORMAL);
	viewPortletURL.setParameter("jspPage", "/html/taskactivity/view.jsp");
	viewPortletURL.setParameter("actId",Long.toString( _learningactivity.getActId()));
	return viewPortletURL.toString();
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:12,代码来源:TaskAssetRenderer.java

示例9: getPortletModeUrl

import javax.portlet.PortletURL; //导入方法依赖的package包/类
/**
 * Helper to get the URL to take us to a portlet mode.
 * This will end up in doDispatch.
 * 
 * @param response
 * @return
 */
private String getPortletModeUrl(RenderResponse response, PortletMode mode) {

	PortletURL url = response.createRenderURL();
    try {
    	url.setPortletMode(mode);
	} catch (PortletModeException e) {
		log.error("Invalid portlet mode: " + mode);
		return null;
	}
    
	return url.toString();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:20,代码来源:SimpleRSSPortlet.java

示例10: getRenderURL

import javax.portlet.PortletURL; //导入方法依赖的package包/类
/**
 * Creates a render URL from the given request and parameters
 * 
 * @param request
 *           the request
 * @param parameters
 *           the parameters
 * @return the render url
 */
public static String getRenderURL(ServletRequest request, Map<String, String[]> parameters)
{
   RenderResponse renderResp = (RenderResponse) request.getAttribute("javax.portlet.response");
   if (renderResp == null)
   {
      throw new IllegalStateException("RenderResponse object is null");
   }

   PortletURL url = renderResp.createRenderURL();
   url.setParameters(parameters);
   return url.toString();
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:22,代码来源:AlfrescoFacesPortlet.java

示例11: buildViewUrl

import javax.portlet.PortletURL; //导入方法依赖的package包/类
/**
 * URL para redirecionar para visualização
 */
private void buildViewUrl() {
	RenderResponse rRes = UIUtils.getRenderResponse();
	PortletURL pURL = rRes.createRenderURL();
	try {
		pURL.setPortletMode(PortletMode.VIEW);
	} catch (PortletModeException e) {
	}
	viewUrl = pURL.toString();
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:13,代码来源:ConfiguracaoPage.java

示例12: montarlinkParaBotaoVoltar

import javax.portlet.PortletURL; //导入方法依赖的package包/类
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;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:16,代码来源:RedirecionaSalasPortalBean.java

示例13: getURLViewInContext

import javax.portlet.PortletURL; //导入方法依赖的package包/类
@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;
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:30,代码来源:SongAssetRenderer.java

示例14: getURLViewInContext

import javax.portlet.PortletURL; //导入方法依赖的package包/类
@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;
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:30,代码来源:AlbumAssetRenderer.java

示例15: getURLViewInContext

import javax.portlet.PortletURL; //导入方法依赖的package包/类
@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;
}
 
开发者ID:juliocamarero,项目名称:jukebox-portlet,代码行数:30,代码来源:ArtistAssetRenderer.java


注:本文中的javax.portlet.PortletURL.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。