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() );
}
//TODO: encoding + schema
}
//process outputs
ProcessOutputsType1 processOutputs = f.createProcessOutputsType1();
response.setProcessOutputs( processOutputs );
for ( String key : result.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 = result.get( key );
ProcessParameterIO ppio = ppios.get( key );
if ( ppio instanceof ReferencePPIO ) {
//encode as a reference
OutputReferenceType ref = f.createOutputReferenceType();
output.setReference( ref );
//TODO: mime type
ref.setHref( ((ReferencePPIO) ppio).encode(o).toString() );
}
else {
//encode as data
DataType data = f.createDataType();
output.setData( data );
if ( ppio instanceof LiteralPPIO ) {
LiteralDataType literal = f.createLiteralDataType();
data.setLiteralData( literal );