Package org.apache.cocoon.components.modules.input

Examples of org.apache.cocoon.components.modules.input.InputModule


                .length());
        String lmLocation = "";
        Source lmSource = null;
        SourceResolver resolver = null;
        ServiceSelector selector = null;
        InputModule inputModule = null;
        try {
            selector = (ServiceSelector) m_manager.lookup(InputModule.ROLE
                    + "Selector");
            inputModule = (InputModule) selector.select(LM_PREFIX);
            resolver = (SourceResolver) m_manager.lookup(SourceResolver.ROLE);
            lmLocation = (String) inputModule.getAttribute(documentName, null,
                    objectModel);
            if (lmLocation==null)
                throw new SourceException("Could not resolve locationmap location.");
            lmSource = resolver.resolveURI(lmLocation);
        } catch (ServiceException se) {
View Full Code Here


     * Obtain values from the used InputModule.
     */
    private Object[] getValues(String name) {
        Object[] values = null;
        ServiceSelector iputSelector = null;
        InputModule iput = null;
        try {
            if (this.input != null) {
                // input module is thread safe
                // thus we still have a reference to it
                values = input.getAttributeValues(name, this.inputConf, objectModel);
                if (getLogger().isDebugEnabled())
                    getLogger().debug("cached module " + this.input
                                      + " attribute " + name
                                      + " returns " + values);
            } else {
                // input was not thread safe
                // so acquire it again
                iputSelector = (ServiceSelector)this.manager.lookup(INPUT_MODULE_SELECTOR);
                if (this.inputName != null
                    && iputSelector != null
                    && iputSelector.isSelectable(this.inputName)) {

                    iput = (InputModule) iputSelector.select(this.inputName);
                }
                if (iput != null) {
                    values = iput.getAttributeValues(name, this.inputConf, objectModel);
                }
                if (getLogger().isDebugEnabled())
                    getLogger().debug(
                        "fresh module " + iput + " attribute " + name + " returns " + values);
            }
View Full Code Here

    private Object getInputAttribute( String inputModuleName, String attributeName )
        throws  SourceException {
        Object obj;
        ServiceSelector selector = null;
        InputModule inputModule = null;
        try {
            selector = (ServiceSelector) this.manager.lookup( InputModule.ROLE + "Selector" );
            inputModule = (InputModule) selector.select( inputModuleName );
            obj = inputModule.getAttribute( attributeName, null, this.objectModel );

        } catch ( ServiceException e ) {
            throw new SourceException( "Could not find an InputModule of the type " +
                                       inputModuleName , e );
        } catch ( ConfigurationException e ) {
View Full Code Here

    private Object getInputAttribute( String inputModuleName, String attributeName )
        throws SAXException {
        Object obj;
        ServiceSelector selector = null;
        InputModule inputModule = null;
        try {
            selector = (ServiceSelector) this.manager.lookup( InputModule.ROLE + "Selector" );
            inputModule = (InputModule) selector.select( inputModuleName );
            obj = inputModule.getAttribute( attributeName, null, this.objectModel );

        } catch ( ServiceException e ) {
            throw new SAXException( "Could not find an InputModule of the type " +
                                    inputModuleName , e );
        } catch ( ConfigurationException e ) {
View Full Code Here

                // input was not thread safe
                // or
                // another module is configured dynamically
                // so acquire it again
                ComponentSelector iputSelector = null;
                InputModule iput = null;
                try {
                    // obtain input module
                    if (inputName == null) {
                        inputName   = this.defaultInput;
                        inputConfig = this.inputConf;
                    }

                    iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
                    if (this.defaultInput != null
                        && iputSelector != null
                        && iputSelector.hasComponent(inputName)) {
                       
                        iput = (InputModule) iputSelector.select(inputName);
                    }
                    if (iput != null) {
                        value = iput.getAttribute(name, inputConfig, request);
                    }          
                } catch (Exception e) {
                    if (getLogger().isWarnEnabled())
                        getLogger().warn("A problem occurred acquiring a value from '"
                                         + inputName + "' for '"+name+"': " + e.getMessage());
View Full Code Here

                // input was not thread safe
                // or
                // another module is configured dynamically
                // so acquire it again
                ComponentSelector iputSelector = null;
                InputModule iput = null;
                try {
                    // obtain input module
                    if (inputName == null) {
                        inputName   = this.defaultInput;
                        inputConfig = this.inputConf;
                    }

                    iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
                    if (this.defaultInput != null
                        && iputSelector != null
                        && iputSelector.hasComponent(inputName)) {
                       
                        iput = (InputModule) iputSelector.select(inputName);
                    }
                    if (iput != null) {
                        names = iput.getAttributeNames(inputConfig, request);
                    }          
                } catch (Exception e) {
                    if (getLogger().isWarnEnabled())
                        getLogger().warn("A problem occurred acquiring a names from '"
                                         + inputName + "': " + e.getMessage());
View Full Code Here

                // input was not thread safe
                // or
                // another module is configured dynamically
                // so acquire it again
                ComponentSelector iputSelector = null;
                InputModule iput = null;
                try {
                    // obtain input module
                    if (inputName == null) {
                        inputName   = this.defaultInput;
                        inputConfig = this.inputConf;
                    }

                    iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
                    if (this.defaultInput != null
                        && iputSelector != null
                        && iputSelector.hasComponent(inputName)) {
                       
                        iput = (InputModule) iputSelector.select(inputName);
                    }
                    if (iput != null) {
                        values = iput.getAttributeValues(name, inputConfig, request);
                    }          
                } catch (Exception e) {
                    if (getLogger().isWarnEnabled())
                        getLogger().warn("A problem occurred acquiring a value from '"
                                         + inputName + "' for '"+name+"': " + e.getMessage());
View Full Code Here

                // input was not thread safe
                // or
                // another module is configured dynamically
                // so acquire it again
                ComponentSelector iputSelector = null;
                InputModule iput = null;
                try {
                    // obtain input module
                    if (inputName == null) {
                        inputName   = this.defaultInput;
                        inputConfig = this.inputConf;
                    }

                    iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
                    if (this.defaultInput != null
                        && iputSelector != null
                        && iputSelector.hasComponent(inputName)) {
                       
                        iput = (InputModule) iputSelector.select(inputName);
                    }
                    if (iput != null) {
                        values = iput.getAttributeValues(pName, inputConfig, request);
                    }          
                } catch (Exception e) {
                    if (getLogger().isWarnEnabled())
                        getLogger().warn("A problem occurred acquiring a value from '"
                                         + inputName + "' for '"+pName+"': " + e.getMessage());
View Full Code Here

            Object[] values;
            String cname = getOutputName( tableConf, column.columnConf );
           
            // obtain input module and read values
            ComponentSelector inputSelector = null;
            InputModule input = null;
            try {
                inputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
                if (column.mode != null && inputSelector != null && inputSelector.hasComponent(column.mode)){
                    input = (InputModule) inputSelector.select(column.mode);
                }

                if ( column.isSet ){
                    if (getLogger().isDebugEnabled())
                        getLogger().debug( "Trying to set column " + cname +" using getAttributeValues method");
                    values = input.getAttributeValues( cname, column.modeConf, request );
                } else {
                    if (getLogger().isDebugEnabled())
                        getLogger().debug( "Trying to set column " + cname +" using getAttribute method");
                    values = new Object[1];
                    values[0] = input.getAttribute( cname, column.modeConf, request );
                }

                if ( values != null ) {
                    for ( int i = 0; i < values.length; i++ ) {
                        if (getLogger().isDebugEnabled())
View Full Code Here

                // input was not thread safe
                // or
                // another module is configured dynamically
                // so acquire it again
                ComponentSelector iputSelector = null;
                InputModule iput = null;
                try {
                    // obtain input module
                    if (inputName == null) {
                        inputName   = this.defaultInput;
                        inputConfig = this.inputConf;
                    }

                    iputSelector=(ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
                    if (this.defaultInput != null
                        && iputSelector != null
                        && iputSelector.hasComponent(inputName)) {
                       
                        iput = (InputModule) iputSelector.select(inputName);
                    }
                    if (iput != null) {
                        names = iput.getAttributeNames(inputConfig, request);
                    }          
                } catch (Exception e) {
                    if (getLogger().isWarnEnabled())
                        getLogger().warn("A problem occurred acquiring a names from '" + inputName + "': " + e.getMessage());
                } finally {
View Full Code Here

TOP

Related Classes of org.apache.cocoon.components.modules.input.InputModule

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.