String datatype = input.getLiteralData().getDataType().getStringValue(); if(datatype.equalsIgnoreCase("string")){ return LiteralStringBinding.class;
private void addDoubleValue(DataInputs inputs, String name, String description, boolean bOptional){ int iMinOccurs = 1; if (bOptional){ iMinOccurs = 0; } InputDescriptionType input = inputs.addNewInput(); input.addNewAbstract().setStringValue(description); input.addNewTitle().setStringValue(description); input.addNewIdentifier().setStringValue(name); LiteralInputType literal = input.addNewLiteralData(); DomainMetadataType dataType = literal.addNewDataType(); dataType.setReference("xs:double"); literal.setDataType(dataType); input.setMinOccurs(BigInteger.valueOf(iMinOccurs)); input.setMaxOccurs(BigInteger.valueOf(1)); literal.setDefaultValue("0"); }
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);
if (currentDesc.getLiteralData().isSetDataType()){ literalDataType = currentDesc.getLiteralData().getDataType().getStringValue(); if (currentDesc.getLiteralData().isSetValuesReference()){ literalDataType = currentDesc.getLiteralData().getDataType().getReference();
AdditionalInfoNumericalValue ai = (AdditionalInfoNumericalValue) param.getParameterAdditionalInfo(); LiteralInputType literal = input.addNewLiteralData(); DomainMetadataType dataType = literal.addNewDataType(); dataType.setReference("xs:double"); literal.setDataType(dataType); input.setMinOccurs(BigInteger.valueOf(1)); input.setMaxOccurs(BigInteger.valueOf(1)); RangeType range = literal.addNewAllowedValues().addNewRange(); range.addNewMaximumValue().setStringValue("" + Double.POSITIVE_INFINITY); range.addNewMinimumValue().setStringValue("" + Double.NEGATIVE_INFINITY); literal.setDefaultValue(Double.toString(ai.getDefaultValue())); input.setMinOccurs(BigInteger.valueOf(1)); input.setMaxOccurs(BigInteger.valueOf(1)); literal.addNewAnyValue(); DomainMetadataType dataType = literal.addNewDataType(); dataType.setReference("xs:string"); literal.setDataType(dataType); input.setMinOccurs(BigInteger.valueOf(1)); input.setMaxOccurs(BigInteger.valueOf(1)); AllowedValues allowedValues = literal.addNewAllowedValues(); for (int i = 0; i < values.length; i++) { allowedValues.addNewValue().setStringValue(values[i]); DomainMetadataType dataType = literal.addNewDataType(); dataType.setReference("xs:string"); input.setMinOccurs(BigInteger.valueOf(1));
String datatype = input.getLiteralData().getDataType().getStringValue(); if (datatype.equalsIgnoreCase("string")) { return LiteralStringBinding.class;
String datatype = input.getLiteralData().getDataType().getStringValue(); if(datatype.equalsIgnoreCase("string")){ return LiteralStringBinding.class;
if(input.getIdentifier().getStringValue().equals(id)){ if(input.isSetLiteralData()){ String datatype = input.getLiteralData().getDataType().getStringValue(); if(datatype.contains("tring")){ return LiteralStringBinding.class;
/** * @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); }
/** * @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); }
/** * 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()); } }
if (inputDesc.getLiteralData().getDataType() != null) if (inputDesc.getLiteralData() .getDataType().getReference() != null) .getData() .getLiteralData() .getDataType() .equals( inputDesc