Package net.opengis.wfs

Examples of net.opengis.wfs.TransactionType


        }

        Encoder encoder = new Encoder(configuration, configuration.schema());
        encoder.setEncoding(Charset.forName( getInfo().getGeoServer().getGlobal().getCharset()) );

        TransactionType req = (TransactionType)operation.getParameters()[0];
       
        encoder.setSchemaLocation(org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE,
                buildSchemaURL(req.getBaseUrl(), "wfs/1.1.0/wfs.xsd"));
        encoder.encode(response, org.geoserver.wfs.xml.v1_1_0.WFS.TRANSACTIONRESPONSE, output);
      
    }
View Full Code Here


                lock.setTypeName(qualifyTypeName(lock.getTypeName(), workspace, ns));
            }
            return;
        }
       
        TransactionType t =
            (TransactionType) OwsUtils.parameter(operation.getParameters(), TransactionType.class);
        if (t != null) {
            for (Iterator i = t.getUpdate().iterator(); i.hasNext(); ) {
                UpdateElementType up = (UpdateElementType) i.next();
                up.setTypeName(qualifyTypeName(up.getTypeName(), workspace, ns));
            }
            for (Iterator i = t.getDelete().iterator(); i.hasNext(); ) {
                DeleteElementType del = (DeleteElementType) i.next();
                del.setTypeName(qualifyTypeName(del.getTypeName(), workspace, ns));
            }
            for (Iterator i = t.getInsert().iterator(); i.hasNext();) {
                InsertElementType in = (InsertElementType) i.next();
               
                //in the insert case the objects are gt feature types which are not mutable
                // so we just check them and throw an exception if a name does not match
                for (Iterator j = in.getFeature().iterator(); j.hasNext(); ) {
View Full Code Here

        writer.write(indent + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
        writer.write(indent);
        writer.write("xsi:schemaLocation=\"http://www.opengis.net/wfs ");

        TransactionType req = (TransactionType)operation.getParameters()[0];
        String baseUrl = buildSchemaURL(req.getBaseUrl(), "wfs/1.0.0/WFS-transaction.xsd");

        writer.write(baseUrl);
        writer.write("\">");

        InsertResultsType insertResults = response.getInsertResults();
View Full Code Here

        }

        Encoder encoder = new Encoder(configuration, configuration.schema());
        encoder.setEncoding(Charset.forName( getInfo().getGeoServer().getSettings().getCharset()) );

        TransactionType req = (TransactionType)operation.getParameters()[0];
       
        encoder.setSchemaLocation(org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE,
                buildSchemaURL(req.getBaseUrl(), "wfs/1.1.0/wfs.xsd"));
        encoder.encode(response, org.geoserver.wfs.xml.v1_1_0.WFS.TRANSACTIONRESPONSE, output);
      
    }
View Full Code Here

            if (request instanceof WFS11) {
                return (TransactionType) request.getAdaptee();
            }

            WfsFactory factory = (WfsFactory) WfsFactory.eINSTANCE;
            TransactionType tx = factory.createTransactionType();
           
            tx.setVersion(request.getVersion());
            tx.setHandle(request.getHandle());
            tx.setLockId(request.getLockId());
            tx.setReleaseAction(
                request.isReleaseActionAll() ? AllSomeType.ALL_LITERAL : AllSomeType.SOME_LITERAL);
            tx.setBaseUrl(request.getBaseUrl());
            tx.setExtendedProperties(request.getExtendedProperties());
           
            for (TransactionElement te : request.getElements()) {
                if (te instanceof Delete) {
                    tx.getDelete().add(Delete.WFS11.unadapt((Delete)te));
                }
                if (te instanceof Update) {
                    tx.getUpdate().add(Update.WFS11.unadapt((Update)te));
                }
                if (te instanceof Insert) {
                    tx.getInsert().add(Insert.WFS11.unadapt((Insert)te));
                }
                if (te instanceof Native) {
                    tx.getNative().add(Native.WFS11.unadapt((Native)te));
                }
            }
           
            return tx;
        }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        TransactionType transaction = wfsfactory.createTransactionType();

        //lock id
        if (node.hasChild("LockId")) {
            transaction.setLockId((String) node.getChildValue("LockId"));
        }

        //transactions, need to maintain order
        for (Iterator itr = node.getChildren().iterator(); itr.hasNext();) {
            Node child = (Node) itr.next();
            Object cv = child.getValue();

            if (cv instanceof InsertElementType) {
                transaction.getInsert().add(cv);
            } else if (cv instanceof UpdateElementType) {
                transaction.getUpdate().add(cv);
            } else if (cv instanceof DeleteElementType) {
                transaction.getDelete().add(cv);
            } else if (cv instanceof NativeType) {
                transaction.getNative().add(cv);
            }
        }

        //service + version
        WFSBindingUtils.service(transaction, node);
        WFSBindingUtils.version(transaction, node);

        //handle
        if (node.hasAttribute("handle")) {
            transaction.setHandle((String) node.getAttributeValue("handle"));
        }

        //release action
        if (node.hasAttribute(AllSomeType.class)) {
            transaction.setReleaseAction((AllSomeType) node.getAttributeValue(AllSomeType.class));
        }

        return transaction;
    }
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        TransactionType transaction = wfsfactory.createTransactionType();

        //<xsd:element minOccurs="0" ref="wfs:LockId">
        if (node.hasChild("LockId")) {
            transaction.setLockId((String) node.getChildValue("LockId"));
        }

        //<xsd:choice maxOccurs="unbounded" minOccurs="0">
        //  <xsd:element ref="wfs:Insert"/>
        //  <xsd:element ref="wfs:Update"/>
        //  <xsd:element ref="wfs:Delete"/>
        //  <xsd:element ref="wfs:Native"/>
        //</xsd:choice>
        for (Iterator itr = node.getChildren().iterator(); itr.hasNext();) {
            Node child = (Node) itr.next();
            Object cv = child.getValue();

            if (cv instanceof InsertElementType) {
                transaction.getInsert().add(cv);
            } else if (cv instanceof UpdateElementType) {
                transaction.getUpdate().add(cv);
            } else if (cv instanceof DeleteElementType) {
                transaction.getDelete().add(cv);
            } else if (cv instanceof NativeType) {
                transaction.getNative().add(cv);
            }
        }

        //<xsd:attribute name="releaseAction" type="wfs:AllSomeType" use="optional">
        if (node.hasAttribute(AllSomeType.class)) {
            transaction.setReleaseAction((AllSomeType) node.getAttributeValue(AllSomeType.class));
        }

        return transaction;
    }
