Examples of ExecuteProcessRequest


Examples of org.geotools.data.wps.request.ExecuteProcessRequest

        if (onlineResource == null)
        {
            onlineResource = serverURL;
        }

        ExecuteProcessRequest request = getSpecification().createExecuteProcessRequest(onlineResource);

        return request;
    }
View Full Code Here

Examples of org.geotools.data.wps.request.ExecuteProcessRequest

    } catch (IOException e) {
      return null;
    }
   
    // create the execute request object
    ExecuteProcessRequest exeRequest = wps.createExecuteProcessRequest();
    exeRequest.setIdentifier(wpsfactory.getIdentifier());
   
    // loop through each expected input in the describeprocess, and set it
    // based on what we have in the provided input map.
    EList inputs = pdt.getDataInputs().getInput();
    Iterator iterator = inputs.iterator();
    while (iterator.hasNext()) {
      InputDescriptionType idt = (InputDescriptionType) iterator.next();
      String identifier = idt.getIdentifier().getValue();
      Object inputValue = input.get(identifier);
      if (inputValue != null) {
        // if our value is some sort of collection, then created multiple
        // dataTypes for this inputdescriptiontype.
        List<EObject> list = new ArrayList<EObject>();
        if (inputValue instanceof Map) {
          for (Object inVal : ((Map)inputValue).values()) {
            DataType createdInput = WPSUtils.createInputDataType(inVal, idt);
            list.add(createdInput);
          }
        } else if (inputValue instanceof Collection) {
          for (Object inVal : (Collection)inputValue) {
            DataType createdInput = WPSUtils.createInputDataType(inVal, idt);
            list.add(createdInput);
          }
        } else {
          // our value is a single object so create a single datatype for it
          DataType createdInput = WPSUtils.createInputDataType(inputValue, idt);
          list.add(createdInput);
        }
        // add the input to the execute request
        exeRequest.addInput(identifier, list);
      }
    }
   
    // send the request and get the response
    ExecuteProcessResponse response;
View Full Code Here

Examples of org.geotools.data.wps.request.ExecuteProcessRequest

        if (DISABLE)
        {
            return;
        }

        ExecuteProcessRequest request = wps.createExecuteProcessRequest();
       
        // reference to the File
        EObject kmzFileReference = Wps10Factory.eINSTANCE.createInputReferenceType();
        ((InputReferenceType)kmzFileReference).setMimeType("application/vnd.google-earth.kmz");
        ((InputReferenceType)kmzFileReference).setMethod(MethodType.GET_LITERAL);
        ((InputReferenceType)kmzFileReference).setHref("file:///testref");
       
        request.addInput("input Gliders KMZ file", Arrays.asList(kmzFileReference));
       
        ByteArrayOutputStream out = null;
        InputStream in = null;
        BufferedReader reader = null;
        try
        {
            out = new ByteArrayOutputStream();
            request.performPostOutput(out);

            in = new ByteArrayInputStream(out.toByteArray());
            reader = new BufferedReader(new InputStreamReader(in));

            StringBuilder postText = new StringBuilder();
View Full Code Here

Examples of org.geotools.data.wps.request.ExecuteProcessRequest

        DescribeProcessResponse descResponse = wps.issueRequest(descRequest);

        // based on the describeprocess, setup the execute
        ProcessDescriptionsType processDesc = descResponse.getProcessDesc();
        ExecuteProcessRequest exeRequest = wps.createExecuteProcessRequest();
        exeRequest.setIdentifier(processIden);

        // set input data
        setLocalInputDataBufferPoly(exeRequest, processDesc, geom1);

        // send the request
View Full Code Here

Examples of org.geotools.data.wps.request.ExecuteProcessRequest

        DescribeProcessResponse descResponse = wps.issueRequest(descRequest);

        // based on the describeprocess, setup the execute
        ProcessDescriptionsType processDesc = descResponse.getProcessDesc();
        ExecuteProcessRequest exeRequest = wps.createExecuteProcessRequest();
        exeRequest.setIdentifier(processIden);

        // set input data
        set52NInputData(exeRequest, processDesc);

        // send the request
View Full Code Here

Examples of org.geotools.data.wps.request.ExecuteProcessRequest

        DescribeProcessResponse descResponse = wps.issueRequest(descRequest);

        // based on the describeprocess, setup the execute
        ProcessDescriptionsType processDesc = descResponse.getProcessDesc();
        ExecuteProcessRequest exeRequest = wps.createExecuteProcessRequest();
        exeRequest.setIdentifier(processIdenLocal);

        setLocalInputDataUnion(exeRequest, processDesc);
       
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        exeRequest.performPostOutput(bos);
        System.out.println(bos.toString());

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);
View Full Code Here

