Package net.opengis.wfs

Examples of net.opengis.wfs.LockFeatureType


        String indent = wfs.isVerbose() ? "   " : "";
        Charset charset = Charset.forName( wfs.getGeoServer().getGlobal().getCharset() );
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output,charset));

        LockFeatureType lft = (LockFeatureType)operation.getParameters()[0];
       
        //TODO: get rid of this hardcoding, and make a common utility to get all
        //these namespace imports, as everyone is using them, and changes should
        //go through to all the operations.
        writer.write("<?xml version=\"1.0\" encoding=\"" + charset.name() + "\"?>");
        writer.write("<WFS_LockFeatureResponse " + "\n");
        writer.write(indent + "xmlns=\"http://www.opengis.net/wfs\" " + "\n");
        writer.write(indent + "xmlns:ogc=\"http://www.opengis.net/ogc\" " + "\n");

        writer.write(indent + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "\n");
        writer.write(indent + "xsi:schemaLocation=\"http://www.opengis.net/wfs ");
        writer.write(buildSchemaURL(lft.getBaseUrl(), "wfs/1.0.0/WFS-transaction.xsd"));
        writer.write("\">" + "\n");

        writer.write(indent + "<LockId>" + lockResponse.getLockId() + "</LockId>" + "\n");

        List featuresLocked = null;
View Full Code Here


    void write1_1(LockFeatureResponseType lockResponse, OutputStream output, Operation operation)
        throws IOException {
        Encoder encoder = new Encoder(configuration, configuration.schema());
        encoder.setEncoding(Charset.forName( wfs.getGeoServer().getGlobal().getCharset()) );
       
        LockFeatureType req = (LockFeatureType)operation.getParameters()[0];
       
        encoder.setSchemaLocation(org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE,
                buildSchemaURL(req.getBaseUrl(), "schemas/wfs/1.1.0/wfs.xsd"));

        encoder.encode(lockResponse, org.geoserver.wfs.xml.v1_1_0.WFS.LOCKFEATURERESPONSE,
                output);
        output.flush();
    }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        LockFeatureType lockFeature = wfsfactory.createLockFeatureType();

        //&lt;xsd:element maxOccurs="unbounded" name="Lock" type="wfs:LockType"&gt;
        lockFeature.getLock().addAll(node.getChildValues(LockType.class));

        //&lt;xsd:attribute default="5" name="expiry"  type="xsd:positiveInteger" use="optional"&gt;
        if (node.hasAttribute("expiry")) {
            lockFeature.setExpiry((BigInteger) node.getAttributeValue("expiry"));
        } else {
            lockFeature.setExpiry(BigInteger.valueOf(5));
        }

        //&lt;xsd:attribute default="ALL" name="lockAction"
        if (node.hasAttribute("lockAction")) {
            lockFeature.setLockAction((AllSomeType) node.getAttributeValue("lockAction"));
        } else {
            lockFeature.setLockAction(AllSomeType.ALL_LITERAL);
        }

        return lockFeature;
    }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        LockFeatureType lockFeature = wfsfactory.createLockFeatureType();

        //&lt;xsd:element maxOccurs="unbounded" name="Lock" type="wfs:LockType"&gt;
        lockFeature.getLock().addAll(node.getChildValues(LockType.class));

        //&lt;xsd:attribute fixed="1.0.0" name="version" type="xsd:string" use="required"/&gt;
        //&lt;xsd:attribute fixed="WFS" name="service" type="xsd:string" use="required"/&gt;
        WFSBindingUtils.version(lockFeature, node);
        WFSBindingUtils.service(lockFeature, node);

        //&lt;xsd:attribute name="expiry" type="xsd:positiveInteger" use="optional"/&gt;
        if (node.hasAttribute("expiry")) {
            lockFeature.setExpiry(BigInteger.valueOf(
                    ((Number) node.getAttributeValue("expiry")).longValue()));
        }

        //&lt;xsd:attribute name="lockAction" type="wfs:AllSomeType" use="optional"&gt;
        if (node.hasAttribute(AllSomeType.class)) {
            lockFeature.setLockAction((AllSomeType) node.getAttributeValue(AllSomeType.class));
        }

        return lockFeature;
    }
