processOutputs( outputs, pf, name );
}
void dataInputs( DataInputsType inputs, ProcessFactory pf, Name name) {
for(Parameter<?> p : pf.getParameterInfo(name).values()) {
InputDescriptionType input = wpsf.createInputDescriptionType();
inputs.getInput().add( input );
input.setIdentifier( Ows11Util.code( p.key ) );
input.setTitle( Ows11Util.languageString( p.title ) );
input.setAbstract( Ows11Util.languageString( p.description ) );
// WPS spec specifies non-negative for unlimited inputs, so -1 -> 0
input.setMaxOccurs( p.maxOccurs == -1
? BigInteger.valueOf( Long.MAX_VALUE ) : BigInteger.valueOf( p.maxOccurs ) );
input.setMinOccurs( BigInteger.valueOf( p.minOccurs ) );
List<ProcessParameterIO> ppios = ProcessParameterIO.findAll( p, context);
if ( ppios.isEmpty() ) {
throw new WPSException( "Could not find process parameter for type " + p.key + "," + p.type );
}
//handle the literal case
if (ppios.get( 0 ) instanceof LiteralPPIO ) {
LiteralPPIO lppio = (LiteralPPIO) ppios.get( 0 );
LiteralInputType literal = wpsf.createLiteralInputType();
input.setLiteralData( literal );
// map the java class to an xml type name
if ( !String.class.equals(lppio.getType()) ) {
Class type = lppio.getType();
if(PRIMITIVE_TO_WRAPPER.containsKey(type)) {
type = PRIMITIVE_TO_WRAPPER.get(type);
}
Name typeName = xsp.name(type);
if ( typeName != null ) {
literal.setDataType(Ows11Util.type("xs:" + typeName.getLocalPart()));
}
}
if(lppio.getType().isEnum()) {
Object[] enumValues = lppio.getType().getEnumConstants();
AllowedValuesType allowed = owsf.createAllowedValuesType();
for (Object value : enumValues) {
ValueType vt = owsf.createValueType();
vt.setValue(value.toString());
allowed.getValue().add(vt);
}
literal.setAllowedValues(allowed);
} else {
literal.setAnyValue( owsf.createAnyValueType() );
}
//TODO: output the default value and see if we can output a valid range as well
} else if(ppios.get( 0 ) instanceof BoundingBoxPPIO) {
input.setBoundingBoxData(buildSupportedCRSType());
} else {
//handle the complex data case
SupportedComplexDataInputType complex = wpsf.createSupportedComplexDataInputType();
input.setComplexData( complex );
complex.setSupported( wpsf.createComplexDataCombinationsType() );
for ( ProcessParameterIO ppio : ppios ) {
ComplexPPIO cppio = (ComplexPPIO) ppio;