Package org.apache.avalon.framework.parameters

Examples of org.apache.avalon.framework.parameters.Parameters


        // Prepare data needed by the action
        Map            objectModel    = env.getObjectModel();
        Redirector     redirector     = PipelinesNode.getRedirector(env);
        SourceResolver resolver       = getSourceResolver(objectModel);
        String         resolvedSource = source.resolve(context, objectModel);
        Parameters     resolvedParams = VariableResolver.buildParameters(this.parameters, context, objectModel);

        Map actionResult;

        // If action is ThreadSafe, avoid select() and try/catch block (faster !)
        if (this.threadSafeAction != null) {
View Full Code Here


                label = (String)stack.pop();
            }

        } else if (name.equals(CINCLUDE_CONFIGURATION_ELEMENT) == true
                 && this.state == STATE_INCLUDE) {
            this.configurationParameters = new Parameters();
            // 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

        return (result!=null? new ScriptableMap(result) : null);
    }

    public static Parameters jsobjectToParameters(Scriptable jsobject)
    {
        Parameters params = new Parameters();
        Object[] ids = jsobject.getIds();
        for (int i = 0; i < ids.length; i++) {
            String key = ScriptRuntime.toString(ids[i]);
            Object value = jsobject.get(key, jsobject);
            if (value == Undefined.instance) {
                value = null;
            } else {
                value = ScriptRuntime.toString(value);
            }
            params.setParameter(key, (String) value);
        }
        return params;
    }
View Full Code Here

     
        // Perform any common invoke functionality
        super.invoke(env, context);

        Map objectModel = env.getObjectModel();
        Parameters resolvedParams = VariableResolver.buildParameters(
            this.parameters, context, objectModel
        );

        Map result = null;
View Full Code Here

     * Abstract out the Logicsheet creation.  Handles both Named and regular logicsheets.
     */
    private Logicsheet createLogicsheet(Configuration configuration, boolean named)
            throws Exception
    {
        Parameters params = Parameters.fromConfiguration(configuration);

        Logicsheet logicsheet;
        if (named) {
            String location = params.getParameter("href", null);
            String uri = params.getParameter("uri", null);
            String prefix = params.getParameter("prefix", null);

            NamedLogicsheet namedLogicsheet =
                new NamedLogicsheet(location, manager, resolver);
            namedLogicsheet.enableLogging(getLogger());
            namedLogicsheet.setURI(uri);
            namedLogicsheet.setPrefix(prefix);
            logicsheet = namedLogicsheet;
        } else {
            String location = params.getParameter("core-logicsheet", null);
            logicsheet = new Logicsheet(location, manager, resolver);
            logicsheet.enableLogging(getLogger());
        }

        String logicsheetName = logicsheet.getSystemId();
View Full Code Here

            String actionName = actionNames[i];
            String source = sources[i].resolve(context, objectModel);
            if (actionName == null || actionName.equals(cocoonAction)) {

                Parameters actionParams = VariableResolver.buildParameters(parameters[i], context, objectModel);
                if (actionParams == Parameters.EMPTY_PARAMETERS) {
                    actionParams = params;
                } else {
                    actionParams.merge(params);
                }

                // If action is ThreadSafe, avoid select() and try/catch block (faster !)
                if ((action = this.threadSafeActions[i]) != null) {
View Full Code Here

        URIParameterizer parameterizer = null;
        Map map = null;
        try {
            parameterizer = (URIParameterizer) manager.lookup(URIParameterizer.ROLE);

            Parameters parameters = new Parameters();
            parameters.setParameter(
                URI_PARAMETER_DOCTYPE,
                "cocoon://uri-parameter/"
                    + envelope.getPublication().getId()
                    + "/"
                    + URI_PARAMETER_DOCTYPE);
View Full Code Here

            throws ConfigurationException, ParameterException {
        if (component instanceof Configurable) {
            ((Configurable) component).configure(configuration);
        }
        if (component instanceof Parameterizable) {
            Parameters parameters = Parameters.fromConfiguration(configuration);
            ((Parameterizable) component).parameterize(parameters);
        }
    }
View Full Code Here

        Publication publication = PublicationHelper.getPublication();

        TaskManager manager = new TaskManager(publication.getDirectory().getCanonicalPath());
        AntTask task = (AntTask) manager.getTask(TaskManager.ANT_TASK);

        Parameters parameters = getTaskParameters();
        parameters.setParameter(Task.PARAMETER_PUBLICATION_ID, publication.getId());
        parameters.setParameter(Task.PARAMETER_CONTEXT_PREFIX, "/lenya");
        parameters.setParameter(Task.PARAMETER_SERVLET_CONTEXT,
            publication.getServletContext().getCanonicalPath());
        parameters.setParameter(AntTask.TARGET, getTarget());
        task.parameterize(parameters);

        final GregorianCalendar beforeExecution = new GregorianCalendar();

        task.execute(publication.getServletContext().getCanonicalPath());
View Full Code Here

     * Returns the task parameters.
     * You don't need to specify the publication-id.
     * @return The task parameters.
     */
    protected Parameters getTaskParameters() {
        return new Parameters();
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.framework.parameters.Parameters

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.