Package net.opengis.wfs20.impl

Examples of net.opengis.wfs20.impl.DescribeStoredQueriesResponseTypeImpl


   
    @Override
    public Element encode(Object object, Document document, Element value) throws Exception {
        Element e = super.encode(object, document, value);
       
        QueryExpressionTextType qe = (QueryExpressionTextType) object;
        if (!qe.isIsPrivate()) {
            //include the query text

            //this is a hack, but we need to build up a dom with namespaces without actually
            // having them decelared by the edxpression text, so we first parse the query
            // expression with a sax handler that can transform to a namespace aware dom
            // using the current namespace context
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);

            ConvertToDomHandler h = new ConvertToDomHandler(
                dbf.newDocumentBuilder().newDocument(), namespaceContext);
           
            SAXParser saxp = SAXParserFactory.newInstance().newSAXParser();
            saxp.parse(new ByteArrayInputStream(qe.getValue().getBytes()), h);
           
            Document d = h.getDocument();
            e.appendChild(document.importNode(d.getDocumentElement(), true));
        }
       
View Full Code Here


        "     ${AreaOfInterest}" +
        "   </fes:Within>" +
        "  </fes:Filter>" +
        "</wfs:Query> ";
       
        QueryExpressionTextType qet = f.createQueryExpressionTextType();
        sqd.getQueryExpressionText().add(qet);
       
        qet.setLanguage("urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression");
        qet.setReturnFeatureTypes(Arrays.asList(new QName("http://www.someserver.com/myns", "Parks")));
        qet.setValue(xml);

        Document dom = encode(sqd, WFS.StoredQueryDescription, WFS.StoredQueryDescriptionType);
        assertEquals("wfs:StoredQueryDescription", dom.getDocumentElement().getNodeName());
        assertEquals(1, dom.getElementsByTagName("wfs:QueryExpressionText").getLength());
       
View Full Code Here

    @Override
    protected void setProperty(EObject eObject, String property, Object value, boolean lax) {
        super.setProperty(eObject, property, value, lax);
        if (!lax) {
            if ("typeNames".equalsIgnoreCase(property)) {
                QueryType q = (QueryType)eObject;
               
                //turn into list of qname
                List qNames = new ArrayList();
                for (Object s : q.getTypeNames()) {
                    try {
                        qNames.add(new XSQNameBinding(namespaceContext).parse(null, s));
                    }
                    catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
                q.getTypeNames().clear();
                q.getTypeNames().addAll(qNames);
            }
        }
    }
View Full Code Here

       
        LockFeatureType lf = (LockFeatureType) parse();
        assertNotNull(lf);
       
        assertEquals(1, lf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) lf.getAbstractQueryExpression().get(0);
       
        assertTrue(q.getTypeNames().contains(new QName("http://www.someserver.com/myns", "InWaterA_1M")));
        Id f = (Id) q.getFilter();
        assertEquals(5, f.getIDs().size());
    }
View Full Code Here

       
        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
       
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);
       
        assertEquals(new URI("epsg:4326"), q.getSrsName());
        assertEquals(1, q.getTypeNames().size());
        assertEquals(
            new QName("http://www.someserver.com/myns", "InWaterA_1M"), q.getTypeNames().get(0));
       
        Id f = (Id) q.getFilter();
        assertNotNull(f);
       
        assertEquals(1, f.getIdentifiers().size());
        assertEquals("InWaterA_1M.1234", f.getIdentifiers().iterator().next().getID());
    }
View Full Code Here

        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
       
        assertEquals(BigInteger.valueOf(100), gf.getCount());
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);

        assertNotNull(q.getFilter());
        assertEquals(3, q.getPropertyNames().size());
       
        assertEquals(new QName("http://www.someserver.com/myns", "wkbGeom"), q.getPropertyNames().get(0));
        assertEquals(new QName("http://www.someserver.com/myns", "tileId"), q.getPropertyNames().get(1));
        assertEquals(new QName("http://www.someserver.com/myns", "facId"), q.getPropertyNames().get(2));
    }
View Full Code Here

        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
       
        assertEquals(3, gf.getAbstractQueryExpression().size());
       
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);
        assertEquals(new QName("http://www.someserver.com/myns", "InWaterA_1M"),
            q.getTypeNames().get(0));
       
        q = (QueryType) gf.getAbstractQueryExpression().get(1);
        assertNotNull(q);
        assertEquals(new QName("http://www.someserver.com/myns", "BuiltUpA_1M"),
            q.getTypeNames().get(0));
       
        q = (QueryType) gf.getAbstractQueryExpression().get(2);
        assertNotNull(q);
        assertEquals(new QName("http://demo.cubewerx.com/yourns", "RoadL_1M"),
            q.getTypeNames().get(0));
    }
View Full Code Here

        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
        assertEquals(ResultTypeType.HITS, gf.getResultType());
       
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);
       
        Not f = (Not) q.getFilter();
        assertNotNull(f);
       
        Disjoint d = (Disjoint) f.getFilter();
        assertNotNull(d);
       
        assertEquals(2, q.getSortBy().size());
    }
View Full Code Here

       
        assertEquals(BigInteger.valueOf(124), gf.getExpiry());
        assertEquals(AllSomeType.ALL, gf.getLockAction());
       
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);
       
        assertEquals(new URI("epsg:4326"), q.getSrsName());
        assertEquals(1, q.getTypeNames().size());
        assertEquals(
            new QName("http://www.someserver.com/myns", "InWaterA_1M"), q.getTypeNames().get(0));
       
        Id f = (Id) q.getFilter();
        assertNotNull(f);
       
        assertEquals(1, f.getIdentifiers().size());
        assertEquals("InWaterA_1M.1234", f.getIdentifiers().iterator().next().getID());
    }
View Full Code Here

       
        GetFeatureType gf = (GetFeatureType) parse();
        assertNotNull(gf);
       
        assertEquals(1, gf.getAbstractQueryExpression().size());
        QueryType q = (QueryType) gf.getAbstractQueryExpression().get(0);
        assertNotNull(q);
       
        assertEquals(2, q.getTypeNames().size());
        assertEquals(2, q.getAliases().size());
    }
View Full Code Here

TOP

Related Classes of net.opengis.wfs20.impl.DescribeStoredQueriesResponseTypeImpl

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.