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();
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)){
String mimeType = input.getComplexData().getDefault().getFormat().getMimeType(); if(mimeType.contains("xml") || (mimeType.contains("XML"))){ return GTVectorDataBinding.class;
throw new IllegalArgumentException("inputDescription is null for: " + parameterID); if (inputDesc.getComplexData() == null) { throw new IllegalArgumentException("inputDescription is not of type ComplexData: " + parameterID);
throw new IllegalArgumentException("inputDesription is null for: " + parameterID); if (inputDesc.getComplexData() == null) { throw new IllegalArgumentException("inputDescription is not of type ComplexData: " + parameterID);
/** * 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; }
"inputDescription is null for: " + parameterID); if (inputDesc.getComplexData() == null) { throw new IllegalArgumentException( "inputDescription is not of type ComplexData: "
formatSchema = inputReferenceDesc.getComplexData().getDefault().getFormat().getSchema(); dataMimeType = inputReferenceDesc.getComplexData().getDefault().getFormat().getMimeType(); formatEncoding = inputReferenceDesc.getComplexData().getDefault().getFormat().getEncoding(); }else{ String defaultEncoding = inputReferenceDesc.getComplexData().getDefault().getFormat().getEncoding(); ComplexDataDescriptionType encodingFormat = null; String foundEncoding = null; if(defaultEncoding.equalsIgnoreCase(data.getEncoding())){ foundEncoding = inputReferenceDesc.getComplexData().getDefault().getFormat().getEncoding(); encodingFormat = inputReferenceDesc.getComplexData().getDefault().getFormat(); foundCount++; }else{ ComplexDataDescriptionType[] formats = inputReferenceDesc.getComplexData().getSupported().getFormatArray(); for(ComplexDataDescriptionType tempFormat : formats){ if(tempFormat.getEncoding().equalsIgnoreCase(data.getEncoding())){ String defaultSchema = inputReferenceDesc.getComplexData().getDefault().getFormat().getSchema(); int found = 0; String foundSchema = null; foundSchema = inputReferenceDesc.getComplexData().getDefault().getFormat().getSchema(); schemaFormat = inputReferenceDesc.getComplexData().getDefault().getFormat(); found++; }else{ ComplexDataDescriptionType[] formats = inputReferenceDesc.getComplexData().getSupported().getFormatArray(); for(ComplexDataDescriptionType tempFormat : formats){ String defaultEncoding = inputReferenceDesc.getComplexData().getDefault().getFormat().getEncoding();
throw new IllegalArgumentException("inputDescription is null for: " + parameterID); if (inputDesc.getComplexData() == null) { throw new IllegalArgumentException("inputDescription is not of type complexData: " + parameterID);
schema = inputDescription.getComplexData().getDefault().getFormat().getSchema(); mimeType = inputDescription.getComplexData().getDefault().getFormat().getMimeType(); encoding = inputDescription.getComplexData().getDefault().getFormat().getEncoding();
String defaultMimeType = inputPD.getComplexData().getDefault().getFormat().getMimeType(); ComplexDataDescriptionType potentialFormat = inputPD.getComplexData().getDefault().getFormat(); if(referenceData.getSchema() != null && referenceData.getEncoding() == null){ if(referenceData.getSchema().equalsIgnoreCase(potentialFormat.getSchema())){ ComplexDataDescriptionType[] formats = inputPD.getComplexData().getSupported().getFormatArray(); for(ComplexDataDescriptionType potentialFormat : formats){ if(potentialFormat.getMimeType().equalsIgnoreCase(mimeType)){ String defaultMimeType = inputPD.getComplexData().getDefault().getFormat().getMimeType(); ComplexDataDescriptionType potentialFormat = inputPD.getComplexData().getDefault().getFormat(); if(referenceData.getSchema() != null && referenceData.getEncoding() == null){ if(referenceData.getSchema().equalsIgnoreCase(potentialFormat.getSchema())){ ComplexDataDescriptionType[] formats = inputPD.getComplexData().getSupported().getFormatArray(); for(ComplexDataDescriptionType potentialFormat : formats){ if(!StringUtils.isBlank(potentialFormat.getMimeType()) && potentialFormat.getMimeType().equalsIgnoreCase(mimeType)){ schema = inputPD.getComplexData().getDefault().getFormat().getSchema(); mimeType = inputPD.getComplexData().getDefault().getFormat().getMimeType(); encoding = inputPD.getComplexData().getDefault().getFormat().getEncoding(); String defaultEncoding = inputPD.getComplexData().getDefault().getFormat().getEncoding(); int found = 0; String foundEncoding = null; if(defaultEncoding.equalsIgnoreCase(referenceData.getEncoding())){ foundEncoding = inputPD.getComplexData().getDefault().getFormat().getEncoding();
mimeType = currentDesc.getComplexData().getDefault().getFormat().getMimeType(); schema = currentDesc.getComplexData().getDefault().getFormat().getSchema();