if (input.getIdentifier().getStringValue().equalsIgnoreCase(id)){ if(input.isSetLiteralData()){ String datatype = input.getLiteralData().getDataType().getStringValue(); if(datatype.equalsIgnoreCase("string")){ return LiteralStringBinding.class; if(input.isSetComplexData()){ return GenericFileDataWithGTBinding.class;
ComplexDataDescriptionType getNonDefaultFormat(InputDescriptionType inputRefDesc, String dataMimeType, String dataSchema, String dataEncoding) { if (inputRefDesc.getComplexData() == null) { return null; // No complex data within inputs ComplexDataDescriptionType[] formats = inputRefDesc.getComplexData().getSupported().getFormatArray(); for (ComplexDataDescriptionType potentialFormat : formats) { String pFormatSchema = potentialFormat.getSchema();
if(input.isSetLiteralData()){ String datatype = input.getLiteralData().getDataType().getStringValue(); if(datatype.equalsIgnoreCase("string")){ return LiteralStringBinding.class; else if(input.isSetComplexData()){ return GenericFileDataWithGTBinding.class;
NodeList nl = currentDesc.getDomNode().getChildNodes(); String pameterID = null; String suffixString = null; String separatorString = " "; String wpsInputID = currentDesc.getIdentifier().getStringValue(); String wpsOutputID = null; if (currentDesc.isSetComplexData()){ mimeType = currentDesc.getComplexData().getDefault().getFormat().getMimeType(); schema = currentDesc.getComplexData().getDefault().getFormat().getSchema(); if (currentDesc.isSetLiteralData()){ if (currentDesc.getLiteralData().isSetDataType()){ literalDataType = currentDesc.getLiteralData().getDataType().getStringValue(); if (currentDesc.getLiteralData().isSetValuesReference()){ literalDataType = currentDesc.getLiteralData().getDataType().getReference(); if (currentDesc.isSetBoundingBoxData()){ defaultCRS = currentDesc.getBoundingBoxData().toString(); if(currentDesc.getMinOccurs().equals(new BigInteger("0"))){ isOptional = true;
/** * 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); }
/** * @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); }
if (inputDesc.isSetComplexData()) { } else if (inputDesc.isSetLiteralData()) { LiteralDataType data = input.addNewData().addNewLiteralData(); if (value == null) { throw new ExceptionReport("No value provided for literal: " + inputDesc.getIdentifier().getStringValue(), ExceptionReport.MISSING_PARAMETER_VALUE); data.setDataType(dataType); } else if (inputDesc.isSetBoundingBoxData()) { BoundingBoxType data = input.addNewData().addNewBoundingBoxData(); String[] values = value.split(","); + inputDesc.getIdentifier().getStringValue(), ExceptionReport.MISSING_PARAMETER_VALUE);
public static InputDescriptionType findInputByID(String outputID, DataInputs inputs) { for(InputDescriptionType desc : inputs.getInputArray()) { if(desc.getIdentifier().getStringValue().equals(outputID)) { return desc; } } return null; }
/** * Add literal data to the request * @param parameterID the ID of the input paramter according to the describe process * @param value the value. other types than strings have to be converted to string. The datatype is automatically determined and set accordingly to the process description */ public void addLiteralData(String parameterID, String value) { InputDescriptionType inputDesc = this.getParameterDescription(parameterID); if (inputDesc == null) { throw new IllegalArgumentException("inputDescription is null for: " + parameterID); } if (inputDesc.getLiteralData() == null) { throw new IllegalArgumentException("inputDescription is not of type literalData: " + parameterID); } InputType input = execute.getExecute().getDataInputs().addNewInput(); input.addNewIdentifier().setStringValue(parameterID); input.addNewData().addNewLiteralData().setStringValue(value); DomainMetadataType dataType = inputDesc.getLiteralData().getDataType(); if (dataType != null) { input.getData().getLiteralData().setDataType(dataType.getReference()); } }
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); }
if (input.isSetLiteralData()) { String datatype = input.getLiteralData().getDataType().getStringValue(); if (datatype.equalsIgnoreCase("string")) { return LiteralStringBinding.class; if (input.isSetComplexData()) { return GenericFileDataBinding.class;
InputDescriptionType getInputReferenceDescriptionType(String inputId) { for (InputDescriptionType tempDesc : this.processDesc.getDataInputs().getInputArray()) { if (inputId.equals(tempDesc.getIdentifier().getStringValue())) { return tempDesc; } } return null; }
InputDescriptionType[] inputs = processDescription.getDataInputs().getInputArray(); for(InputDescriptionType input : inputs){ if(input.getIdentifier().getStringValue().equals(id)){ if(input.isSetLiteralData()){ String datatype = input.getLiteralData().getDataType().getStringValue(); if(datatype.contains("tring")){ return LiteralStringBinding.class; if(input.isSetComplexData()){ String mimeType = input.getComplexData().getDefault().getFormat().getMimeType(); if(mimeType.contains("xml") || (mimeType.contains("XML"))){ return GTVectorDataBinding.class;
throw new IllegalArgumentException("inputDesription is null for: " + parameterID); if (inputDesc.getComplexData() == null) { throw new IllegalArgumentException("inputDescription is not of type ComplexData: " + parameterID); inputDesc.getIdentifier().getStringValue());
if(inputID.equals(tempDesc.getIdentifier().getStringValue())) { inputDesc = tempDesc; break; DomainMetadataType dataType = inputDesc.getLiteralData().getDataType(); xmlDataType = dataType != null ? dataType.getReference() : null; if(inputDesc.getLiteralData().isSetAllowedValues()){ if((!inputDesc.getLiteralData().isSetAnyValue())){ ValueType[] allowedValues = inputDesc.getLiteralData().getAllowedValues().getValueArray(); boolean foundAllowedValue = false; for(ValueType allowedValue : allowedValues){ if(parameterObj instanceof LiteralIntBinding || parameterObj instanceof LiteralDoubleBinding || parameterObj instanceof LiteralShortBinding || parameterObj instanceof LiteralFloatBinding || parameterObj instanceof LiteralLongBinding || parameterObj instanceof LiteralByteBinding){ allowedRanges = inputDesc.getLiteralData().getAllowedValues().getRangeArray(); for(RangeType allowedRange : allowedRanges){ foundAllowedValue = checkRange(parameterObj, allowedRange);
protected ComplexDataDescriptionType findComplexDataDescriptionType(InputDescriptionType inputReferenceDesc, String dataMimeType, String dataSchema, String dataEncoding, String potentialFormatSchema, String potentialFormatEncoding) { ComplexDataDescriptionType result = null; boolean canUseDefault = false; String defaultMimeType = inputReferenceDesc.getComplexData().getDefault().getFormat().getMimeType(); ComplexDataDescriptionType potentialFormat = inputReferenceDesc.getComplexData().getDefault().getFormat(); if(dataSchema != null && dataEncoding == null){ if(dataSchema.equalsIgnoreCase(potentialFormatSchema)){
/** * * @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; }
"inputDescription is null for: " + parameterID); if (inputDesc.getComplexData() == null) { throw new IllegalArgumentException( "inputDescription is not of type ComplexData: " .addNewInput(); input.addNewIdentifier().setStringValue( inputDesc.getIdentifier().getStringValue());
if (inputDesc.getIdentifier().getStringValue().equals( input.getIdentifier().getStringValue())) { identifierMatched = true; && input.getData().getLiteralData() != null) { if (inputDesc.getLiteralData() == null) { throw new ExceptionReport( "Inputtype LiteralData is not supported", if (inputDesc.getLiteralData() != null) if (inputDesc.getLiteralData().getDataType() != null) if (inputDesc.getLiteralData() .getDataType().getReference() != null) if (!input