Package org.apache.pluto.driver.url

Examples of org.apache.pluto.driver.url.PortalURLParameter


            String value = null;
            if (st.hasMoreTokens()) {
              value = st.nextToken();
            }
            //set the
            PortalURLParameter param = decodeParameter(token, value);
            portalURL.addParameter(param);


          }
            else if (token.startsWith(PREFIX + PRIVATE_RENDER_PARAM)){
                String value = null;
                if (st.hasMoreTokens()) {
                    value = st.nextToken();
                }
                PortalURLParameter param = decodePublicParameter(token, value);
                if( param != null )
                {
                    //set private (Resource) parameter in portalURL
                    portalURL.getPrivateRenderParameters().put(param.getName(), param.getValues());
                }
            }
          else if (token.startsWith(PREFIX + PUBLIC_RENDER_PARAM)){
            String value = null;
            if (st.hasMoreTokens()) {
              value = st.nextToken();
            }
            PortalURLParameter param = decodePublicParameter(token, value);
            if( param != null )
            {
              //set public parameter in portalURL
              portalURL.addPublicParameterCurrent(param.getName(), param.getValues());
            }
          }
        }
        if (renderPath.length() > 0) {
            portalURL.setRenderPath(renderPath.toString());
View Full Code Here


        StringBuffer query = new StringBuffer("?");
        boolean firstParam = true;
        for (Iterator it = portalURL.getParameters().iterator();
            it.hasNext(); ) {

          PortalURLParameter param = (PortalURLParameter) it.next();

            // Encode action params in the query appended at the end of the URL.
            if (portalURL.getActionWindow() != null
                && portalURL.getActionWindow().equals(param.getWindowId())
                || (portalURL.getResourceWindow() != null
                    && portalURL.getResourceWindow().equals(param.getWindowId()))) {
              for (int i = 0; i < param.getValues().length; i++) {
                    // FIX for PLUTO-247
                    if ( firstParam ) {
                        firstParam = false;
                    } else {
                        query.append("&");
                    }
                    query.append(encodeQueryParam(param.getName())).append("=")
                        .append(encodeQueryParam(param.getValues()[i]));
                }
            }

            // Encode render params as a part of the URL.
            else if (param.getValues() != null
                && param.getValues().length > 0) {
                String valueString = encodeMultiValues(param.getValues());
                if (valueString.length() > 0) {
                  buffer.append("/").append(
                      encodeControlParameter(RENDER_PARAM, param.getWindowId(),
                               param.getName()));
                  buffer.append("/").append(valueString);
                }
            }
        }
View Full Code Here

      } catch (UnsupportedEncodingException e) {
        LOG.warn(e.getMessage(),e);
      }
        }
        // Construct portal URL parameter and return.
        return new PortalURLParameter(windowId, paramName, paramValues);
    }
View Full Code Here

        LOG.warn(e.getMessage(),e);
      }
        }

        // Construct portal URL parameter and return.
        return new PortalURLParameter(null, paramName, paramValues);
    }
View Full Code Here

    private void initParameterMap() {
        portletParameters = new HashMap();

        Iterator iterator = url.getParameters().iterator();
        while (iterator.hasNext()) {
            PortalURLParameter param = (PortalURLParameter) iterator.next();
            String name = param.getName();
            String[] values = param.getValues();
            if (param.getWindowId().equals(portletWindow.getId().getStringId())) {
                portletParameters.put(name, values);
            }
        }

        String id = portletWindow.getId().getStringId();
View Full Code Here

    public void setParameters(Map parameters) {
        Iterator it = parameters.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entry = (Map.Entry) it.next();
            PortalURLParameter param = new PortalURLParameter(
                window,
                (String) entry.getKey(),
                (String[]) entry.getValue());
            url.addParameter(param);
        }
View Full Code Here

        // Append action and render parameters.
        StringBuffer query = new StringBuffer("?");
        for (Iterator it = portalURL.getParameters().iterator();
            it.hasNext(); ) {
           
          PortalURLParameter param = (PortalURLParameter) it.next();
           
            // Encode action params in the query appended at the end of the URL.
            if (portalURL.getActionWindow() != null
                && portalURL.getActionWindow().equals(param.getWindowId())) {
                for (int i = 0; i < param.getValues().length; i++) {
                    query.append("&").append(encodeQueryParam(param.getName())).append("=")
                        .append(encodeQueryParam(param.getValues()[i]));
                }
            }
           
            // Encode render params as a part of the URL.
            else if (param.getValues() != null
                && param.getValues().length > 0) {
                String valueString = encodeMultiValues(param.getValues());
                if (valueString.length() > 0) {
                  buffer.append("/").append(
                      encodeControlParameter(RENDER_PARAM, param.getWindowId(),
                               param.getName()));
                  buffer.append("/").append(valueString);
                }
            }
        }
       
View Full Code Here

       
        // Split multiple values into a value array.
        String[] paramValues = value.split(VALUE_DELIM);
       
        // Construct portal URL parameter and return.
        return new PortalURLParameter(windowId, paramName, paramValues);
    }
View Full Code Here

     * @param windowId  the window ID.
     */
    public void clearParameters(String windowId) {
      for (Iterator it = parameters.entrySet().iterator(); it.hasNext(); ) {
            Map.Entry entry = (Map.Entry) it.next();
            PortalURLParameter param = (PortalURLParameter) entry.getValue();
            if (param.getWindowId().equals(windowId)) {
              it.remove();
            }
        }
    }
View Full Code Here

    public void setParameters(Map parameters) {
        Iterator it = parameters.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entry = (Map.Entry) it.next();
            PortalURLParameter param = new PortalURLParameter(
                window,
                (String) entry.getKey(),
                (String[]) entry.getValue());
            url.addParameter(param);
        }
View Full Code Here

TOP

Related Classes of org.apache.pluto.driver.url.PortalURLParameter

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.