Package javax.portlet

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


     * @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

        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

        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

     */
    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

  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

  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

    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

        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

            } else {
                writer.write("    Key: " + key + " Value: <br />");
            }
        }

        PortletURL url;
        url = res.createActionURL();
        url.setPortletMode(PortletMode.EDIT);

        writer.write("<form method=\"POST\" action=\"" + url.toString() + "\"><br />");
        writer.write("Update Preferences: <br />");
        writer.write("  Key: <input type=\"text\" name=\"name\" size=\"16\" maxlength=\"16\">");
        writer.write("  Value: <input type=\"text\" name=\"value\" size=\"32\" maxlength=\"32\">");
        writer.write("<br /><input type=\"submit\" value=\"Update Preferences\"/>");
        writer.write("</form>");
        writer.write("<table><tr><td>Change Portlet Mode:</td>");

        url = res.createRenderURL();
        url.setPortletMode(PortletMode.EDIT);
        this.writeLink(writer, url, "Edit");


        url = res.createRenderURL();
        url.setPortletMode(PortletMode.HELP);
        this.writeLink(writer, url, "Help");

        url = res.createRenderURL();
        url.setPortletMode(PortletMode.VIEW);
        this.writeLink(writer, url, "View");
       
        writer.write("</tr><tr><td>Change Window Mode:</td>");
        url = res.createRenderURL();
        url.setWindowState(WindowState.MINIMIZED);
        this.writeLink(writer, url, "Minimized");

        url = res.createRenderURL();
        url.setWindowState(WindowState.NORMAL);
        this.writeLink(writer, url, "Normal");

        url = res.createRenderURL();
        url.setWindowState(WindowState.MAXIMIZED);
        this.writeLink(writer, url, "Maximized");
        writer.write("</tr></table>");
    }
View Full Code Here

TOP

Related Classes of javax.portlet.PortletURL

Copyright © 2018 www.massapicom. 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.