@Override public Object decode(Object input) throws Exception { if (input instanceof String) { return decode(new ByteArrayInputStream(((String) input).getBytes())); } return super.decode(input); }
@Override protected Object getValueInternal(ProgressListener listener) throws Exception { WebFeatureService wfs = (WebFeatureService) context.getBean("wfsServiceTarget"); GetFeatureType gft = null; InputReferenceType ref = input.getReference(); if (ref.getMethod() == MethodType.POST_LITERAL) { gft = (GetFeatureType) ref.getBody(); } else { GetFeatureKvpRequestReader reader = (GetFeatureKvpRequestReader) context.getBean("getFeatureKvpReader"); gft = (GetFeatureType) kvpParse(ref.getHref(), reader); } FeatureCollectionResponse featureCollectionType = wfs.getFeature(gft); // this will also deal with axis order issues return ((ComplexPPIO) ppio).decode(featureCollectionType.getAdaptee()); }
/** * Process the request as an internal one, without going through GML encoding/decoding * * @param ppio * @param ref * @param method * @return * @throws Exception */ Object handleAsInternalWFS(ProcessParameterIO ppio, InputReferenceType ref) throws Exception { WebFeatureService wfs = (WebFeatureService) context.getBean("wfsServiceTarget"); GetFeatureType gft = null; if (ref.getMethod() == MethodType.POST_LITERAL) { gft = (GetFeatureType) ref.getBody(); } else { GetFeatureKvpRequestReader reader = (GetFeatureKvpRequestReader) context .getBean("getFeatureKvpReader"); gft = (GetFeatureType) kvpParse(ref.getHref(), reader); } FeatureCollectionResponse featureCollectionType = wfs.getFeature(gft); // this will also deal with axis order issues return ((ComplexPPIO) ppio).decode(featureCollectionType.getAdaptee()); }
Object result = complexPPIO.decode(is); if (result == null || complexPPIO.getType().isInstance(result)) { return result;
return ppio.decode(input); } else { throw new WPSException("Could not find a mean to read input " + inputId);
} else if (data.getComplexData() != null) { ComplexDataType complex = data.getComplexData(); value = ((ComplexPPIO) ppio).decode(complex.getData().get(0)); } else if (data.getBoundingBoxData() != null) { value = ((BoundingBoxPPIO) ppio).decode(data.getBoundingBoxData());