Package javax.portlet

Examples of javax.portlet.PortletURL


    if (path != null)
    {
      path = getQualifiedPath(path);
      if (mimeResponse != null)
      {
        PortletURL url = mimeResponse.createRenderURL();
        url.setParameter(wicketUrlPortletParameter +
          portletRequest.getPortletMode().toString(), path.toString());
        path = saveLastEncodedUrl(url.toString(), path.toString());
      }
    }
    return path;
  }
View Full Code Here


        // write the meta-control navigation header
        PrintWriter writer = response.getWriter();
        writer.print("<block>");
        if (history.hasPreviousPage())
        {
            PortletURL prevAction = response.createActionURL() ;
            prevAction.setParameter(BROWSER_ACTION_PARAM, BROWSER_ACTION_PREVIOUS_PAGE);
            writer.print(" [<a href=\"" + prevAction.toString() +"\">Previous Page</a>] ");
        }
        PortletURL refreshAction = response.createActionURL() ;
        refreshAction.setParameter(BROWSER_ACTION_PARAM, BROWSER_ACTION_REFRESH_PAGE);
        writer.print(" [<a href=\"" + refreshAction.toString() +"\">Refresh Page</a>] ");
        if (history.hasNextPage())
        {
            PortletURL nextAction = response.createActionURL() ;
            nextAction.setParameter(BROWSER_ACTION_PARAM, BROWSER_ACTION_NEXT_PAGE);
            writer.print(" [<a href=\"" + nextAction.toString() +"\">Next Page</a>] ");
        }
        writer.print("</block><hr/>");

        // drain the stream to the portlet window
        ByteArrayInputStream bais = new ByteArrayInputStream(content);
View Full Code Here

        HttpMethod httpMethod = null ;
       
        try
        {
            // Set the action and base URLs in the rewriter
            PortletURL action = response.createActionURL();
            ((WebContentRewriter) rewriter).setActionURL(action);
            URL baseURL = new URL(sourceAttr);
            rewriter.setBaseUrl(baseURL.toString());
           
            // ...file URLs may be used for testing
View Full Code Here

            //Done
            read.close();
            */
            // Rewrite
      // Post Process for generated page   
      PortletURL actionURL = response.createActionURL();
      ScriptPostProcess processor = new ScriptPostProcess();
      processor.setInitalPage(page);
      processor.postProcessPage(actionURL, ACTION_PARAMETER_SSOPROXY);
      String finalPage = processor.getFinalizedPage();
     
View Full Code Here

     *      java.util.Map)
     */
    public String createResourceURL(PortletConfig config, RenderRequest request, RenderResponse response, Map parameters)
            throws PortletException
    {
        PortletURL url = response.createRenderURL();
        if (parameters != null)
        {
            url.setParameters(parameters);
        }
        url.setParameter(PortalReservedParameters.PORTLET_RESOURCE_URL_REQUEST_PARAMETER, "");
        return url.toString();
    }
View Full Code Here

      // the viewId into
      // the response
      // (interaction
      // state)
      RenderResponse renderResponse = (RenderResponse) getResponse();
      PortletURL actionURL = null;
      // Non-JSF actions are renderURLs as we merely dispatch to them
      if (urlType == Bridge.PortletPhase.ACTION_PHASE)
      {
        actionURL = renderResponse.createActionURL();
      }
      else
      {
        actionURL = renderResponse.createRenderURL();
      }

      // Add parameters so they don't get lost
      Enumeration<String> list = queryStr.getParameterNames();
      while (list.hasMoreElements())
      {
        String param = list.nextElement().toString();
        if (param.equals(Bridge.PORTLET_MODE_PARAMETER))
        {
          try
          {
            actionURL.setPortletMode(new PortletMode(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            ; // do nothing -- just ignore
          }
        }
        else if (param.equals(Bridge.PORTLET_WINDOWSTATE_PARAMETER))
        {
          try
          {
            actionURL.setWindowState(new WindowState(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            ; // do nothing -- just ignore
          }
        }
        else if (param.equals(Bridge.PORTLET_SECURE_PARAMETER))
        {
          try
          {
            actionURL.setSecure(Boolean.getBoolean(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            ; // do nothing -- just ignore
          }
        }
        else
        {
          actionURL.setParameter(param, queryStr.getParameter(param));
        }
      }
     
      // Carry forward render parameters if this is a portlet:url that references the current view
      if (isPortletURLSelfReference)
      {
        Map m = mOrigPortletRequest.getParameterMap();
        Set<Map.Entry<String, String[]>> s = m.entrySet();
        Iterator<Map.Entry<String, String[]>> i = s.iterator();
        while (i.hasNext())
        {
          Map.Entry<String, String[]> entry = i.next();
          // only add if not already added from above
          if (queryStr.getParameter(entry.getKey()) == null)
          {
            actionURL.setParameter(entry.getKey(), entry.getValue());
          }
        }
      }
     
      url = actionURL.toString();
     
      // JSF expects encodeActionURL to not perturb any XML encoding (or lack thereof) of the url.
      // I.e. the caller is responsible for either pre or post XML escaping the string sent/returned
      // by encodeActionURL.  Unfortunately, the portlet 1.0 spec didn't define whether toString()
      // returns an XML encoded string or not. Most containers behaved like the servlet environment and did not,
View Full Code Here

            action = sb.append(action).toString();
            LOG.debug("Resulting actionPath: " + action);
        }
        params.put(PortletActionConstants.ACTION_PARAM, new String[] { action });

        PortletURL url = null;
        if ("action".equalsIgnoreCase(type)) {
            LOG.debug("Creating action url");
            url = response.createActionURL();
        } else {
            LOG.debug("Creating render url");
            url = response.createRenderURL();
        }

        params.put(PortletActionConstants.MODE_PARAM, portletMode);
        url.setParameters(ensureParamsAreStringArrays(params));

        if ("HTTPS".equalsIgnoreCase(scheme)) {
            try {
                url.setSecure(true);
            } catch (PortletSecurityException e) {
                LOG.error("Cannot set scheme to https", e);
            }
        }
        try {
            url.setPortletMode(getPortletMode(request, portletMode));
            url.setWindowState(getWindowState(request, windowState));
        } catch (Exception e) {
            LOG.error("Unable to set mode or state:" + e.getMessage(), e);
        }
        result = url.toString();
        // TEMP BUG-WORKAROUND FOR DOUBLE ESCAPING OF AMPERSAND
        if(result.indexOf("&amp;") >= 0) {
            result = result.replace("&amp;", "&");
        }
        return result;
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) == '/') {
            return facesContext.getExternalContext().getRequestContextPath() + path;
View Full Code Here

        /*
         * We need this in order to get uploads to work. TODO this is not needed
         * for uploads anymore, check if this is needed for some other things
         */
        PortletURL appUri = response.createActionURL();
        config.put("appUri", "'" + appUri.toString() + "'");
        config.put("usePortletURLs", "true");
        ResourceURL uidlUrlBase = response.createResourceURL();
        uidlUrlBase.setResourceID("UIDL");
        config.put("portletUidlURLBase", "'" + uidlUrlBase.toString() + "'");
        config.put("pathInfo", "''");
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;
        if (response instanceof MimeResponse) {
            url = ((MimeResponse) response).createActionURL();
            url.setParameter("javax.portlet.action", action);
        } else {
            return null;
        }
        return url;
    }
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.