Package org.apache.excalibur.source

Examples of org.apache.excalibur.source.SourceParameters


        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN addRole role="+name+", parameters="+parameters);
        }
        if (handler.getNewRoleResource() != null) {
            final String newRoleResource = handler.getNewRoleResource();
            final SourceParameters handlerPars = handler.getNewRoleResourceParameters();
            if (parameters == null) parameters = new SourceParameters();
            parameters.add(handlerPars);

            if (handler.getApplicationName() != null)
                parameters.setSingleParameterValue("application", handler.getApplicationName());
            parameters.setSingleParameterValue("type", "role");
View Full Code Here


                    throw new ProcessingException("Transformer exception: " + local, local);
                }
            }
            if (user == null || node == null) {
                final String newUserResource = handler.getNewUserResource();
                final SourceParameters newUsersPars = handler.getNewUserResourceParameters();
                if (parameters == null) parameters = new SourceParameters();
                parameters.add(newUsersPars);

                if (handler.getApplicationName() != null)
                    parameters.setSingleParameterValue("application", handler.getApplicationName());
                parameters.setSingleParameterValue("type", "user");
View Full Code Here

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN deleteRole role="+name+", parameters="+parameters);
        }
        if (handler.getDeleteRoleResource() != null) {
            final String deleteRoleResource = handler.getDeleteRoleResource();
            final SourceParameters handlerPars = handler.getDeleteRoleResourceParameters();
            if (parameters == null) parameters = new SourceParameters();
            parameters.add(handlerPars);

            if (handler.getApplicationName() != null)
                parameters.setSingleParameterValue("application", handler.getApplicationName());
            parameters.setSingleParameterValue("type", "role");
View Full Code Here

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN deleteUser role="+role+", ID="+name+", parameters="+parameters);
        }
        if (handler.getDeleteUserResource() != null) {
            final String deleteUserResource = handler.getDeleteUserResource();
            final SourceParameters handlerPars = handler.getDeleteUserResourceParameters();
            if (parameters == null) parameters = new SourceParameters();
            parameters.add(handlerPars);

            if (handler.getApplicationName() != null)
                parameters.setSingleParameterValue("application", handler.getApplicationName());
            parameters.setSingleParameterValue("type", "user");
View Full Code Here

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN changeUser role="+role+", ID="+name+", parameters="+parameters);
        }
        if (handler.getChangeUserResource() != null) {
            final String changeUserResource = handler.getChangeUserResource();
            final SourceParameters handlerPars = handler.getChangeUserResourceParameters();
            if (parameters == null) parameters = new SourceParameters();
            parameters.add(handlerPars);

            if (handler.getApplicationName() != null)
                parameters.setSingleParameterValue("application", handler.getApplicationName());
            parameters.setSingleParameterValue("type", "user");
View Full Code Here

     * A parameter can occur more than once with different values.
     * If <CODE>source</CODE> is not specified a new paramter object is created
     * otherwise the parameters are added to source.
     */
    public static SourceParameters createParameters(Node fragment, SourceParameters source) {
        SourceParameters par = (source == null ? new SourceParameters() : source);
        if (fragment != null) {
            NodeList   childs = fragment.getChildNodes();
            if (childs != null) {
                Node current;
                for(int i = 0; i < childs.getLength(); i++) {
                    current = childs.item(i);

                    // only element nodes
                    if (current.getNodeType() == Node.ELEMENT_NODE) {
                        current.normalize();
                        NodeList valueChilds = current.getChildNodes();
                        String   key;
                        StringBuffer   valueBuffer;
                        String         value;

                        key = current.getNodeName();
                        valueBuffer = new StringBuffer();
                        for(int m = 0; m < valueChilds.getLength(); m++) {
                            current = valueChilds.item(m); // attention: current is reused here!
                            if (current.getNodeType() == Node.TEXT_NODE) { // only text nodes
                                if (valueBuffer.length() > 0) valueBuffer.append(' ');
                                valueBuffer.append(current.getNodeValue());
                            }
                        }
                        value = valueBuffer.toString().trim();
                        if (key != null && value != null && value.length() > 0) {
                            par.setParameter(key, value);
                        }
                    }
                 }
             }
        }
View Full Code Here

        // first step: encode parameters which are already appended to the url
        int queryPos = uri.indexOf('?');

        if (queryPos!=-1) {
            String queryString = uri.substring(queryPos+1);
            SourceParameters queries = new SourceParameters(queryString);

            if (queries.hasParameters()) {
                StringBuffer buffer;

                buffer = new StringBuffer(uri.substring(0, queryPos));
                String current;
                Iterator iter = queries.getParameterNames();
                char separator = '?';
                Iterator values;

                while (iter.hasNext()==true) {
                    current = (String) iter.next();
                    values = queries.getParameterValues(current);
                    while (values.hasNext()) {
                        buffer.append(separator).append(current).append('=').append(org.apache.excalibur.source.SourceUtil.encode((String) values.next()));
                        separator = '&';
                    }
                }
View Full Code Here

                    content = XMLUtils.serializeNode(frag,
                                           XMLUtils.defaultSerializeToXMLFormat(false));
        }
       
                if (parameters==null) {
                    parameters = new SourceParameters();
                } else {
                    parameters = (SourceParameters) parameters.clone();
                }
                parameters.setSingleParameterValue("content", content);
                source = SourceUtil.getSource(location, typeParameters,
View Full Code Here

                  
            this.stack.push(this.endTextRecording());

        } else if (name.equals(CINCLUDE_PARAMETERS_ELEMENT)
                   && this.state == STATE_INCLUDE) {
            this.resourceParameters = new SourceParameters();
            // Now get the parameters off the stack
            String label = (String)stack.pop();
            String key = null;
            String value = null;
            while (!label.equals("end")) {
View Full Code Here

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN endParametersRecording source="+source);
        }
        this.sendEndPrefixMapping();
        ParametersRecorder recorder = (ParametersRecorder)this.removeRecorder();
        SourceParameters pars = recorder.getParameters(source);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END endParametersRecording parameters="+pars);
        }
        return pars;
View Full Code Here

TOP

Related Classes of org.apache.excalibur.source.SourceParameters

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.