public static InputDescriptionType findInputByID(String outputID, DataInputs inputs) { for(InputDescriptionType desc : inputs.getInputArray()) { if(desc.getIdentifier().getStringValue().equals(outputID)) { return desc; } } return null; }
InputDescriptionType getInputReferenceDescriptionType(String inputId) { for (InputDescriptionType tempDesc : this.processDesc.getDataInputs().getInputArray()) { if (inputId.equals(tempDesc.getIdentifier().getStringValue())) { return tempDesc; } } return null; }
/** * * @param id * @return the specified parameterdescription. if not available it returns null. */ private InputDescriptionType getParameterDescription(String id) { InputDescriptionType[] inputDescs = processDesc.getDataInputs().getInputArray(); for (InputDescriptionType inputDesc : inputDescs) { if(inputDesc.getIdentifier().getStringValue().equals(id)) { return inputDesc; } } return null; }
if (input.getIdentifier().getStringValue().equalsIgnoreCase(id)){
InputDescriptionType[] inputs = processDescription.getDataInputs().getInputArray(); for(InputDescriptionType input : inputs){ if(input.getIdentifier().getStringValue().equals(id)){ if(input.isSetLiteralData()){ String datatype = input.getLiteralData().getDataType().getStringValue();
inputDesc.getIdentifier().getStringValue());
/** * @param pInput * @param pProcessDescription * @param pExecuteDocument * @param pInputParameter * @return * @throws ExceptionReport */ private IData createDeserializedLiteralData(ProcessDescriptionType pProcessDescription, ExecuteDocument pExecuteDocument, InputType pInputParameter, Map<String, List<String>> pSerializedInputData) throws ExceptionReport { String inputId = pInputParameter.getIdentifier().getStringValue(); String xmlDataType = pInputParameter.getData().getLiteralData().getDataType(); if (xmlDataType == null) { InputDescriptionType inputDescription = null; for (InputDescriptionType tempInputDescription : pProcessDescription.getDataInputs().getInputArray()) { if (inputId.equals(tempInputDescription.getIdentifier().getStringValue())) { inputDescription = tempInputDescription; break; } } xmlDataType = inputDescription.getLiteralData().getDataType().getReference(); } String data = pSerializedInputData.get(inputId).get(0); return BasicXMLTypeFactory.getBasicJavaObject(xmlDataType, data); }
/** * add an input element. sets the data in the xml request * * @param parameterID the ID of the input (see process description) * @param value the actual value as String (for xml data xml for binary data is should be base64 encoded data) * @param schema schema if applicable otherwise null * @param encoding encoding if not the default encoding (for default encoding set it to null) (i.e. binary data, use base64) * @param mimeType mimetype of the data, has to be set * @throws WPSClientException */ public void addComplexData(String parameterID, String value, String schema, String encoding, String mimeType) throws WPSClientException { InputDescriptionType inputDesc = getParameterDescription(parameterID); if (inputDesc == null) { throw new IllegalArgumentException("inputDesription is null for: " + parameterID); } if (inputDesc.getComplexData() == null) { throw new IllegalArgumentException("inputDescription is not of type ComplexData: " + parameterID); } InputType input = execute.getExecute().getDataInputs().addNewInput(); input.addNewIdentifier().setStringValue(inputDesc.getIdentifier().getStringValue()); ComplexDataType data = input.addNewData().addNewComplexData(); setComplexData(data, value, schema, mimeType, encoding); }
public String getDefaultMimeType(String paramID){ String mimeType = null; // check inputs for a match for (InputDescriptionType currentInput : processDescription.getDataInputs().getInputArray()){ if (currentInput.getIdentifier().getStringValue().equalsIgnoreCase(paramID)){ mimeType = currentInput.getComplexData().getDefault().getFormat().getMimeType(); } } for (OutputDescriptionType currentOutput : processDescription.getProcessOutputs().getOutputArray()){ if (currentOutput.getIdentifier().getStringValue().equalsIgnoreCase(paramID)){ mimeType = currentOutput.getComplexOutput().getDefault().getFormat().getMimeType(); } } return mimeType; }
/** * @param pInput * @param pProcessDescription * @param pExecuteDocument * @param pInputParameter * @return * @throws ExceptionReport */ private String createSerializedLiteralData(WebProcessingServiceInput pInput, ProcessDescriptionType pProcessDescription, ExecuteDocument pExecuteDocument, InputType pInputParameter) throws ExceptionReport { String inputId = pInputParameter.getIdentifier().getStringValue(); String xmlDataType = pInputParameter.getData().getLiteralData().getDataType(); if (xmlDataType == null) { InputDescriptionType inputDescription = null; for (InputDescriptionType tempInputDescription : pProcessDescription.getDataInputs().getInputArray()) { if (inputId.equals(tempInputDescription.getIdentifier().getStringValue())) { inputDescription = tempInputDescription; break; } } xmlDataType = inputDescription.getLiteralData().getDataType().getReference(); } IData data = pInput.getInputData().get(inputId).get(0); return BasicXMLTypeFactory.getStringRepresentation(xmlDataType, data); }
.addNewInput(); input.addNewIdentifier().setStringValue( inputDesc.getIdentifier().getStringValue());
if (value == null) { throw new ExceptionReport("No value provided for literal: " + inputDesc.getIdentifier().getStringValue(), ExceptionReport.MISSING_PARAMETER_VALUE); + inputDesc.getIdentifier().getStringValue(), ExceptionReport.MISSING_PARAMETER_VALUE);
if(inputID.equals(tempDesc.getIdentifier().getStringValue())) { inputDesc = tempDesc; break;
for (InputDescriptionType tempInputDescription : pProcessDescription.getDataInputs().getInputArray()) if (inputId.equals(tempInputDescription.getIdentifier().getStringValue()))
String suffixString = null; String separatorString = " "; String wpsInputID = currentDesc.getIdentifier().getStringValue(); String wpsOutputID = null;
for (InputDescriptionType tempInputDescription : pProcessDescription.getDataInputs().getInputArray()) if (inputId.equals(tempInputDescription.getIdentifier().getStringValue()))
if(inputID.equals(tempDesc.getIdentifier().getStringValue())) { inputPD = tempDesc; break; throw new ExceptionReport("Possibly multiple or none matching generators found for the input data with id = \"" + inputPD.getIdentifier().getStringValue() + "\". Is the MimeType (\"" + referenceData.getMimeType() + "\") correctly set?", ExceptionReport.INVALID_PARAMETER_VALUE);
if (inputDesc.getIdentifier().getStringValue().equals( input.getIdentifier().getStringValue())) { identifierMatched = true;