Package org.geoserver.wfs.xml.v1_1_0

Examples of org.geoserver.wfs.xml.v1_1_0.WFSConfiguration


            DescribeFeatureType dft =
                new DescribeFeatureType(geoServer.getService(WFSInfo.class), catalog);
            FeatureTypeInfo[] featureTypes = dft.run(request);

            //generate the response
            XmlSchemaEncoder schemaEncoder = null;
            switch(ver) {
            case V_10:
                schemaEncoder = new XmlSchemaEncoder.V10(geoServer);
                break;
            case V_11:
                schemaEncoder = new XmlSchemaEncoder.V11(geoServer);
                break;
            case V_20:
            default:
                schemaEncoder = new XmlSchemaEncoder.V20(geoServer);
            }

            //build a "dummy" operation descriptor and call the encoder
            Operation op = new Operation("DescribeFeatureType", new Service("WFS",null,null,null),
                null, new Object[]{request.getAdaptee()});
            ByteArrayOutputStream bout = new ByteArrayOutputStream();
            schemaEncoder.write(featureTypes, bout, op);

            return new ByteArrayInputStream(bout.toByteArray());
        } catch (Exception e) {
            LOGGER.log(Level.WARNING, "Unable to handle DescribeFeatureType uri: " + uri, e);
        }
View Full Code Here


    public void testSingle() throws Exception {
        FeatureTypeInfo meta = getFeatureTypeInfo(CiteTestData.BASIC_POLYGONS);

        ByteArrayOutputStream output = new ByteArrayOutputStream();

        XmlSchemaEncoder response = new XmlSchemaEncoder.V11(getGeoServer());
        response.write(new FeatureTypeInfo[] { meta }, output, request());

        Element schema = ReaderUtils.parse(new StringReader(new String(output
                .toByteArray())));
        assertEquals("xsd:schema", schema.getNodeName());
View Full Code Here

        FeatureTypeInfo meta1 = getFeatureTypeInfo(CiteTestData.BASIC_POLYGONS);
        FeatureTypeInfo meta2 = getFeatureTypeInfo(CiteTestData.POLYGONS);
       
        ByteArrayOutputStream output = new ByteArrayOutputStream();

        XmlSchemaEncoder response = new XmlSchemaEncoder.V11(getGeoServer());
        response.write(new FeatureTypeInfo[] { meta1, meta2 }, output, request());

        Element schema = ReaderUtils.parse(new StringReader(new String(output
                .toByteArray())));
        assertEquals("xsd:schema", schema.getNodeName());
View Full Code Here

        SimpleFeatureType featureType = (SimpleFeatureType) features.getSchema();
       
        FeatureCollectionType fc = WfsFactory.eINSTANCE.createFeatureCollectionType();
        fc.getFeature().add( features );
       
        Encoder e = new Encoder( new WFSConfiguration() );
        e.getNamespaces().declarePrefix( "feature", featureType.getName().getNamespaceURI() );
        e.encode( fc, WFS.FeatureCollection, handler );
    }
View Full Code Here

                + "      <ows:Identifier>result</ows:Identifier>\n"
                + "    </wps:RawDataOutput>\n" + "  </wps:ResponseForm>\n" + "</wps:Execute>";

        MockHttpServletResponse response = postAsServletResponse(root(), xml);

        Parser p = new Parser(new WFSConfiguration());
        FeatureCollectionType fct = (FeatureCollectionType) p.parse(new ByteArrayInputStream(
                response.getOutputStreamContent().getBytes()));
        FeatureCollection fc = (FeatureCollection) fct.getFeature().get(0);

        assertEquals(36, fc.size());
View Full Code Here

                + "<ows:Identifier>result</ows:Identifier>"
                + "</wps:RawDataOutput>" + "</wps:ResponseForm>" + "</wps:Execute>";

        MockHttpServletResponse response = postAsServletResponse(root(), xml);

        Parser p = new Parser(new WFSConfiguration());
        FeatureCollectionType fct = (FeatureCollectionType) p.parse(new ByteArrayInputStream(
                response.getOutputStreamContent().getBytes()));
        FeatureCollection fc = (FeatureCollection) fct.getFeature().get(0);

        assertEquals(1, fc.size());
View Full Code Here

    }
   
    public static class WFS10 extends WFSPPIO {
       
        public WFS10() {
            super(new WFSConfiguration(), "text/xml; subtype=wfs-collection/1.0",
                    org.geoserver.wfs.xml.v1_0_0.WFS.FEATURECOLLECTION);
        }
View Full Code Here

     * A WFS 1.0 PPIO using alternate MIME type without a ";" that creates troubles in KVP parsing
     */
    public static class WFS10Alternate extends WFSPPIO {
       
        public WFS10Alternate() {
            super(new WFSConfiguration(), "application/wfs-collection-1.0",
                    org.geoserver.wfs.xml.v1_0_0.WFS.FEATURECOLLECTION);
        }
View Full Code Here

                + "</wps:RawDataOutput>"
                + "</wps:ResponseForm>" + "</wps:Execute>";

        MockHttpServletResponse response = postAsServletResponse(root(), xml);

        Parser p = new Parser(new WFSConfiguration());
        FeatureCollectionType fct = (FeatureCollectionType) p.parse(new ByteArrayInputStream(
                response.getOutputStreamContent().getBytes()));
        FeatureCollection fc = (FeatureCollection) fct.getFeature().get(0);

        assertEquals(1, fc.size());
View Full Code Here

    }
   
    public static class WFS10 extends WFSPPIO {
       
        public WFS10() {
            super(new WFSConfiguration(), "text/xml; subtype=wfs-collection/1.0",
                    org.geoserver.wfs.xml.v1_0_0.WFS.FEATURECOLLECTION);
        }
View Full Code Here

TOP

Related Classes of org.geoserver.wfs.xml.v1_1_0.WFSConfiguration

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.