Package org.apache.cocoon.environment.wrapper

Examples of org.apache.cocoon.environment.wrapper.RequestParameters


            newAttrs.addCDATAAttribute("action", uri);
            this.sendStartElementEvent("form", newAttrs);
            this.stack.push("form");
            if ( addParametersAsHiddenFields ) {
                // create hidden input fields
                RequestParameters pars = new RequestParameters(parameters);
                Enumeration enumeration = pars.getParameterNames();
                while ( enumeration.hasMoreElements() ) {
                    final String pName = (String)enumeration.nextElement();
                    final String[] pValues = pars.getParameterValues(pName);
                    for(int k=0; k<pValues.length; k++) {
                        final String pValue = pValues[k];
                        AttributesImpl hiddenAttrs = new AttributesImpl();
                        hiddenAttrs.addCDATAAttribute("type", "hidden");
                        hiddenAttrs.addCDATAAttribute("name", pName);
View Full Code Here


    public void addUniqueParameterToLink(String name, String value) {
        final Info info = this.getInfo();
        if ( info.hasParameters ) {
            final int pos = info.linkBase.toString().indexOf("?");
            final String queryString = info.linkBase.substring(pos + 1);
            final RequestParameters params = new RequestParameters(queryString);
            if ( params.getParameter(name) != null ) {
                // the parameter is available, so remove it
                info.linkBase.delete(pos, info.linkBase.length() + 1);
                info.hasParameters = false;
               
                Enumeration enumeration = params.getParameterNames();
                while ( enumeration.hasMoreElements() ) {
                    final String paramName = (String)enumeration.nextElement();
                    if ( !paramName.equals(name) ) {
                        String[] values = params.getParameterValues(paramName);
                        for( int i = 0; i < values.length; i++ ) {
                            this.addParameterToLink(paramName, values[i]);
                        }
                    }
                }
View Full Code Here

                this.manager.release(service);
            }
            this.startElement("", "form", "form", ai);
            if ( parameters != null && parameters.length() > 0 ) {
                // create hidden input fields
                RequestParameters pars = new RequestParameters(parameters);
                Enumeration enumPars = pars.getParameterNames();
                while ( enumPars.hasMoreElements() ) {
                    String pName = (String)enumPars.nextElement();
                    String pValue = pars.getParameter(pName);
                    AttributesImpl hiddenAttrs = new AttributesImpl();
                    hiddenAttrs.addCDATAAttribute("type", "hidden");
                    hiddenAttrs.addCDATAAttribute("name", pName);
                    hiddenAttrs.addCDATAAttribute("value", pValue);
                    this.startElement("", "input", "input", hiddenAttrs);
View Full Code Here

                    a = ai;
                    final String queryString = action.substring(pos+1);
                    ai.removeAttribute("action");
                    ai.addCDATAAttribute("action", action.substring(0, pos));
                    super.startElement(uri, loc, raw, a);
                    RequestParameters rp = new RequestParameters(queryString);

                    final Enumeration e = rp.getParameterNames();
                    while ( e.hasMoreElements() ) {
                        final String key = (String)e.nextElement();
                        final String value = rp.getParameter(key);
                        AttributesImpl attributes = new AttributesImpl();
                        attributes.addCDATAAttribute("type", "hidden");
                        attributes.addCDATAAttribute("name", key);
                        attributes.addCDATAAttribute("value", value);
                        XMLUtils.createElement(this.contentHandler, "input", attributes);
View Full Code Here

    public void deleteParameterFromBase(String parameterName) {
        if ( this.hasParameters ) {
            final int pos = this.url.toString().indexOf("?");
            final String queryString = this.url.substring(pos + 1);
            final RequestParameters params = new RequestParameters(queryString);
            if ( params.getParameter(parameterName) != null ) {
                // the parameter is available, so remove it
                this.url.delete(pos, this.url.length() + 1);
                this.hasParameters = false;
               
                Enumeration enumeration = params.getParameterNames();
                while ( enumeration.hasMoreElements() ) {
                    final String paramName = (String)enumeration.nextElement();
                    if ( !paramName.equals(parameterName) ) {
                        String[] values = params.getParameterValues(paramName);
                        for( int i = 0; i < values.length; i++ ) {
                            this.addParameterToBase(paramName, values[i]);
                        }
                    }
                }
View Full Code Here

                this.manager.release(service);
            }
            this.startElement("", "form", "form", ai);
            if ( parameters != null && parameters.length() > 0 ) {
                // create hidden input fields
                RequestParameters pars = new RequestParameters(parameters);
                Enumeration enumPars = pars.getParameterNames();
                while ( enumPars.hasMoreElements() ) {
                    String pName = (String)enumPars.nextElement();
                    String pValue = pars.getParameter(pName);
                    AttributesImpl hiddenAttrs = new AttributesImpl();
                    hiddenAttrs.addCDATAAttribute("type", "hidden");
                    hiddenAttrs.addCDATAAttribute("name", pName);
                    hiddenAttrs.addCDATAAttribute("value", pValue);
                    this.startElement("", "input", "input", hiddenAttrs);
View Full Code Here

            newAttrs.addCDATAAttribute("action", uri);
            this.sendStartElementEvent("form", newAttrs);
            this.stack.push("form");
            if ( addParametersAsHiddenFields ) {
                // create hidden input fields
                RequestParameters pars = new RequestParameters(parameters);
                Enumeration enumeration = pars.getParameterNames();
                while ( enumeration.hasMoreElements() ) {
                    final String pName = (String)enumeration.nextElement();
                    final String[] pValues = pars.getParameterValues(pName);
                    for(int k=0; k<pValues.length; k++) {
                        final String pValue = pValues[k];
                        AttributesImpl hiddenAttrs = new AttributesImpl();
                        hiddenAttrs.addCDATAAttribute("type", "hidden");
                        hiddenAttrs.addCDATAAttribute("name", pName);
View Full Code Here

                    a = ai;
                    final String queryString = action.substring(pos+1);
                    ai.removeAttribute("action");
                    ai.addCDATAAttribute("action", action.substring(0, pos));
                    super.startElement(uri, loc, raw, a);
                    RequestParameters rp = new RequestParameters(queryString);

                    final Enumeration e = rp.getParameterNames();
                    while ( e.hasMoreElements() ) {
                        final String key = (String)e.nextElement();
                        final String value = rp.getParameter(key);
                        AttributesImpl attributes = new AttributesImpl();
                        attributes.addCDATAAttribute("type", "hidden");
                        attributes.addCDATAAttribute("name", key);
                        attributes.addCDATAAttribute("value", value);
                        XMLUtils.createElement(this.contentHandler, "input", attributes);
View Full Code Here

    public void addUniqueParameterToLink(String name, String value) {
        final Info info = this.getInfo();
        if ( info.hasParameters ) {
            final int pos = info.linkBase.toString().indexOf("?");
            final String queryString = info.linkBase.substring(pos + 1);
            final RequestParameters params = new RequestParameters(queryString);
            if ( params.getParameter(name) != null ) {
                // the parameter is available, so remove it
                info.linkBase.delete(pos, info.linkBase.length() + 1);
                info.hasParameters = false;
               
                Enumeration enumeration = params.getParameterNames();
                while ( enumeration.hasMoreElements() ) {
                    final String paramName = (String)enumeration.nextElement();
                    if ( !paramName.equals(name) ) {
                        String[] values = params.getParameterValues(paramName);
                        for( int i = 0; i < values.length; i++ ) {
                            this.addParameterToLink(paramName, values[i]);
                        }
                    }
                }
View Full Code Here

            newAttrs.addCDATAAttribute("action", uri);
            this.sendStartElementEvent("form", newAttrs);
            this.stack.push("form");
            if ( addParametersAsHiddenFields ) {
                // create hidden input fields
                RequestParameters pars = new RequestParameters(parameters);
                Enumeration enumeration = pars.getParameterNames();
                while ( enumeration.hasMoreElements() ) {
                    final String pName = (String)enumeration.nextElement();
                    final String[] pValues = pars.getParameterValues(pName);
                    for(int k=0; k<pValues.length; k++) {
                        final String pValue = pValues[k];
                        AttributesImpl hiddenAttrs = new AttributesImpl();
                        hiddenAttrs.addCDATAAttribute("type", "hidden");
                        hiddenAttrs.addCDATAAttribute("name", pName);
View Full Code Here

TOP

Related Classes of org.apache.cocoon.environment.wrapper.RequestParameters

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.