View Full Code Here

        SimpleFeatureCollection inserted = createNiceMock(SimpleFeatureCollection.class);
        SimpleFeatureCollection updated = createNiceMock(SimpleFeatureCollection.class);
        SimpleFeatureCollection deleted = createNiceMock(SimpleFeatureCollection.class);
        replay(inserted, updated, deleted);

        TransactionType t = WfsFactory.eINSTANCE.createTransactionType();
        TransactionEvent e1 = new TransactionEvent(TransactionEventType.PRE_INSERT,
            TransactionRequest.adapt(t), PRIMITIVEGEOFEATURE, inserted);
        TransactionEvent e2 = new TransactionEvent(TransactionEventType.PRE_UPDATE,
            TransactionRequest.adapt(t), PRIMITIVEGEOFEATURE, updated);
        TransactionEvent e3 = new TransactionEvent(TransactionEventType.PRE_DELETE,
            TransactionRequest.adapt(t), PRIMITIVEGEOFEATURE, deleted);

        ScriptTransactionPlugin plugin = new ScriptTransactionPlugin(scriptMgr);
        plugin.dataStoreChange(e1);
        plugin.dataStoreChange(e2);
        plugin.dataStoreChange(e3);

        TransactionDetail detail =
            (TransactionDetail) t.getExtendedProperties().get(TransactionDetail.class);
        assertNotNull(detail);

        Multimap<QName, Entry> entries = detail.getEntries();
        assertTrue(entries.containsKey(PRIMITIVEGEOFEATURE));
View Full Code Here

        // after user has got the response
        // response = build;
    }

    void fireAfterTransaction(TransactionRequest request, TransactionResponse result, boolean committed, TransactionPlugin tp) {
        TransactionType tx = TransactionRequest.WFS11.unadapt(request);
        TransactionResponseType tr = TransactionResponse.WFS11.unadapt(result);
       
        if (tx != null && tr != null) tp.afterTransaction(tx, tr, committed);
    }
View Full Code Here

       
        if (tx != null && tr != null) tp.afterTransaction(tx, tr, committed);
    }

    void fireBeforeCommit(TransactionRequest request, TransactionPlugin tp) {
        TransactionType tx = TransactionRequest.WFS11.unadapt(request);
        if (tx != null) tp.beforeCommit(tx);
    }
View Full Code Here

TOP

Related Classes of net.opengis.wfs.TransactionType

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.