Examples of org.geotools.data.wps.request.ExecuteProcessRequest

        DescribeProcessResponse descResponse = wps.issueRequest(descRequest);

        // based on the describeprocess, setup the execute
        ProcessDescriptionsType processDesc = descResponse.getProcessDesc();
        ExecuteProcessRequest exeRequest = wps.createExecuteProcessRequest();
        exeRequest.setIdentifier(processIdenLocal);

        setLocalInputDataAdd(exeRequest, processDesc);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);
View Full Code Here

Examples of org.geotools.data.wps.request.ExecuteProcessRequest

        DescribeProcessResponse descResponse = wps.issueRequest(descRequest);

        // based on the describeprocess, setup the execute
        ProcessDescriptionsType processDesc = descResponse.getProcessDesc();
        ExecuteProcessRequest exeRequest = wps.createExecuteProcessRequest();
        exeRequest.setIdentifier(processIdenLocal);
        exeRequest.addInput("envelope", Arrays.asList(wps.createBoundingBoxInputValue("EPSG:4326", 2, Arrays.asList(-180d, -90d), Arrays.asList(180d, 90d))));
        exeRequest.addInput("width", Arrays.asList(wps.createLiteralInputValue("2")));
        exeRequest.addInput("height", Arrays.asList(wps.createLiteralInputValue("1")));
        OutputDefinitionType rawOutput = wps.createOutputDefinitionType("result");
        rawOutput.setMimeType("application/arcgrid");
        ResponseFormType responseForm = wps.createResponseForm(null, rawOutput);
        exeRequest.setResponseForm(responseForm);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
View Full Code Here

Examples of org.geotools.data.wps.request.ExecuteProcessRequest

            System.out.println("Skipping, gs:AreaGrid not found!");
            return;
        }

        // build the request
        ExecuteProcessRequest exeRequest = wps.createExecuteProcessRequest();
        exeRequest.setIdentifier(processIdenLocal);
        exeRequest.addInput("envelope", Arrays.asList(wps.createBoundingBoxInputValue("EPSG:4326", 2, Arrays.asList(-180d, -90d), Arrays.asList(180d, 90d))));
        // don't set the width, height required params
        //        exeRequest.addInput("width", Arrays.asList(wps.createLiteralInputValue("abc")));
        //        exeRequest.addInput("height", Arrays.asList(wps.createLiteralInputValue("def")));
        OutputDefinitionType rawOutput = wps.createOutputDefinitionType("result");
        rawOutput.setMimeType("application/arcgrid");
        ResponseFormType responseForm = wps.createResponseForm(null, rawOutput);
        exeRequest.setResponseForm(responseForm);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
View Full Code Here

Examples of org.geotools.data.wps.request.ExecuteProcessRequest

            System.out.println("Skipping, gs:AreaGrid not found!");
            return;
        }

        // based on the describeprocess, setup the execute
        ExecuteProcessRequest exeRequest = wps.createExecuteProcessRequest();
        exeRequest.setIdentifier(processIdenLocal);
        exeRequest.addInput("envelope", Arrays.asList(wps.createBoundingBoxInputValue("EPSG:4326", 2, Arrays.asList(-180d, -90d), Arrays.asList(180d, 90d))));
        exeRequest.addInput("width", Arrays.asList(wps.createLiteralInputValue("100")));
        exeRequest.addInput("height", Arrays.asList(wps.createLiteralInputValue("50")));
        ResponseDocumentType doc = wps.createResponseDocumentType(false, true, true, "result");
        DocumentOutputDefinitionType odt = (DocumentOutputDefinitionType) doc.getOutput().get(0);
        odt.setMimeType("application/arcgrid");
        odt.setAsReference(true);
        ResponseFormType responseForm = wps.createResponseForm(doc, null);
        exeRequest.setResponseForm(responseForm);

        // send the request
        ExecuteProcessResponse response = wps.issueRequest(exeRequest);

        // response should not be null and no exception should occur.
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.