Package org.vfny.geoserver.wfs.requests

Examples of org.vfny.geoserver.wfs.requests.DeleteRequest


                    // could we catch this during the handler, rather than during execution?
                    throw new ServiceException(
                        "Transaction Delete support is not enabled");
                }
               
                DeleteRequest delete = (DeleteRequest) element;
               
                //do a check for Filter.NONE, the spec specifically does not
                // allow this
                if (delete.getFilter() == Filter.NONE) {
                  throw new ServiceException(
                  "Filter must be supplied for Transaction Delete"
                  );
                }
               
                LOGGER.finer( "Transaction Delete:"+element );
                try {
                    Filter filter = delete.getFilter();

                    Envelope damaged = store.getBounds(new DefaultQuery(
                                delete.getTypeName(), filter));

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


            throw new WfsException("Filter size does not match"
                + " feature types.  Filter size: " + filterSize
                + " Feature size: " + featureSize);
        } else if (filterSize == featureSize) {
            for (int i = 0, n = featureSize; i < n; i++) {
                DeleteRequest childRequest = new DeleteRequest();
                childRequest.setTypeName((String) typeList.get(i));
                childRequest.setFilter((Filter) filterList.get(i));
                childRequest.setReleaseAll(releaseAll);
                parentRequest.addSubRequest(childRequest);
            }
        } else if (filterSize == 0) {
            String message = "No filter found.  If you are sure you want to "
                + "wipe out your database, then use a filter that is always true"
View Full Code Here

            + "REQUEST=TRANSACTION&" + "OPERATION=delete&" + "TYPENAME=rail&"
            + "featureID=123";

        // make base comparison objects       
        TransactionRequest baseRequest = new TransactionRequest();
        DeleteRequest internalRequest = new DeleteRequest();
        internalRequest.setTypeName("rail");

        FidFilter filter = factory.createFidFilter("123");
        internalRequest.setFilter(filter);
        baseRequest.addSubRequest(internalRequest);

        // run test      
        assertTrue(runKvpTest(baseRequest, testRequest, true));
    }
View Full Code Here

            + "FILTER=(<Filter xmlns:gml='http://www.opengis.net/gml'><Within><PropertyName>location</PropertyName><gml:Box><gml:coordinates>10,10 20,20</gml:coordinates></gml:Box></Within></Filter>)(<Filter xmlns:gml='http://www.opengis.net/gml'><Within><PropertyName>location</PropertyName><gml:Box><gml:coordinates>10,10 20,20</gml:coordinates></gml:Box></Within></Filter>)";

        TransactionRequest baseRequest = new TransactionRequest();
        baseRequest.setVersion("1.0.0");

        DeleteRequest internalRequest1 = new DeleteRequest();
        internalRequest1.setTypeName("rail");

        //baseRequest.setReleaseAction(true);
        // make base comparison objects
        GeometryFilter filter = factory.createGeometryFilter(AbstractFilter.GEOMETRY_WITHIN);
        AttributeExpression leftExpression = factory.createAttributeExpression((AttributeType)null);
        leftExpression.setAttributePath("location");

        // Creates coordinates for the linear ring
        Coordinate[] coords = new Coordinate[5];
        coords[0] = new Coordinate(10, 10);
        coords[1] = new Coordinate(10, 20);
        coords[2] = new Coordinate(20, 20);
        coords[3] = new Coordinate(20, 10);
        coords[4] = new Coordinate(10, 10);

        LinearRing outerShell = new LinearRing(coords, new PrecisionModel(), 0);
        Polygon polygon = new Polygon(outerShell, new PrecisionModel(), 0);
        LiteralExpression rightExpression = factory.createLiteralExpression(polygon);
        filter.addLeftGeometry(leftExpression);
        filter.addRightGeometry(rightExpression);

        internalRequest1.setFilter(filter);

        DeleteRequest internalRequest2 = new DeleteRequest();
        internalRequest2.setTypeName("roads");
        internalRequest2.setFilter(filter);

        baseRequest.addSubRequest(internalRequest1);
        baseRequest.addSubRequest(internalRequest2);

        // run test      
View Full Code Here

            + "BBOX=10,10,20,20";

        TransactionRequest baseRequest = new TransactionRequest();
        baseRequest.setVersion("1.0.0");

        DeleteRequest internalRequest1 = new DeleteRequest();
        internalRequest1.setTypeName("rail");

        // make base comparison objects
        GeometryFilter filter = factory.createGeometryFilter(AbstractFilter.GEOMETRY_BBOX);

        // Creates coordinates for the linear ring
        Coordinate[] coords = new Coordinate[5];
        coords[0] = new Coordinate(10, 10);
        coords[1] = new Coordinate(10, 20);
        coords[2] = new Coordinate(20, 20);
        coords[3] = new Coordinate(20, 10);
        coords[4] = new Coordinate(10, 10);

        LinearRing outerShell = new LinearRing(coords, new PrecisionModel(), 0);
        Polygon polygon = new Polygon(outerShell, new PrecisionModel(), 0);
        LiteralExpression rightExpression = factory.createLiteralExpression(polygon);
        filter.addRightGeometry(rightExpression);

        internalRequest1.setFilter(filter);
        baseRequest.addSubRequest(internalRequest1);

        // run test      
        assertTrue(runKvpTest(baseRequest, testRequest, true));
    }
View Full Code Here

        assertTrue(runKvpTest(baseRequest, testRequest, true));
    }

    public void testXml1() throws Exception {
        // make base comparison objects       
        DeleteRequest delete = new DeleteRequest();
        delete.setFilter(factory.createFidFilter("123"));

        TransactionRequest baseRequest = new TransactionRequest();
        baseRequest.addSubRequest(delete);

        // run test      
View Full Code Here

        assertTrue(runXmlTest(baseRequest, "22", true));
    }

    public void testXml2() throws Exception {
        // make base comparison objects       
        DeleteRequest delete = new DeleteRequest();
        FidFilter tempFilter = factory.createFidFilter("123");
        tempFilter.addFid("124");
        tempFilter.addFid("1023");
        tempFilter.addFid("16");
        tempFilter.addFid("5001");
        delete.setFilter(tempFilter);

        TransactionRequest baseRequest = new TransactionRequest();
        baseRequest.addSubRequest(delete);

        // run test      
View Full Code Here

    /*  Need updated geotools jar...big fix takes care of this problem
       The fix is in cvs right now, hopefully release will come soon. */
    public void testXml3() throws Exception {
        // make base comparison objects
        DeleteRequest delete1 = new DeleteRequest();
        FidFilter temp1 = factory.createFidFilter("123");
        temp1.addFid("124");
        delete1.setFilter(temp1);

        DeleteRequest delete2 = new DeleteRequest();
        FidFilter temp2 = factory.createFidFilter("1023");
        temp2.addFid("16");
        delete2.setFilter(temp2);

        DeleteRequest delete3 = new DeleteRequest();
        delete3.setFilter(factory.createFidFilter("5001"));

        TransactionRequest baseRequest = new TransactionRequest();
        baseRequest.addSubRequest(delete1);
        baseRequest.addSubRequest(delete2);
        baseRequest.addSubRequest(delete3);
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.wfs.requests.DeleteRequest

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.