View Full Code Here

        //locking
        String lockId = null;
        if (request instanceof GetFeatureWithLockType) {
            GetFeatureWithLockType withLockRequest = (GetFeatureWithLockType) request;

            LockFeatureType lockRequest = WfsFactory.eINSTANCE.createLockFeatureType();
            lockRequest.setExpiry(withLockRequest.getExpiry());
            lockRequest.setHandle(withLockRequest.getHandle());
            lockRequest.setLockAction(AllSomeType.ALL_LITERAL);

            for (int i = 0; i < request.getQuery().size(); i++) {
                QueryType query = (QueryType) request.getQuery().get(i);

                LockType lock = WfsFactory.eINSTANCE.createLockType();
                lock.setFilter(query.getFilter());
                lock.setHandle(query.getHandle());

                //TODO: joins?
                lock.setTypeName((QName) query.getTypeName().get(0));
                lockRequest.getLock().add(lock);
            }

            LockFeature lockFeature = new LockFeature(wfs, catalog);
            lockFeature.setFilterFactory(filterFactory);
View Full Code Here

        super(WFS.LockFeatureType, LockFeatureType.class, Binding.OVERRIDE);
    }

    @Override
    public void testEncode() throws Exception {
        LockFeatureType lockFeature = factory.createLockFeatureType();
        lockFeature.setExpiry(BigInteger.valueOf(1000));
        lockFeature.setLockAction(AllSomeType.ALL_LITERAL);
        {
            LockType lock1 = factory.createLockType();
            lock1.setTypeName(new QName(GML.NAMESPACE, "TestGmlFeature"));
            lock1.setFilter(filterFac.id(Collections.singleton(filterFac.featureId("fid1"))));
            lockFeature.getLock().add(lock1);
        }
        {
            LockType lock2 = factory.createLockType();
            lock2.setTypeName(new QName(WFS.NAMESPACE, "TestWfsFeature"));
            lock2.setFilter(filterFac.id(Collections.singleton(filterFac.featureId("fid2"))));
            lockFeature.getLock().add(lock2);
        }

        final Document dom = encode(lockFeature, WFS.LockFeature);
        final Element root = dom.getDocumentElement();
View Full Code Here

        buildDocument(resource);

        Object parsed = parse(WFS.LockFeatureType);
        assertTrue(parsed instanceof LockFeatureType);

        LockFeatureType lockFeature = (LockFeatureType) parsed;
        assertEquals(BigInteger.valueOf(1000), lockFeature.getExpiry());
        assertEquals(AllSomeType.SOME_LITERAL, lockFeature.getLockAction());

        assertEquals(1, lockFeature.getLock().size());
        LockType lock = (LockType) lockFeature.getLock().get(0);
        assertEquals(new QName(WFS.NAMESPACE, "TestTypeName"), lock.getTypeName());
        assertTrue(lock.getFilter() instanceof Id);
    }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        LockFeatureType lockFeature = wfsfactory.createLockFeatureType();

        //&lt;xsd:element maxOccurs="unbounded" name="Lock" type="wfs:LockType"&gt;
        lockFeature.getLock().addAll(node.getChildValues(LockType.class));

        //&lt;xsd:attribute fixed="1.0.0" name="version" type="xsd:string" use="required"/&gt;
        //&lt;xsd:attribute fixed="WFS" name="service" type="xsd:string" use="required"/&gt;
        WFSBindingUtils.version(lockFeature, node);
        WFSBindingUtils.service(lockFeature, node);

        //&lt;xsd:attribute name="expiry" type="xsd:positiveInteger" use="optional"/&gt;
        if (node.hasAttribute("expiry")) {
            lockFeature.setExpiry(BigInteger.valueOf(
                    ((Number) node.getAttributeValue("expiry")).longValue()));
        }

        //&lt;xsd:attribute name="lockAction" type="wfs:AllSomeType" use="optional"&gt;
        if (node.hasAttribute(AllSomeType.class)) {
            lockFeature.setLockAction((AllSomeType) node.getAttributeValue(AllSomeType.class));
        }

        return lockFeature;
    }
View Full Code Here

        assertEquals("acme:bar", data.getLayers().get(1));
    }
   
    @Test
    public void testWFSLockFeature() throws Exception {
        LockFeatureType lf = WfsFactory.eINSTANCE.createLockFeatureType();
       
        LockType l = WfsFactory.eINSTANCE.createLockType();
        l.setTypeName(new QName("http://acme.org", "foo", "acme"));
        lf.getLock().add(l);
       
        Operation op = op("LockFeature", "WFS", "1.0.0", lf);
        callback.operationDispatched(new Request(), op);
       
        assertEquals("acme:foo", data.getLayers().get(0));
View Full Code Here

        String indent = wfs.isVerbose() ? "   " : "";
        Charset charset = Charset.forName( wfs.getGeoServer().getGlobal().getCharset() );
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(output,charset));

        LockFeatureType lft = (LockFeatureType)operation.getParameters()[0];
       
        //TODO: get rid of this hardcoding, and make a common utility to get all
        //these namespace imports, as everyone is using them, and changes should
        //go through to all the operations.
        writer.write("<?xml version=\"1.0\" encoding=\"" + charset.name() + "\"?>");
        writer.write("<WFS_LockFeatureResponse " + "\n");
        writer.write(indent + "xmlns=\"http://www.opengis.net/wfs\" " + "\n");
        writer.write(indent + "xmlns:ogc=\"http://www.opengis.net/ogc\" " + "\n");

        writer.write(indent + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "\n");
        writer.write(indent + "xsi:schemaLocation=\"http://www.opengis.net/wfs ");
        writer.write(buildSchemaURL(lft.getBaseUrl(), "wfs/1.0.0/WFS-transaction.xsd"));
        writer.write("\">" + "\n");

        writer.write(indent + "<LockId>" + lockResponse.getLockId() + "</LockId>" + "\n");

        List featuresLocked = null;
View Full Code Here

TOP

Related Classes of net.opengis.wfs.LockFeatureType

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.