/** * Returns true if the specified parameter is a complex one * * @param param * @param applicationContext */ public static boolean isComplex(Parameter<?> param, ApplicationContext applicationContext) { List<ProcessParameterIO> ppios = findAll(param, applicationContext); if (ppios.isEmpty()) { return false; } else { return ppios.get(0) instanceof ComplexPPIO; } }
if (ppio.getIdentifer() != null && ppio.getIdentifer().equals(p.key) && ppio.getType().isAssignableFrom(p.type)) { matches.add(ppio); if (ppio.getType().isAssignableFrom(p.type)) { matches.add(ppio);
public static List<ProcessParameterIO> findEncoder(Parameter<?> p, ApplicationContext context) { return findByDirection(p, context, PPIODirection.ENCODING); }
private static List<ProcessParameterIO> findByDirection( Parameter<?> p, ApplicationContext context, PPIODirection direction) { List<ProcessParameterIO> ppios = new ArrayList<ProcessParameterIO>(); List<ProcessParameterIO> matches = findAll(p, context); for (ProcessParameterIO ppio : matches) { if (ppio.getDirection() == PPIODirection.BOTH || ppio.getDirection() == direction) { ppios.add(ppio); } } return ppios; }
mime = input.getReference().getMimeType(); ProcessParameterIO ppio = ProcessParameterIO.find(p, manager.applicationContext, mime); if (ppio == null) { throw new WPSException("Unable to decode input: " + inputId);
throw new ProcessException("Don't know how to encode in mime type " + mimeType); } else if (!(ppio_ instanceof ComplexPPIO)) { throw new ProcessException("Invalid PPIO found " + ppio_.getIdentifer());
|| !ProcessParameterIO.isComplex(param, applicationContext))) { continue;
List<ProcessParameterIO> ppios = ProcessParameterIO.findDecoder(p, context); if (ppios.isEmpty()) { throw new WPSException(
output.setTitle(Ows11Util.languageString(p.title)); List<ProcessParameterIO> ppios = ProcessParameterIO.findEncoder(p, context); if (ppios.isEmpty()) { throw new WPSException(
mimeType = getOutputMimeType(key); ProcessParameterIO ppio = ProcessParameterIO.find(outputParam, context, mimeType);
throw new ProcessException("Don't know how to encode in mime type " + mimeType); } else if (!(ppio_ instanceof ComplexPPIO)) { throw new ProcessException("Invalid PPIO found " + ppio_.getIdentifer());
/** * Process the request as an internal one, without going through GML encoding/decoding * * @param ppio * @param ref * @param method * @return * @throws Exception */ Object handleAsInternalWPS(ProcessParameterIO ppio, InputReferenceType ref) throws Exception { ExecuteType request = null; if (ref.getMethod() == MethodType.POST_LITERAL) { request = (ExecuteType) ref.getBody(); } else { ExecuteKvpRequestReader reader = (ExecuteKvpRequestReader) context .getBean("executeKvpRequestReader"); request = (ExecuteType) kvpParse(ref.getHref(), reader); } Map<String, Object> results = executor.submitChained(new ExecuteRequest(request)); Object obj = results.values().iterator().next(); if (obj != null && !ppio.getType().isInstance(obj)) { throw new WPSException( "The process output is incompatible with the input target type, was expecting " + ppio.getType().getName() + " and got " + obj.getClass().getName()); } return obj; }
public static ProcessParameterIO find(Parameter<?> p, ApplicationContext context, String mime) { // enum special treatment if (p.type.isEnum()) { return new EnumPPIO(p.type); } // TODO: come up with some way to flag one as "default" List<ProcessParameterIO> all = findAll(p, context); if (all.isEmpty()) { return null; } if (mime != null) { for (ProcessParameterIO ppio : all) { if (ppio instanceof ComplexPPIO && ((ComplexPPIO) ppio).getMimeType().equals(mime)) { return ppio; } } } // fall back on the first found return all.get(0); }
if (ppio.getIdentifer() != null && ppio.getIdentifer().equals(p.key) && ppio.getType().isAssignableFrom(p.type)) { matches.add(ppio); if (ppio.getType().isAssignableFrom(p.type)) { matches.add(ppio);
mime = input.getReference().getMimeType(); ProcessParameterIO ppio = ProcessParameterIO.find(p, manager.applicationContext, mime); if (ppio == null) { throw new WPSException("Unable to decode input: " + inputId);
public static List<ProcessParameterIO> findDecoder(Parameter<?> p, ApplicationContext context) { return findByDirection(p, context, PPIODirection.DECODING); }
List<ProcessParameterIO> all = findAll(p, context); if (all.isEmpty()) { return null;