Examples of InputType


Examples of net.opengis.wps10.InputType

        buildDocument(xml);
       
        ExecuteType execute = (ExecuteType) parse(WPS.Execute);
       
        assertEquals("orci:Bounds", execute.getIdentifier().getValue());
        InputType input = (InputType) execute.getDataInputs().getInput().get(0);
        assertEquals("features", input.getIdentifier().getValue());
        InputReferenceType ref = input.getReference();
        assertNotNull(ref);
        assertEquals("http://demo.opengeo.org/geoserver/wfs", ref.getHref());
        assertEquals(MethodType.POST_LITERAL, ref.getMethod());
        // we cannot do this still as the parser strips the white space out of CDATA sections
        // assertEquals(body, ref.getBody());
View Full Code Here

Examples of net.opengis.wps10.InputType

        buildDocument(xml);
       
        ExecuteType execute = (ExecuteType) parse(WPS.Execute);
       
        assertEquals("orci:Bounds", execute.getIdentifier().getValue());
        InputType input = (InputType) execute.getDataInputs().getInput().get(0);
        assertEquals("features", input.getIdentifier().getValue());
        InputReferenceType ref = input.getReference();
        assertNotNull(ref);
        assertEquals("http://demo.opengeo.org/geoserver/wfs", ref.getHref());
        assertEquals(MethodType.POST_LITERAL, ref.getMethod());
        assertTrue(ref.getBody() instanceof GetFeatureType);
        // could not find any way to extract the content element...
View Full Code Here

Examples of net.opengis.wps10.InputType

       
        List<InputType> result = new ArrayList<InputType>();
        for (IOParam ioParam : params) {
            // common
            Wps10Factory factory = Wps10Factory.eINSTANCE;
            InputType it = factory.createInputType();
            it.setIdentifier(Ows11Util.code(ioParam.id));
            it.setData(factory.createDataType());
           
            Parameter<?> gtParam = inputParams.get(ioParam.id);
            if(gtParam == null) {
                throw new WPSException("Unknown data input named '" + ioParam.id + "'");
            }
            ProcessParameterIO ppio = ProcessParameterIO.findAll(gtParam, applicationContext).get(0);
           
            if(ppio instanceof LiteralPPIO) {
                it.getData().setLiteralData(parseLiteral(it, factory, ioParam));
            } else if(ppio instanceof BoundingBoxPPIO) {
                it.getData().setBoundingBoxData(parseBoundingBox(it, factory, ioParam));
            } else if(ioParam.isReference()) {
                it.setReference(parseReferenceType(it, factory, ioParam));
            } else {
                it.getData().setComplexData(parseComplex(it, factory, ioParam));
            }
           
            result.add(it);
        }
       
View Full Code Here

Examples of net.opengis.wps10.InputType

        response.getStatus().setProcessSucceeded("Process succeeded.");

        // inputs
        response.setDataInputs(f.createDataInputsType1());
        for (Iterator i = request.getDataInputs().getInput().iterator(); i.hasNext();) {
            InputType input = (InputType) i.next();
            response.getDataInputs().getInput().add(EMFUtils.clone(input, f, true));
        }

        // output definitions
        OutputDefinitionsType outputs = f.createOutputDefinitionsType();
View Full Code Here

