Package net.opengis.wps10

Examples of net.opengis.wps10.ComplexDataType


        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())
View Full Code Here


        inputs.getInput().add(in);

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

        ComplexDataType cd = f.createComplexDataType();
        data.setComplexData(cd);

        //cd.getData().add(new GeometryFactory().createPoint(new Coordinate(1, 2)));

        Encoder e = new Encoder(new WPSConfiguration());
View Full Code Here

        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)));

        Encoder e = new Encoder(new WPSConfiguration());
        e.setIndenting(true);
View Full Code Here

            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")));
        assertEquals(expected, filter);
    }
View Full Code Here

        buildDocument(xml);
      
        Object o = parse(WPS.ComplexDataType);
        assertTrue( o instanceof ComplexDataType );
       
        ComplexDataType data = (ComplexDataType) o;
        assertEquals( 1, data.getData().size() );
       
        assertTrue( data.getData().get( 0 ) instanceof Polygon );
    }
View Full Code Here

        buildDocument(xml);
      
        Object o = parse(WPS.ComplexDataType);
        assertTrue( o instanceof ComplexDataType );
       
        ComplexDataType data = (ComplexDataType) o;
        assertEquals( 1, data.getData().size() );
       
        assertTrue( data.getData().get( 0 ) instanceof FeatureCollectionType );
        FeatureCollectionType fc = (FeatureCollectionType) data.getData().get( 0 );

        assertEquals( 1, fc.getFeature().size() );
        FeatureCollection features = (FeatureCollection) fc.getFeature().get( 0 );
        assertEquals( 1, features.size() );
   
View Full Code Here

        return ref;
    }

    private ComplexDataType parseComplex(InputType it, Wps10Factory factory,
            IOParam param) {
        ComplexDataType complex = factory.createComplexDataType();
        complex.getData().add(param.value);
        complex.setEncoding(param.attributes.get("encoding"));
        complex.setMimeType(param.attributes.get("mimetype"));
        complex.setSchema(param.attributes.get("schema"));

        return complex;
    }
View Full Code Here

                      literal.setValue(((LiteralPPIO) ppio).encode(o));
                  } else if (ppio instanceof BoundingBoxPPIO) {
                      BoundingBoxType bbox = ((BoundingBoxPPIO) ppio).encode(o);
                      data.setBoundingBoxData(bbox);
                  } else if (ppio instanceof ComplexPPIO) {
                      ComplexDataType complex = f.createComplexDataType();
                      data.setComplexData(complex);
 
                      ComplexPPIO cppio = (ComplexPPIO) ppio;
                      complex.setMimeType(cppio.getMimeType());
 
                      if (cppio instanceof XMLPPIO) {
                          // encode directly
                          complex.getData().add(new XMLEncoderDelegate((XMLPPIO) cppio, o));
                      } else if (cppio instanceof CDataPPIO) {
                          complex.getData().add(new CDataEncoderDelegate((CDataPPIO) cppio, o));
                      } else if (cppio instanceof BinaryPPIO) {
                          complex.getData().add(new BinaryEncoderDelegate((BinaryPPIO) cppio, o));
                      } else {
                          throw new WPSException("Don't know how to encode an output whose PPIO is "
                                  + cppio);
                      }
                  }
View Full Code Here

                    if (data.getLiteralData() != null) {
                        LiteralDataType literal = data.getLiteralData();
                        decoded = ((LiteralPPIO) ppio).decode(literal.getValue());
                    } else if (data.getComplexData() != null) {
                        ComplexDataType complex = data.getComplexData();
                        decoded = ((ComplexPPIO) ppio).decode(complex.getData().get(0));
                    } else if (data.getBoundingBoxData() != null) {
                        decoded = ((BoundingBoxPPIO) ppio).decode(data.getBoundingBoxData());
                    }

                }
View Full Code Here

        super( factory );
    }

    @Override
    public List getProperties(Object object) throws Exception {
        ComplexDataType complex = (ComplexDataType) object;
        if ( !complex.getData().isEmpty() && complex.getData().get( 0 ) instanceof XMLEncoderDelegate ) {
            XMLEncoderDelegate delegate = (XMLEncoderDelegate) complex.getData().get( 0 );
            List properties = new ArrayList();
            properties.add( new Object[]{
                delegate.getProcessParameterIO().getElement(), delegate } );
           
            return properties;
View Full Code Here

TOP

Related Classes of net.opengis.wps10.ComplexDataType

Copyright © 2018 www.massapicom. 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.