protected void patchEnvironment(Environment env) { if (atomic) { //nop; } else { // See if there's exactly one "ordinary" input int count = 0; Input defin = null; boolean foundPrimary = false; for (Input input : inputs) { if (!input.getPort().startsWith("|") && !input.getParameterInput()) { count++; foundPrimary |= input.getPrimary(); if (!input.getPrimary() && input.getPrimarySet()) { // nop; if the port is explicitly marked primary=false, it can't count } else { if (defin == null || input.getPrimary()) { defin = input; } } } } if (count == 1 || foundPrimary) { env.setDefaultReadablePort(defin); } } }
protected void patchEnvironment(Environment env) { // See if there's exactly one "ordinary" input int count = 0; Input defin = null; boolean foundPrimary = false; for (Input input : inputs) { if (!input.getPort().startsWith("|") && !input.getParameterInput()) { count++; foundPrimary |= input.getPrimary(); if (defin == null || input.getPrimary()) { defin = input; } } } if (count == 1 || foundPrimary) { env.setDefaultReadablePort(defin); } } }
protected void patchEnvironment(Environment env) { // See if there's exactly one "ordinary" input int count = 0; Input defin = null; boolean foundPrimary = false; for (Input input : inputs) { if (!input.getPort().startsWith("|") && !input.getParameterInput()) { count++; foundPrimary |= input.getPrimary(); if (defin == null || input.getPrimary()) { defin = input; } } } if (count == 1 || foundPrimary) { env.setDefaultReadablePort(defin); } } }
protected void patchEnvironment(Environment env) { if (atomic) { //nop; } else { // See if there's exactly one "ordinary" input int count = 0; Input defin = null; boolean foundPrimary = false; for (Input input : inputs) { if (!input.getPort().startsWith("|") && !input.getParameterInput()) { count++; foundPrimary |= input.getPrimary(); if (!input.getPrimary() && input.getPrimarySet()) { // nop; if the port is explicitly marked primary=false, it can't count } else { if (defin == null || input.getPrimary()) { defin = input; } } } } if (count == 1 || foundPrimary) { env.setDefaultReadablePort(defin); } } }
public PipelineConfiguration(XProcRuntime runtime, XPipeline xpipeline, Calendar expires) { this.runtime = runtime; this.pipeline = xpipeline; this.expires = expires; DeclareStep pipeline = xpipeline.getDeclareStep(); // Figure out the default input port for (String port : xpipeline.getInputs()) { inputPorts.add(port); com.xmlcalabash.model.Input input = pipeline.getInput(port); if (!input.getParameterInput() && input.getPrimary()) { definput = port; } } // Figure out the default output port for (String port : xpipeline.getOutputs()) { outputPorts.add(port); com.xmlcalabash.model.Output output = pipeline.getOutput(port); if (output.getPrimary()) { defoutput = port; } } }
private void checkPrimaryInput(boolean checkParameterInput) { int count = 0; int pcount = 0; Port defPrimary = null; Port primary = null; for (Input input : inputs()) { if (!input.getPort().startsWith("|")) { count++; if (input.getParameterInput() == checkParameterInput) { if (input.getPrimary()) { pcount++; if (primary == null) { primary = input; } } if (defPrimary == null && !input.getPrimarySet()) { defPrimary = input; } } } } if (pcount > 1) { throw XProcException.staticError(30); } if (count == 1 && primary == null && defPrimary != null) { if (defPrimary.getPrimary() || !defPrimary.getPrimarySet()) { defPrimary.setPrimary(true); } } }
public PipelineConfiguration(XProcRuntime runtime, XPipeline xpipeline, Calendar expires) { this.runtime = runtime; this.pipeline = xpipeline; this.expires = expires; DeclareStep pipeline = xpipeline.getDeclareStep(); // Figure out the default input port for (String port : xpipeline.getInputs()) { inputPorts.add(port); com.xmlcalabash.model.Input input = pipeline.getInput(port); if (!input.getParameterInput() && input.getPrimary()) { definput = port; } } // Figure out the default output port for (String port : xpipeline.getOutputs()) { outputPorts.add(port); com.xmlcalabash.model.Output output = pipeline.getOutput(port); if (output.getPrimary()) { defoutput = port; } } }
private void checkPrimaryInput(boolean checkParameterInput) { int count = 0; int pcount = 0; Port defPrimary = null; Port primary = null; for (Input input : inputs()) { if (!input.getPort().startsWith("|")) { count++; if (input.getParameterInput() == checkParameterInput) { if (input.getPrimary()) { pcount++; if (primary == null) { primary = input; } } if (defPrimary == null && !input.getPrimarySet()) { defPrimary = input; } } } } if (pcount > 1) { throw XProcException.staticError(30); } if (count == 1 && primary == null && defPrimary != null) { if (defPrimary.getPrimary() || !defPrimary.getPrimarySet()) { defPrimary.setPrimary(true); } } }
for (String iport : xpipeline.getInputs()) { com.xmlcalabash.model.Input input = pipeline.getInput(iport); if (input.getParameterInput() && input.getPrimary()) { port = iport;
public void setParameter(QName name, RuntimeValue value) { Set<String> ports = getParameterPorts(); int pportCount = 0; String pport = null; String ppport = null; for (String port : ports) { pport = port; pportCount++; Input pin = getStep().getInput(port); if (pin.getPrimary()) { ppport = port; } } if (pportCount == 0) { throw new XProcException(step.getNode(), "Attempt to set parameter but there's no parameter port."); } if (ppport != null) { pport = ppport; } else { if (pportCount > 1) { throw new XProcException(step.getNode(), "Attempt to set parameter w/o specifying a port (and there's more than one)"); } } setParameter(pport, name, value); }
public void setParameter(QName name, RuntimeValue value) { Set<String> ports = getParameterPorts(); int pportCount = 0; String pport = null; String ppport = null; for (String port : ports) { pport = port; pportCount++; Input pin = getStep().getInput(port); if (pin.getPrimary()) { ppport = port; } } if (pportCount == 0) { throw new XProcException(step.getNode(), "Attempt to set parameter but there's no parameter port."); } if (ppport != null) { pport = ppport; } else { if (pportCount > 1) { throw new XProcException(step.getNode(), "Attempt to set parameter w/o specifying a port (and there's more than one)"); } } setParameter(pport, name, value); }
@Override protected void augmentIO() { // Assume that everything will be OK when we validate... if (subpipeline.size() > 0) { Step step = subpipeline.get(0); for (Input input : step.inputs()) { Input cinput = new Input(runtime, step.getNode()); cinput.setPort(input.getPort()); cinput.setPrimary(input.getPrimary()); cinput.setSequence(input.getSequence()); addInput(cinput); } for (Output output : step.outputs()) { Output coutput = new Output(runtime, step.getNode()); coutput.setPort(output.getPort()); coutput.setPrimary(output.getPrimary()); coutput.setSequence(output.getSequence()); addOutput(coutput); } } super.augmentIO(); }
output.setPort(input.getPort() + "|"); output.setSequence(true); // the other half will check output.setPrimary(input.getPrimary()); addOutput(output);
output.setPort(input.getPort() + "|"); output.setSequence(true); // the other half will check output.setPrimary(input.getPrimary()); addOutput(output);
@Override protected void augmentIO() { // Assume that everything will be OK when we validate... if (subpipeline.size() > 0) { Step step = subpipeline.get(0); for (Input input : step.inputs()) { Input cinput = new Input(runtime, step.getNode()); cinput.setPort(input.getPort()); cinput.setPrimary(input.getPrimary()); cinput.setSequence(input.getSequence()); addInput(cinput); } for (Output output : step.outputs()) { Output coutput = new Output(runtime, step.getNode()); coutput.setPort(output.getPort()); coutput.setPrimary(output.getPrimary()); coutput.setSequence(output.getSequence()); addOutput(coutput); } } super.augmentIO(); }
builder.withPort(XProcPortInfo.newInputPort( input.getPort(), input.getSequence(), input.getPrimary())); } else { builder.withPort(XProcPortInfo.newParameterPort( input.getPort(), input.getPrimary()));
if (!input.getPort().startsWith("|") && input.getPrimary()) { if (input.getParameterInput()) { if (seenPrimaryParam) {
if (!input.getPort().startsWith("|") && input.getPrimary()) { if (input.getParameterInput()) { if (seenPrimaryParam) {
protected void augmentIO() { if (getInput("#xpath-context") == null) { Input isource = new Input(runtime, node); isource.setPort("#xpath-context"); addInput(isource); } // Assume that everything will be OK when we validate... if (subpipeline.size() > 0) { Step step = subpipeline.get(0); for (Input input : step.inputs()) { Input cinput = new Input(runtime, step.getNode()); cinput.setPort(input.getPort()); cinput.setPrimary(input.getPrimary()); cinput.setSequence(input.getSequence()); addInput(cinput); } for (Output output : step.outputs()) { Output coutput = new Output(runtime, step.getNode()); coutput.setPort(output.getPort()); coutput.setPrimary(output.getPrimary()); coutput.setSequence(output.getSequence()); addOutput(coutput); } } super.augmentIO(); }
protected void augmentIO() { if (getInput("#xpath-context") == null) { Input isource = new Input(runtime, node); isource.setPort("#xpath-context"); addInput(isource); } // Assume that everything will be OK when we validate... if (subpipeline.size() > 0) { Step step = subpipeline.get(0); for (Input input : step.inputs()) { Input cinput = new Input(runtime, step.getNode()); cinput.setPort(input.getPort()); cinput.setPrimary(input.getPrimary()); cinput.setSequence(input.getSequence()); addInput(cinput); } for (Output output : step.outputs()) { Output coutput = new Output(runtime, step.getNode()); coutput.setPort(output.getPort()); coutput.setPrimary(output.getPrimary()); coutput.setSequence(output.getSequence()); addOutput(coutput); } } super.augmentIO(); }