Examples of OutputDataType


Examples of net.opengis.wps10.OutputDataType

        //process outputs
        ProcessOutputsType1 processOutputs = f.createProcessOutputsType1();
        response.setProcessOutputs( processOutputs );
       
        for ( String key : result.keySet() ) {
            OutputDataType output = f.createOutputDataType();
            output.setIdentifier(Ows11Util.code(key));
            output.setTitle(Ows11Util.languageString(pf.getResultInfo(processName, null).get( key ).description));
            processOutputs.getOutput().add( output );
           
            final Object o = result.get( key );
            ProcessParameterIO ppio = ppios.get( key );
           
            if ( ppio instanceof ReferencePPIO ) {
                //encode as a reference
                OutputReferenceType ref = f.createOutputReferenceType();
                output.setReference( ref );
               
                //TODO: mime type
                ref.setHref( ((ReferencePPIO) ppio).encode(o).toString() );
            }
            else {
                //encode as data
                DataType data = f.createDataType();
                output.setData( data );
          
                if ( ppio instanceof LiteralPPIO ) {
                    LiteralDataType literal = f.createLiteralDataType();
                    data.setLiteralData( literal );
                   
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

            // normal execute response encoding
            return standardResponse.getMimeType(value, operation);
        } else {
            // raw response, let's see what the output is
            ExecuteResponseType response = (ExecuteResponseType) value;
            OutputDataType result = (OutputDataType) response
                    .getProcessOutputs().getOutput().get(0);
            LiteralDataType literal = result.getData().getLiteralData();
            if(literal != null) {
                // literals are encoded as plain strings
                return "text/plain";
            } else {
                // Execute should have properly setup the mime type
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

            // normal execute response encoding
            standardResponse.write(value, output, operation);
        } else {
            // raw response, let's see what the output is
            ExecuteResponseType response = (ExecuteResponseType) value;
            OutputDataType result = (OutputDataType) response
                    .getProcessOutputs().getOutput().get(0);
            LiteralDataType literal = result.getData().getLiteralData();
            if (literal != null) {
                writeLiteral(output, literal);
            } else {
                writeComplex(output, result);
            }
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

        assertNull(exceptionResponse);

        // check that the result is expected
        Geometry expected = geom1.buffer(350);
        EList outputs = executeResponse.getProcessOutputs().getOutput();
        OutputDataType output = (OutputDataType) outputs.get(0);
        Geometry result = (Geometry) output.getData().getComplexData().getData().get(0);
        // System.out.println(expected);
        // System.out.println(result);
        // assertTrue(expected.equals(result));

    }
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

        // check result correctness
        EList outputs = executeResponse.getProcessOutputs().getOutput();
        assertTrue(!outputs.isEmpty());

        OutputDataType output = (OutputDataType) outputs.get(0);
        LiteralDataType literalData = output.getData().getLiteralData();
        String value = literalData.getValue();
        Double result = new Double(value);
        Double expected = 77.84 + 40039.229;
        assertEquals(result, expected);
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

            assertNotNull(executeResponse);
        }

        // check result correctness
        assertEquals(1, executeResponse.getProcessOutputs().getOutput().size());
        OutputDataType output = (OutputDataType) executeResponse.getProcessOutputs().getOutput().get(0);
       
        assertEquals("result", output.getIdentifier().getValue());
        assertEquals("application/arcgrid", output.getReference().getMimeType());
        assertNotNull(output.getReference().getHref());
       
        URL dataURL = new URL(output.getReference().getHref());
        BufferedReader reader = new BufferedReader(new InputStreamReader(dataURL.openStream()));
        StringBuilder sb = new StringBuilder();
        String line = null;
        int count = 0;
        while((line = reader.readLine()) != null && count <= 5) {
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

        }

        Iterator iterator = outputs.iterator();
        while (iterator.hasNext())
        {
            OutputDataType odt = (OutputDataType) iterator.next();
            DataType data = odt.getData();
            ComplexDataType complexData = data.getComplexData();
            LiteralDataType literalData = data.getLiteralData();
            if (literalData != null)
            {
                // use the converters api to try and create an object of the type
                // we want (default to the String value if it failed).
                Object value = literalData.getValue();
                if (literalData.getDataType() != null)
                {
                    Class type = getLiteralTypeFromReference(literalData.getDataType());
                    Object convertedValue = Converters.convert(literalData.getValue(), type);
                    if (convertedValue != null)
                    {
                        value = convertedValue;
                    }
                }
                map.put(odt.getIdentifier().getValue(), value);
            }
            else if (complexData != null)
            {
                // if we have a list of values for this output, store it as a arraylist
                EList datas = complexData.getData();
                if (datas.size() > 1)
                {
                    Iterator iterator2 = datas.iterator();
                    List<Object> values = new ArrayList<Object>();
                    while (iterator2.hasNext())
                    {
                        Object value = iterator2.next();
                        values.add(value);
                    }
                    map.put(odt.getIdentifier().getValue(), values);
                }
                else
                {
                    map.put(odt.getIdentifier().getValue(), datas.get(0));
                }
            }

        }
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

        ExecuteResponseType response = f.createExecuteResponseType();

        ProcessOutputsType1 outputs = f.createProcessOutputsType1();
        response.setProcessOutputs(outputs);

        OutputDataType output = f.createOutputDataType();
        outputs.getOutput().add(output);

        LanguageStringType title = Ows11Factory.eINSTANCE.createLanguageStringType();
        output.setTitle(title);
        title.setValue("foo");

        DataType data = f.createDataType();
        output.setData(data);

        ComplexDataType cdata = f.createComplexDataType();
        data.setComplexData(cdata);
        //cdata.getData().add(new GeometryFactory().createPoint(new Coordinate(1, 1)));
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

        {
            exeResponse = (ExecuteResponseType) object;
        }

        // try to get the output datatype
        OutputDataType odt = (OutputDataType) exeResponse.getProcessOutputs().getOutput().get(0);
        String dataType = odt.getData().getLiteralData().getDataType();

        assertNotNull(dataType);

    }
View Full Code Here

Examples of net.opengis.wps10.OutputDataType

        // process outputs
        ProcessOutputsType1 processOutputs = f.createProcessOutputsType1();
        response.setProcessOutputs(processOutputs);

        for (String key : outputMap.keySet()) {
            OutputDataType output = f.createOutputDataType();
            output.setIdentifier(Ows11Util.code(key));
            output.setTitle(Ows11Util
                    .languageString(pf.getResultInfo(processName, null).get(key).description));
            processOutputs.getOutput().add(output);

            final Object o = outputMap.get(key).object;
            ProcessParameterIO ppio = ppios.get(key);

            if (ppio instanceof ReferencePPIO) {
                // encode as a reference
                OutputReferenceType ref = f.createOutputReferenceType();
                output.setReference(ref);

                ref.setMimeType(outputMap.get(key).definition.getMimeType());
                ref.setHref(((ReferencePPIO) ppio).encode(o).toString());
            } else {
                // encode as data
                DataType data = f.createDataType();
                output.setData(data);

                try {
                  if (ppio instanceof LiteralPPIO) {
                      LiteralDataType literal = f.createLiteralDataType();
                      data.setLiteralData(literal);
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.