Examples of PortletURL


Examples of javax.portlet.PortletURL

    }

    public String getActionURL(FacesContext facesContext, String viewId) {
        if (PortletUtil.isRenderResponse(facesContext)) {
            RenderResponse response = (RenderResponse) facesContext.getExternalContext().getResponse();
            PortletURL url = response.createActionURL();
            url.setParameter(MyFacesGenericPortlet.VIEW_ID, viewId);
            return url.toString();
        }

        String path = getViewIdPath(facesContext, viewId);
        if (path.length() > 0 && path.charAt(0) == '/') {
            return facesContext.getExternalContext().getRequestContextPath() + path;
View Full Code Here

Examples of javax.portlet.PortletURL

    public ILink constructLink(IEngineService service, boolean post, Map parameters,
            boolean stateful)
    {
        finalizeParameters(service, parameters);

        PortletURL url = _renderResponse.createActionURL();

        return new PortletLink(_requestCycle, url, new QueryParameterMap(parameters), stateful);
    }
View Full Code Here

Examples of javax.portlet.PortletURL

     * @param action
     * @return action URL or null if called outside a MimeRequest (outside a
     *         UIDL request or similar)
     */
    public PortletURL generateActionURL(String action) {
        PortletURL url = null;
        PortletResponse response = getCurrentResponse();
        if (response instanceof MimeResponse) {
            url = ((MimeResponse) response).createActionURL();
            url.setParameter("javax.portlet.action", action);
        } else {
            return null;
        }
        return url;
    }
View Full Code Here

Examples of javax.portlet.PortletURL

        if (response instanceof MimeResponse) {
            String actionKey = "" + System.currentTimeMillis();
            while (eventActionDestinationMap.containsKey(actionKey)) {
                actionKey = actionKey + ".";
            }
            PortletURL actionUrl = generateActionURL(actionKey);
            if (actionUrl != null) {
                eventActionDestinationMap.put(actionKey, name);
                eventActionValueMap.put(actionKey, value);
                uI.getPage().setLocation(actionUrl.toString());
            } else {
                // this should never happen as we already know the response is a
                // MimeResponse
                throw new IllegalStateException(
                        "Portlet events can only be sent from a portlet request");
View Full Code Here

Examples of javax.portlet.PortletURL

        if (response instanceof MimeResponse) {
            String actionKey = "" + System.currentTimeMillis();
            while (sharedParameterActionNameMap.containsKey(actionKey)) {
                actionKey = actionKey + ".";
            }
            PortletURL actionUrl = generateActionURL(actionKey);
            if (actionUrl != null) {
                sharedParameterActionNameMap.put(actionKey, name);
                sharedParameterActionValueMap.put(actionKey, value);
                uI.getPage().setLocation(actionUrl.toString());
            } else {
                // this should never happen as we already know the response is a
                // MimeResponse
                throw new IllegalStateException(
                        "Shared parameters can only be set from a portlet request");
View Full Code Here

Examples of javax.portlet.PortletURL

     */
    public void setPortletMode(UI uI, PortletMode portletMode)
            throws IllegalStateException, PortletModeException {
        PortletResponse response = getCurrentResponse();
        if (response instanceof MimeResponse) {
            PortletURL url = ((MimeResponse) response).createRenderURL();
            url.setPortletMode(portletMode);
            throw new RuntimeException("UI.open has not yet been implemented");
            // UI.open(new ExternalResource(url.toString()));
        } else if (response instanceof StateAwareResponse) {
            ((StateAwareResponse) response).setPortletMode(portletMode);
        } else {
View Full Code Here

Examples of javax.portlet.PortletURL

  protected PortletURL getPortletURL() {
    PortletHolder portletBean = (PortletHolder) pageContext.getAttribute(Constant.session_portlet_bean);
    if (portletBean == null)
      portletBean = (PortletHolder)pageContext.getRequest().getAttribute(Constant.session_portlet_bean);

    PortletURL portletURL = portletBean.getRenderResponse().createRenderURL();
    return portletURL;
  }
View Full Code Here

Examples of javax.portlet.PortletURL

  protected PortletURL getPortletURL() {
    PortletHolder portletBean = (PortletHolder) pageContext.getAttribute(Constant.session_portlet_bean);
    if (portletBean == null)
      portletBean = (PortletHolder)pageContext.getRequest().getAttribute(Constant.session_portlet_bean);

    PortletURL portletURL = portletBean.getRenderResponse().createActionURL();
    return portletURL;
  }
View Full Code Here

Examples of javax.portlet.PortletURL

    public String getActionURL(FacesContext facesContext, String viewId)
    {
        if (PortletUtil.isRenderResponse(facesContext))
        {
            RenderResponse response = (RenderResponse)facesContext.getExternalContext().getResponse();
            PortletURL url = response.createActionURL();
            url.setParameter(MyFacesGenericPortlet.VIEW_ID, viewId);
            return url.toString();
        }

        String path = getViewIdPath(facesContext, viewId);
        if (path.length() > 0 && path.charAt(0) == '/')
        {
View Full Code Here

Examples of javax.portlet.PortletURL

        if (urlTag == null) {
            throw new JspException(
                "the 'param' Tag must have actionURL or renderURL as a parent");
        }

        PortletURL url = urlTag.getUrl();

        if (getName() != null) {
            url.setParameter(getName(), getValue());
        }

        return SKIP_BODY;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.