Package net.opengis.wfs

Examples of net.opengis.wfs.DescribeFeatureTypeType


        assertEquals("1.2.3", data.getOwsVersion());
    }
   
    @Test
    public void testWFSDescribeFeatureType() throws Exception {
        DescribeFeatureTypeType dft = WfsFactory.eINSTANCE.createDescribeFeatureTypeType();
        dft.getTypeName().add(new QName("http://acme.org", "foo", "acme"));
        dft.getTypeName().add(new QName("http://acme.org", "bar", "acme"));
       
        Operation op = op("DescribeFeatureType", "WFS", "1.0.0", dft);
        callback.operationDispatched(new Request(), op);
       
        assertEquals("acme:foo", data.getLayers().get(0));
View Full Code Here


        if (caps != null) {
            caps.setNamespace(workspace.getName());
            return;
        }
       
        DescribeFeatureTypeType dft =
            (DescribeFeatureTypeType) OwsUtils.parameter(operation.getParameters(), DescribeFeatureTypeType.class);
        if (dft != null) {
            qualifyTypeNames(dft.getTypeName(), workspace, ns);
            return;
        }
       
        GetFeatureType gf =
            (GetFeatureType) OwsUtils.parameter(operation.getParameters(), GetFeatureType.class);
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");
            }
        }

        // did the user supply alternate namespace prefixes?
        NamespaceSupport namespaces = null;
        if (kvp.containsKey("NAMESPACE")) {
            if (kvp.get("NAMESPACE") instanceof NamespaceSupport) {
                namespaces = (NamespaceSupport) kvp.get("namespace");
            } else {
                LOGGER.warning("There's a namespace parameter but it seems it wasn't parsed to a "
                        + NamespaceSupport.class.getName() + ": " + kvp.get("namespace"));
            }
        }
        if (namespaces != null) {
            List<QName> typeNames = describeFeatureType.getTypeName();
            List<QName> newList = new ArrayList<QName>(typeNames.size());
            for(QName name : typeNames){
                String localPart = name.getLocalPart();
                String prefix = name.getPrefix();
                String namespaceURI = name.getNamespaceURI();
                if (XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) {
                    //no prefix specified, did the request specify a default namespace?
                    namespaceURI = namespaces.getURI(XMLConstants.DEFAULT_NS_PREFIX);
                } else if (XMLConstants.NULL_NS_URI.equals(namespaceURI)) {
                    //prefix specified, does a namespace mapping were declared for it?
                    if(namespaces.getURI(prefix) != null){
                        namespaceURI = namespaces.getURI(prefix);
                    }
                }
                if(catalog.getNamespaceByURI(namespaceURI) != null){
                    prefix = catalog.getNamespaceByURI(namespaceURI).getPrefix();
                }
                newList.add(new QName(namespaceURI, localPart, prefix));
            }
            describeFeatureType.getTypeName().clear();
            describeFeatureType.getTypeName().addAll(newList);
        }
        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

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

        //&lt;xsd:element maxOccurs="unbounded" minOccurs="0"
        //   name="TypeName" type="xsd:QName"&gt;
        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"&gt;
        if (node.hasAttribute("outputFormat")) {
            describeFeatureType.setOutputFormat((String) node.getAttributeValue("outputFormat"));
        }

        return describeFeatureType;
    }
View Full Code Here

public class DescribeFeatureResponseTest extends WFSTestSupport {

    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

        assertEquals("1.2.3", data.getOwsVersion());
    }
   
    @Test
    public void testWFSDescribeFeatureType() throws Exception {
        DescribeFeatureTypeType dft = WfsFactory.eINSTANCE.createDescribeFeatureTypeType();
        dft.getTypeName().add(new QName("http://acme.org", "foo", "acme"));
        dft.getTypeName().add(new QName("http://acme.org", "bar", "acme"));
       
        Operation op = op("DescribeFeatureType", "WFS", "1.0.0", dft);
        callback.operationDispatched(new Request(), op);
       
        assertEquals("acme:foo", data.getResources().get(0));
View Full Code Here

    protected void write(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
        Operation describeFeatureType) throws IOException {
       
        GeoServerInfo global = gs.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

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

        //&lt;xsd:element maxOccurs="unbounded" minOccurs="0"
        //   name="TypeName" type="xsd:QName"&gt;
        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"&gt;
        if (node.hasAttribute("outputFormat")) {
            describeFeatureType.setOutputFormat((String) node.getAttributeValue("outputFormat"));
        }

        return describeFeatureType;
    }
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

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.