Package net.opengis.wfs

Examples of net.opengis.wfs.DescribeFeatureTypeType


     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        DescribeFeatureTypeType describeFeatureType = wfsfactory
            .createDescribeFeatureTypeType();

        //<xsd:element maxOccurs="unbounded" minOccurs="0"
        //   name="TypeName" type="xsd:QName">
        describeFeatureType.getTypeName().addAll(node.getChildValues(QName.class));

        //lt;xsd:attribute default="text/xml; subtype=gml/3.1.1"
        //   name="outputFormat" type="xsd:string" use="optional">
        if (node.hasAttribute("outputFormat")) {
            describeFeatureType.setOutputFormat((String) node.getAttributeValue("outputFormat"));
        }

        return describeFeatureType;
    }
View Full Code Here


    protected void write(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
        Operation describeFeatureType) throws IOException {
       
        GeoServerInfo global = wfs.getGeoServer().getGlobal();
        //create the schema
        DescribeFeatureTypeType req = (DescribeFeatureTypeType)describeFeatureType.getParameters()[0];
        XSDSchema schema = schemaBuilder.build(featureTypeInfos, req.getBaseUrl());

        //serialize
        schema.updateElement();
        final String encoding = global.getCharset();
        XSDResourceImpl.serialize(output, schema.getElement(), encoding);
View Full Code Here

    public void write(Object value, OutputStream output,
            Operation describeFeatureType) throws IOException {
        VersionedDescribeResults results = (VersionedDescribeResults) value;

        // create the schema
        DescribeFeatureTypeType req = (DescribeFeatureTypeType) describeFeatureType
                .getParameters()[0];
        FeatureTypeSchemaBuilder builder = null;
        if (results.isVersioned()) {
            builder = new VersionedSchemaBuilder(wfs.getGeoServer(), configuration);
        } else {
            builder = new FeatureTypeSchemaBuilder.GML3(wfs.getGeoServer());
        }

        XSDSchema schema = builder.build(results.getFeatureTypeInfo(), req.getBaseUrl());

        // serialize
        schema.updateElement();
        XSDResourceImpl.serialize(output, schema.getElement());
    }
View Full Code Here

        return new OneTimeTestSetup(new DescribeFeatureResponseTest());
    }

    Operation request() {
        Service service = getServiceDescriptor10();
        DescribeFeatureTypeType type = WfsFactory.eINSTANCE.createDescribeFeatureTypeType();
        type.setBaseUrl("http://localhost:8080/geoserver");
       
        Operation request = new Operation("wfs", service, null, new Object[] { type });
        return request;
    }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        DescribeFeatureTypeType describeFeatureType = wfsfactory
            .createDescribeFeatureTypeType();

        WFSBindingUtils.service(describeFeatureType, node);
        WFSBindingUtils.version(describeFeatureType, node);
        WFSBindingUtils.outputFormat(describeFeatureType, node, "XMLSCHEMA");

        describeFeatureType.getTypeName().addAll(node.getChildValues(QName.class));

        return describeFeatureType;
    }
View Full Code Here

        //let super do its thing
        request = super.read(request, kvp, rawKvp);

        //do an additional check for outputFormat, because the default
        // in wfs 1.1 is not the default for wfs 1.0
        DescribeFeatureTypeType describeFeatureType = (DescribeFeatureTypeType) request;

        if (!describeFeatureType.isSetOutputFormat()) {
            if (describeFeatureType.getVersion().startsWith("1.1")) {
                //set 1.1 default
                describeFeatureType.setOutputFormat("text/xml; subtype=gml/3.1.1");
            } else {
                //set 1.0 default
                describeFeatureType.setOutputFormat("XMLSCHEMA");
            }
        }

        return request;
    }
View Full Code Here

    public void write(Object value, OutputStream output,
            Operation describeFeatureType) throws IOException {
        VersionedDescribeResults results = (VersionedDescribeResults) value;

        // create the schema
        DescribeFeatureTypeType req = (DescribeFeatureTypeType) describeFeatureType
                .getParameters()[0];
        FeatureTypeSchemaBuilder builder = null;
        if (results.isVersioned()) {
            builder = new VersionedSchemaBuilder(wfs.getGeoServer(), configuration);
        } else {
            builder = new FeatureTypeSchemaBuilder.GML3(wfs.getGeoServer());
        }

        XSDSchema schema = builder.build(results.getFeatureTypeInfo(), req.getBaseUrl());

        // serialize
        schema.updateElement();
        XSDResourceImpl.serialize(output, schema.getElement());
    }
View Full Code Here

    public DescribeFeatureTypeTypeBindingTest() {
        super(WFS.DescribeFeatureTypeType, DescribeFeatureTypeType.class, Binding.BEFORE);
    }

    public void testEncode() throws Exception {
        final DescribeFeatureTypeType dft = factory.createDescribeFeatureTypeType();
        // set BaseRequestType propertyes (DescribeFeatureType extends
        // BaseRequestType)
        dft.setService("WFS");
        dft.setVersion("1.1.0");
        dft.setHandle("bar");

        // set DescribeFeatureType properties
        dft.setOutputFormat("foo");

        final QName name1 = new QName("http://www.geotools.org/test", "Type1");
        final QName name2 = new QName("http://www.geotools.org/test", "Type2");
        dft.getTypeName().add(name1);
        dft.getTypeName().add(name2);

        final Document dom = encode(dft, WFS.DescribeFeatureType);
        final Element root = dom.getDocumentElement();

        assertEquals("WFS", root.getAttribute("service"));
View Full Code Here

        final Object parsed = parse(WFS.DescribeFeatureType);
        assertNotNull(parsed);
        assertTrue(parsed instanceof DescribeFeatureTypeType);

        DescribeFeatureTypeType dft = (DescribeFeatureTypeType) parsed;
        assertEquals("1.1.0", dft.getVersion());
        assertEquals("fooHandle", dft.getHandle());
        assertEquals("WFS", dft.getService());

        assertEquals("fooFormat", dft.getOutputFormat());
        assertEquals(2, dft.getTypeName().size());

        QName name = new QName("http://www.openplans.org/topp", "states");
        assertEquals(name, dft.getTypeName().get(0));
        name = new QName("http://www.geotools.org/test", "sampleType");
        assertEquals(name, dft.getTypeName().get(1));
    }
View Full Code Here

    protected DescribeFeatureTypeType createDescribeFeatureTypeRequestPost(
            DescribeFeatureTypeRequest request) {

        final WfsFactory factory = WfsFactory.eINSTANCE;

        DescribeFeatureTypeType dft = factory.createDescribeFeatureTypeType();

        Version version = getServiceVersion();
        dft.setService("WFS");
        dft.setVersion(version.toString());
        dft.setHandle(request.getHandle());

        if (Versions.v1_0_0.equals(version)) {
            dft.setOutputFormat(null);
        }

        QName typeName = request.getTypeName();
        @SuppressWarnings("unchecked")
        List<QName> typeNames = dft.getTypeName();
        typeNames.add(typeName);

        return dft;
    }
View Full Code Here

TOP

Related Classes of net.opengis.wfs.DescribeFeatureTypeType

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.