Examples of net.opengis.wps10.InputType

     */
    Map<String, Object> parseProcessInputs(ExecuteType request, Name processName, ProcessFactory pf) {
        Map<String, Object> inputs = new HashMap<String, Object>();
        final Map<String, Parameter<?>> parameters = pf.getParameterInfo(processName);
        for (Iterator i = request.getDataInputs().getInput().iterator(); i.hasNext();) {
            InputType input = (InputType) i.next();
            String inputId = input.getIdentifier().getValue();

            // locate the parameter for this request
            Parameter p = parameters.get(inputId);
            if (p == null) {
                throw new WPSException("No such parameter: " + inputId);
            }

            // find the ppio
            String mime = null;
            if (input.getData() != null && input.getData().getComplexData() != null) {
                mime = input.getData().getComplexData().getMimeType();
            } else if (input.getReference() != null) {
                mime = input.getReference().getMimeType();
            }
            ProcessParameterIO ppio = ProcessParameterIO.find(p, context, mime);
            if (ppio == null) {
                throw new WPSException("Unable to decode input: " + inputId);
            }

            // read the data
            Object decoded = null;
            try {
                if (input.getReference() != null) {
                    // this is a reference
                    InputReferenceType ref = input.getReference();

                    // grab the location and method
                    String href = ref.getHref();

                    if (href.startsWith("http://geoserver/wfs")) {
                        decoded = handleAsInternalWFS(ppio, ref);
                    } else if (href.startsWith("http://geoserver/wcs")) {
                        decoded = handleAsInternalWCS(ppio, ref);
                    } else if (href.startsWith("http://geoserver/wps")) {
                        decoded = handleAsInternalWPS(ppio, ref);
                    } else {
                        decoded = executeRemoteRequest(ref, (ComplexPPIO) ppio, inputId);
                    }

                } else {
                    // actual data, figure out which type
                    DataType data = input.getData();

                    if (data.getLiteralData() != null) {
                        LiteralDataType literal = data.getLiteralData();
                        decoded = ((LiteralPPIO) ppio).decode(literal.getValue());
                    } else if (data.getComplexData() != null) {
View Full Code Here

Examples of net.opengis.wps10.InputType

        if (helper.isLineageRequested()) {
            // inputs
            if (request.getDataInputs() != null && request.getDataInputs().getInput().size() > 0) {
                response.setDataInputs(f.createDataInputsType1());
                for (Iterator i = request.getDataInputs().getInput().iterator(); i.hasNext();) {
                    InputType input = (InputType) i.next();
                    response.getDataInputs().getInput().add(EMFUtils.clone(input, f, true));
                }
            }

            // output definitions, if any was requested explicitly
View Full Code Here

Examples of net.opengis.wps10.InputType

       
        List<InputType> result = new ArrayList<InputType>();
        for (IOParam ioParam : params) {
            // common
            Wps10Factory factory = Wps10Factory.eINSTANCE;
            InputType it = factory.createInputType();
            it.setIdentifier(Ows11Util.code(ioParam.id));
            it.setData(factory.createDataType());
           
            Parameter<?> gtParam = inputParams.get(ioParam.id);
            if(gtParam == null) {
                throw new WPSException("Unknown data input named '" + ioParam.id + "'");
            }
            ProcessParameterIO ppio = ProcessParameterIO.findAll(gtParam, applicationContext).get(0);
           
            if(ppio instanceof LiteralPPIO) {
                it.getData().setLiteralData(parseLiteral(it, factory, ioParam));
            } else if(ppio instanceof BoundingBoxPPIO) {
                it.getData().setBoundingBoxData(parseBoundingBox(it, factory, ioParam));
            } else if(ioParam.isReference()) {
                it.setReference(parseReferenceType(it, factory, ioParam));
            } else {
                it.getData().setComplexData(parseComplex(it, factory, ioParam));
            }
           
            result.add(it);
        }
       
View Full Code Here

Examples of net.opengis.wps10.InputType

            }
        }

        // turn them into a map of input providers
        for (Iterator i = request.getDataInputs().getInput().iterator(); i.hasNext();) {
            InputType input = (InputType) i.next();
            String inputId = input.getIdentifier().getValue();

            // locate the parameter for this request
            Parameter p = parameters.get(inputId);
            if (p == null) {
                throw new WPSException("No such parameter: " + inputId);
            }

            // find the ppio
            String mime = null;
            if (input.getData() != null && input.getData().getComplexData() != null) {
                mime = input.getData().getComplexData().getMimeType();
            } else if (input.getReference() != null) {
                mime = input.getReference().getMimeType();
            }
            ProcessParameterIO ppio = ProcessParameterIO.find(p, manager.applicationContext, mime);
            if (ppio == null) {
                throw new WPSException("Unable to decode input: " + inputId);
            }
View Full Code Here

Examples of org.dtk.resources.dependencies.InputType

   
    // Process form submission, parsing text strings from values.
    MultivaluedMap<String, Object> formFields = HttpUtil.retrieveMultiPartFormValues(multiPartForm, String.class);

    // Check request contains valid input parameters, value and type.
    InputType inputType = retrieveInputType(formFields);
    String inputValue = retrieveInputValue(formFields);
   
    logger.log(Level.INFO, String.format(analyseDependenciesLogMsg, inputType.name(), inputValue));
   
    // Invoke analysis based upon input type (web_page, url or profile).
    switch(inputType) {
    case WEB_PAGE:
      moduleAnalysis = analyseModulesFromWebpage(inputValue);
      break;
    case URL:
      moduleAnalysis = analyseModulesFromUrl(inputValue);
      break;
    }

    // Convert Java Map to Json object and then encode inside HTML.
    // If parsing errors are thrown, return an internal server error
    // HTTP response.
    try {           
      DependenciesResponse response;
      String customPackageIdentifier = null;
     
      if (moduleAnalysis instanceof RecursiveModuleAnalysis) {
        customPackageIdentifier = createTemporaryPackageForRetrievedSource((RecursiveModuleAnalysis) moduleAnalysis);
      }
     
      if (customPackageIdentifier != null) {
        response = new ExplicitModuleFormatAnalysisDependenciesResponse(moduleAnalysis,
          customPackageIdentifier, ModuleFormat.NON_AMD)
      } else {
        response = new ExplicitModuleFormatAnalysisDependenciesResponse(moduleAnalysis, ModuleFormat.NON_AMD);
      }
     
      encodedJson = JsonUtil.writeJavaToHtmlEncodedJson(response);
    } catch (FatalAnalysisError e) {
      logger.log(Level.SEVERE, String.format(errorGeneratingJsonLogMsg, inputType.name(), inputValue));         
      throw new ConfigurationException(internalServerErrorText);
    } catch (JsonParseException e) {
      logger.log(Level.SEVERE, String.format(errorGeneratingJsonLogMsg, inputType.name(), inputValue));         
      throw new ConfigurationException(internalServerErrorText);
    } catch (JsonMappingException e) {
      logger.log(Level.SEVERE, String.format(errorGeneratingJsonLogMsg, inputType.name(), inputValue));         
      throw new ConfigurationException(internalServerErrorText);
    } catch (IOException e) {
      logger.log(Level.SEVERE, String.format(errorGeneratingJsonLogMsg, inputType.name(), inputValue));         
      throw new ConfigurationException(internalServerErrorText);     
    } catch (UnknownModuleIdentifier e) {
      logger.log(Level.SEVERE, String.format(errorGeneratingJsonLogMsg, inputType.name(), inputValue));         
      throw new ConfigurationException(internalServerErrorText);   
    } catch (ModuleSourceNotAvailable e) {
      logger.log(Level.SEVERE, String.format(errorGeneratingJsonLogMsg, inputType.name(), inputValue));         
      throw new ConfigurationException(internalServerErrorText);   
    }

    logger.exiting(this.getClass().getName(), "analyseDependencies");
   
View Full Code Here

Examples of org.dtk.resources.dependencies.InputType

   * @return
   * @throws IncorrectParameterException
   */
  protected InputType retrieveInputType(MultivaluedMap<String, Object> request)
  throws IncorrectParameterException {
    InputType type;

    try {
      String typeStr = (String) request.getFirst(typeParameter);
      type = InputType.valueOf(typeStr.toUpperCase());
    } catch (NullPointerException npe) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.