Examples of ExecuteType


Examples of net.opengis.wps10.ExecuteType

    }
   
    @Override
    public String getMimeType(Object value, Operation operation)
            throws ServiceException {
        ExecuteType execute = (ExecuteType) operation.getParameters()[0];
        if (execute.getResponseForm().getRawDataOutput() == null) {
            // normal execute response encoding
            return standardResponse.getMimeType(value, operation);
        } else {
            // raw response, let's see what the output is
            ExecuteResponseType response = (ExecuteResponseType) value;
View Full Code Here

Examples of net.opengis.wps10.ExecuteType

    }

    @Override
    public void write(Object value, OutputStream output, Operation operation)
            throws IOException, ServiceException {
        ExecuteType execute = (ExecuteType) operation.getParameters()[0];
        if (execute.getResponseForm().getRawDataOutput() == null) {
            // normal execute response encoding
            standardResponse.write(value, output, operation);
        } else {
            // raw response, let's see what the output is
            ExecuteResponseType response = (ExecuteResponseType) value;
View Full Code Here

Examples of net.opengis.wps10.ExecuteType

        Configuration config = new WPSConfiguration();
        Encoder encoder = new Encoder(config);
        encoder.setIndenting(true);

        // http://schemas.opengis.net/wps/1.0.0/wpsExecute_request.xsd
        ExecuteType request = createExecuteType();
        encoder.encode(request, WPS.Execute, outputStream);
        // System.out.println(outputStream.toString());
    }
View Full Code Here

Examples of net.opengis.wps10.ExecuteType

    }

    @SuppressWarnings("unchecked")
    private ExecuteType createExecuteType()
    {
        ExecuteType request = Wps10Factory.eINSTANCE.createExecuteType();

        // identifier
        CodeType codetype = Ows11Factory.eINSTANCE.createCodeType();
        String iden = (String) this.properties.get(this.IDENTIFIER);
        codetype.setValue(iden);
        request.setIdentifier(codetype);

        // service and version
        request.setService("WPS"); // TODO: un-hardcode
        request.setVersion("1.0.0"); // TODO: un-hardcode

        // inputs - loop through inputs and add them
        if ((this.inputs != null) && !this.inputs.isEmpty())
        {
            DataInputsType1 inputtypes = Wps10Factory.eINSTANCE.createDataInputsType1();

            Set<Object> keyset = this.inputs.keySet();
            Iterator<Object> iterator = keyset.iterator();
            while (iterator.hasNext())
            {
                Object key = iterator.next();
                List<DataType> objects = (List<DataType>) this.inputs.get(key);

                // go through the list and create on input for each datatype in the list
                Iterator<DataType> iterator2 = objects.iterator();
                while (iterator2.hasNext())
                {
                    // identifier
                    EObject oInput = iterator2.next();
                    if (oInput instanceof DataType) {
                      DataType dt = (DataType) oInput;
                      InputType input = Wps10Factory.eINSTANCE.createInputType();
                      CodeType ct = Ows11Factory.eINSTANCE.createCodeType();
                      ct.setValue((String) key);
                      input.setIdentifier(ct);
                      input.setData((DataType) dt);
                      inputtypes.getInput().add(input);
                    } else if (oInput instanceof InputReferenceType) {
                      InputReferenceType rt = (InputReferenceType) oInput;
                      InputType input = Wps10Factory.eINSTANCE.createInputType();
                      CodeType ct = Ows11Factory.eINSTANCE.createCodeType();
                      ct.setValue((String) key);
                      input.setIdentifier(ct);
                      input.setReference(rt);
                      inputtypes.getInput().add(input);
                    } else {
                        throw new IllegalStateException("The input for key " + key + " contain an unsupported object of type " + oInput.getClass());
                    }
                }
            }

            request.setDataInputs(inputtypes);
        }

        if (this.responseForm != null)
        {
            // responsetype
            request.setResponseForm(this.responseForm);
        }

        return request;
    }
View Full Code Here

Examples of net.opengis.wps10.ExecuteType

*/
public class ExecuteTest extends XMLTestSupport {

    public void testExecuteEncode() throws Exception {
        Wps10Factory f = Wps10Factory.eINSTANCE;
        ExecuteType ex = f.createExecuteType();

        CodeType id = Ows11Factory.eINSTANCE.createCodeType();
        ex.setIdentifier(id);
        id.setValue("foo");

        DataInputsType1 inputs = f.createDataInputsType1();
        ex.setDataInputs(inputs);

        InputType in = f.createInputType();
        inputs.getInput().add(in);

        DataType data = f.createDataType();
View Full Code Here

Examples of net.opengis.wps10.ExecuteType

    }


    public void testParserDelegateNamespaces() throws Exception {
        Parser p = new Parser(new WPSConfiguration());
        ExecuteType exec = (ExecuteType)
            p.parse(getClass().getResourceAsStream("wpsExecute_inlineGetFeature_request.xml"));
        assertNotNull(exec);
        assertEquals(1, exec.getDataInputs().getInput().size());

        InputType in = (InputType) exec.getDataInputs().getInput().get(0);
        InputReferenceType ref = in.getReference();
        assertNotNull(ref);

        assertTrue(ref.getBody() instanceof GetFeatureType);
        GetFeatureType gft = (GetFeatureType) ref.getBody();
View Full Code Here

Examples of net.opengis.wps10.ExecuteType

        assertEquals("http://usa.org", typeName.getNamespaceURI());
    }
   
    public void testFilterParserDelegate() throws Exception {
        Parser p = new Parser(new WPSConfiguration());
        ExecuteType exec = (ExecuteType)
            p.parse(getClass().getResourceAsStream("wpsExecuteFilterInline.xml"));
        assertNotNull(exec);
        assertEquals(1, exec.getDataInputs().getInput().size());

        InputType in = (InputType) exec.getDataInputs().getInput().get(0);
        ComplexDataType cd = in.getData().getComplexData();
        assertNotNull(cd);
        Filter filter = (Filter) cd.getData().get(0);
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
        Filter expected = ff.or(ff.greaterOrEqual(ff.property("PERSONS"), ff.literal("10000000")), ff.lessOrEqual(ff.property("PERSONS"), ff.literal("20000000")));
View Full Code Here

Examples of net.opengis.wps10.ExecuteType

        "    </wps:RawDataOutput>\n" +
        "  </wps:ResponseForm>\n" +
        "</wps:Execute>";
        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());
View Full Code Here

Examples of net.opengis.wps10.ExecuteType

        "    </wps:RawDataOutput>\n" +
        "  </wps:ResponseForm>\n" +
        "</wps:Execute>";
        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());
View Full Code Here

Examples of net.opengis.wps10.ExecuteType

        super(ExecuteType.class, Wps10Factory.eINSTANCE);
    }
   
    @Override
    public Object read(Object request, Map kvp, Map rawKvp) throws Exception {
        ExecuteType execute = (ExecuteType) super.read(request, kvp, rawKvp);
        Wps10Factory factory = Wps10Factory.eINSTANCE;
       
        // grab the process, we need it to parse the data inputs
        Name processName = Ows11Util.name(execute.getIdentifier());
        ProcessFactory pf = Processors.createProcessFactory(processName);
        if (pf == null) {
            throw new WPSException("No such process: " + processName);
        }

        // parse inputs
        List<InputType> inputs = parseDataInputs(pf.getParameterInfo(processName), (String) rawKvp.get("DataInputs"));
        DataInputsType1 input1 = factory.createDataInputsType1();
        input1.getInput().addAll(inputs);
        execute.setDataInputs(input1);
       
        if(rawKvp.containsKey("responseDocument")) {
            execute.setResponseForm(parseResponseDocument(pf.getResultInfo(processName, null), (String) rawKvp.get("responseDocument")));
        } else if(rawKvp.containsKey("rawDataOutput")) {
            execute.setResponseForm(parseRawDataOutput(pf.getResultInfo(processName, null), (String) rawKvp.get("rawDataOutput")));
        }
       
        return execute;
    }
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.