if (ppio == null) {
throw new WPSException("Unable to encode output: " + p.key);
}
ppios.put(p.key, ppio);
DocumentOutputDefinitionType output = f.createDocumentOutputDefinitionType();
outputs.getOutput().add(output);
output.setIdentifier(Ows11Util.code(p.key));
if (ppio instanceof ComplexPPIO) {
output.setMimeType(((ComplexPPIO) ppio).getMimeType());
if (ppio instanceof BinaryPPIO) {
output.setEncoding("base64");
} else if (ppio instanceof XMLPPIO) {
output.setEncoding("utf-8");
}
}
// TODO: better encoding handling + schema
}
// process outputs
ProcessOutputsType1 processOutputs = f.createProcessOutputsType1();
response.setProcessOutputs(processOutputs);
for (String key : outputMap.keySet()) {
OutputDataType output = f.createOutputDataType();
output.setIdentifier(Ows11Util.code(key));
output.setTitle(Ows11Util
.languageString(pf.getResultInfo(processName, null).get(key).description));
processOutputs.getOutput().add(output);
final Object o = outputMap.get(key).object;
ProcessParameterIO ppio = ppios.get(key);
if (ppio instanceof ReferencePPIO) {
// encode as a reference
OutputReferenceType ref = f.createOutputReferenceType();
output.setReference(ref);
ref.setMimeType(outputMap.get(key).definition.getMimeType());
ref.setHref(((ReferencePPIO) ppio).encode(o).toString());
} else {
// encode as data
DataType data = f.createDataType();
output.setData(data);
try {
if (ppio instanceof LiteralPPIO) {
LiteralDataType literal = f.createLiteralDataType();
data.setLiteralData(literal);