Package com.xmlcalabash.model

Examples of com.xmlcalabash.model.RuntimeValue


            }


            DeclareStep pipeline = xpipeline.getDeclareStep();
            for (String fieldName : nameValuePairs.keySet()) {
                RuntimeValue value = new RuntimeValue(nameValuePairs.get(fieldName));

                if (fieldName.startsWith("-p")) {
                    fieldName = fieldName.substring(2);

                    String port= null;
                    Matcher matcher = portRE.matcher(fieldName);
                    if (matcher.matches()) {
                        port = matcher.group(1);
                        fieldName = matcher.group(2);
                    }

                    if (port == null) {
                        // Figure out the default parameter port
                        for (String iport : xpipeline.getInputs()) {
                            com.xmlcalabash.model.Input input = pipeline.getInput(iport);
                            if (input.getParameterInput() && input.getPrimary()) {
                                port = iport;
                            }
                        }
                    }

                    if (port == null) {
                        throw new XProcException("No primary parameter input port.");
                    }

                    logger.debug("Parameter " + fieldName + "=" + value.getString() + " for " + id);

                    QName qname = qnameFromForm(fieldName, nsBindings);
                    xpipeline.setParameter(port, qname, value);
                    pipeconfig.setParameter(qname, value.getString());
                    message += "Parameter " + qname.getClarkName() + "=" + value.getString() + "\n";
                } else {
                    logger.debug("Option " + fieldName + "=" + value.getString() + " for " + id);

                    QName qname = qnameFromForm(fieldName, nsBindings);
                    xpipeline.passOption(qname, value);
                    pipeconfig.setGVOption(qname);
                    message += "Option " + qname.getClarkName() + "=" + value.getString() + "\n";
                }
            }

            return okResponse(message, variant.getMediaType(), Status.SUCCESS_OK);
        } catch (XProcException e) {
View Full Code Here


            }
        }

        if (parameters != null) {
            for (QName name : parameters.keySet()) {
                xpipeline.setParameter(name, new RuntimeValue(parameters.get(name)));
            }
        }

        if (options != null) {
            for (QName name : options.keySet()) {

                // HACK HACK HACK!
                RuntimeValue v;
                if (_path.equals(name)) {
                    v = new RuntimeValue("file:///home/www/tests.xproc.org/tests/required/" + options.get(name));
                } else {
                    v = new RuntimeValue(options.get(name));
                }

                xpipeline.passOption(name, v);
            }
        }
View Full Code Here

TOP

Related Classes of com.xmlcalabash.model.RuntimeValue

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.