Package net.opengis.wfs

Examples of net.opengis.wfs.DeleteElementType


     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        DeleteElementType deleteElement = wfsfactory.createDeleteElementType();

        //<xsd:element maxOccurs="1" minOccurs="1" ref="ogc:Filter">
        deleteElement.setFilter((Filter) node.getChildValue(Filter.class));

        //<xsd:attribute name="handle" type="xsd:string" use="optional"/>
        if (node.hasAttribute("handle")) {
            deleteElement.setHandle((String) node.getAttributeValue("handle"));
        }

        //<xsd:attribute name="typeName" type="xsd:QName" use="required"/>
        deleteElement.setTypeName((QName) node.getAttributeValue(QName.class));

        return deleteElement;
    }
View Full Code Here


                    }
                }

                it = tx.getDelete().iterator();
                while (it.hasNext()){
                    DeleteElementType det = (DeleteElementType)it.next();
                    qnames.add(det.getTypeName().getLocalPart());
                }

                it = tx.getUpdate().iterator();
                while (it.hasNext()){
                    UpdateElementType uet = (UpdateElementType)it.next();
View Full Code Here

     *
     * @generated modifiable
     */
    public Object parse(ElementInstance instance, Node node, Object value)
        throws Exception {
        DeleteElementType deleteElement = wfsfactory.createDeleteElementType();

        //<xsd:element maxOccurs="1" minOccurs="1" ref="ogc:Filter">
        deleteElement.setFilter((Filter) node.getChildValue(Filter.class));

        //<xsd:attribute name="handle" type="xsd:string" use="optional"/>
        if (node.hasAttribute("handle")) {
            deleteElement.setHandle((String) node.getAttributeValue("handle"));
        }

        //<xsd:attribute name="typeName" type="xsd:QName" use="required"/>
        deleteElement.setTypeName((QName) node.getAttributeValue(QName.class));

        return deleteElement;
    }
View Full Code Here

        if (!wfs.getServiceLevel().getOps().contains(WFSInfo.Operation.TRANSACTION_DELETE)) {
            throw new WFSException("Transaction Delete support is not enabled");
        }

        // check that a filter was specified
        DeleteElementType delete = (DeleteElementType) element;

        if ((delete.getFilter() == null) || Filter.INCLUDE.equals(delete.getFilter())) {
            throw new WFSTransactionException("Must specify filter for delete",
                "MissingParameterValue");
        }
    }
View Full Code Here

    }

    public void execute(EObject element, TransactionType request, Map featureStores,
        TransactionResponseType response, TransactionListener listener)
        throws WFSTransactionException {
        DeleteElementType delete = (DeleteElementType) element;
        QName elementName = delete.getTypeName();
        String handle = delete.getHandle();
        long deleted = response.getTransactionSummary().getTotalDeleted().longValue();

        FeatureStore<SimpleFeatureType, SimpleFeature> store;
        store = (FeatureStore<SimpleFeatureType, SimpleFeature>) featureStores.get(elementName);

        if (store == null) {
            throw new WFSException("Could not locate FeatureStore for '" + elementName + "'");
        }

        String typeName = store.getSchema().getTypeName();
        LOGGER.finer("Transaction Delete:" + element);

        try {
            Filter filter = (Filter) delete.getFilter();
           
            // make sure all geometric elements in the filter have a crs, and that the filter
            // is reprojected to store's native crs as well
            CoordinateReferenceSystem declaredCRS = WFSReprojectionUtil.getDeclaredCrs(
                    store.getSchema(), request.getVersion());
            filter = WFSReprojectionUtil.normalizeFilterCRS(filter, store.getSchema(), declaredCRS);
           
            // notify listeners
            TransactionEvent event = new TransactionEvent(TransactionEventType.PRE_DELETE,
                    elementName, store.getFeatures(filter));
            event.setSource( delete );
            listener.dataStoreChange( event );

            // compute damaged area
            Envelope damaged = store.getBounds(new DefaultQuery(
                        delete.getTypeName().getLocalPart(), filter));

            if (damaged == null) {
                damaged = store.getFeatures(filter).getBounds();
            }
View Full Code Here

        if (insert.getFeature().size() > 0) {
            transaction.getInsert().add(insert);
        }

        if (deletedIds.size() > 0) {
            final DeleteElementType delete = WfsFactory.eINSTANCE.createDeleteElementType();
            delete.setFilter(filterFactory.id(deletedIds));
            delete.setTypeName(typeName);
            transaction.getDelete().add(delete);
        }
    }
View Full Code Here

    }
   
    @Override
    public void testEncode() throws Exception {
       
        final DeleteElementType delete = factory.createDeleteElementType();
        final QName typeName = new QName("http://www.openplans.org/topp", "TestType", "topp");
        {
            delete.setHandle("testHandle");
            delete.setTypeName(typeName);
            Id id = filterFac.id(Collections.singleton(filterFac.featureId("fid1")));
            delete.setFilter(id);
        }
        final Document dom = encode(delete, WFS.Delete);
        final Element root = dom.getDocumentElement();
        assertName(WFS.Delete, root);
       
View Full Code Here

        final URL resource = TestData.getResource(this, "DeleteElementTypeBindingTest.xml");
        buildDocument(resource);

        Object parsed = parse(WFS.Delete);
        assertTrue(parsed instanceof DeleteElementType);
        DeleteElementType delete = (DeleteElementType) parsed;
        assertEquals("deleteHandle", delete.getHandle());
        assertEquals(new QName("http://www.openplans.org/topp", "TestType"), delete.getTypeName());
        Filter filter = delete.getFilter();
        assertTrue(filter instanceof Id);
        // done, checking the filter is not this module's responsibility
    }
View Full Code Here

                    inserts.add(insert);
                } else if (elem instanceof TransactionRequest.Update) {
                    UpdateElementType update = createUpdate(factory, (Update) elem);
                    updates.add(update);
                } else if (elem instanceof TransactionRequest.Delete) {
                    DeleteElementType delete = createDelete(factory, (Delete) elem);
                    deletes.add(delete);
                }
            }
        } catch (IOException e) {
            throw e;
View Full Code Here

        return update;
    }

    protected DeleteElementType createDelete(WfsFactory factory, Delete elem) throws Exception {
        DeleteElementType delete = factory.createDeleteElementType();

        QName typeName = elem.getTypeName();
        delete.setTypeName(typeName);
        Filter filter = elem.getFilter();
        delete.setFilter(filter);

        return delete;
    }
View Full Code Here

TOP

Related Classes of net.opengis.wfs.DeleteElementType

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.