Package net.opengis.wfs

Examples of net.opengis.wfs.InsertedFeatureType


                }
            }

            // report back fids, we need to keep the same order the
            // fids were reported in the original feature collection
            InsertedFeatureType insertedFeature = null;

            for (Iterator f = insert.getFeature().iterator(); f.hasNext();) {
                SimpleFeature feature = (SimpleFeature) f.next();
                SimpleFeatureType schema = feature.getFeatureType();

                // get the next fid
                LinkedList fids = (LinkedList) schema2fids.get(schema.getTypeName());
                String fid = ((FeatureId) fids.removeFirst()).getID();

                insertedFeature = WfsFactory.eINSTANCE.createInsertedFeatureType();
                insertedFeature.setHandle(insert.getHandle());
                insertedFeature.getFeatureId().add(filterFactory.featureId(fid));

                response.getInsertResults().getFeature().add(insertedFeature);
            }

            // update the insert counter
View Full Code Here


        // even if no insert
        // occured, howwever insert results needs to have at least one
        // "FeatureId" eliement, sp
        // we create an FeatureId with an empty fid
        if (result.getInsertResults().getFeature().isEmpty()) {
            InsertedFeatureType insertedFeature = WfsFactory.eINSTANCE.createInsertedFeatureType();
            insertedFeature.getFeatureId().add(filterFactory.featureId("none"));

            result.getInsertResults().getFeature().add(insertedFeature);
        }

        return result;
View Full Code Here

        String lastHandle = null;
        boolean first = true;

        if (insertResults != null) {
            for (Iterator i = insertResults.getFeature().iterator(); i.hasNext();) {
                InsertedFeatureType insertedFeature = (InsertedFeatureType) i.next();
                String handle = insertedFeature.getHandle();

                if (first || ((lastHandle == null) && (handle != null))
                        || ((lastHandle != null) && (handle != null) && handle.equals(lastHandle))) {
                    if (!first) {
                        //close last one, if not the first time through
                        writer.write("</wfs:InsertResult>");
                    }

                    writer.write("<wfs:InsertResult");

                    if (insertedFeature.getHandle() != null) {
                        writer.write(" handle=\"" + insertedFeature.getHandle() + "\"");
                    }

                    writer.write(">");
                }

                for (Iterator id = insertedFeature.getFeatureId().iterator(); id.hasNext();) {
                    FeatureId featureId = (FeatureId) id.next();
                    writer.write("<ogc:FeatureId fid=\"" + featureId.toString() + "\"/>");
                }

                first = false;
View Full Code Here

                FeatureDiff fd = reader.next();

                if (fd.getState() == FeatureDiff.INSERTED) {
                    inserted++;

                    InsertedFeatureType insertedFeature = WfsFactory.eINSTANCE
                            .createInsertedFeatureType();
                    insertedFeature.setHandle(rollback.getHandle());
                    insertedFeature.getFeatureId().add(filterFactory.featureId(fd.getID()));
                    response.getInsertResults().getFeature().add(insertedFeature);
                    // accumulate fids for transaction event handling
                    insertedIds.add(filterFactory.featureId(fd.getID()));
                } else if (fd.getState() == FeatureDiff.UPDATED) {
                    updated++;
View Full Code Here

            action.setMessage("actionMessage");
            results.getAction().add(action);
            tr.setTransactionResults(results);

            InsertResultsType insertResults = factory.createInsertResultsType();
            InsertedFeatureType feature = factory.createInsertedFeatureType();
            feature.setHandle("handle1");
            feature.getFeatureId().add(filterFac.featureId("fid1"));
            feature.getFeatureId().add(filterFac.featureId("fid2"));
            insertResults.getFeature().add(feature);
            tr.setInsertResults(insertResults);
        }

        final Document dom = encode(tr, WFS.TransactionResponse);
View Full Code Here

            }
        }
        {
            InsertResultsType insertResults = tr.getInsertResults();
            assertEquals(2, insertResults.getFeature().size());
            InsertedFeatureType feature1 = (InsertedFeatureType) insertResults.getFeature().get(0);
            assertEquals("handle1", feature1.getHandle());
            assertEquals(2, feature1.getFeatureId().size());

            InsertedFeatureType feature2 = (InsertedFeatureType) insertResults.getFeature().get(1);
            assertEquals("handle2", feature2.getHandle());
            assertEquals(1, feature2.getFeatureId().size());
        }
    }
View Full Code Here

        tr.setTransactionResults(factory.createTransactionResultsType());
        tr.setInsertResults(factory.createInsertResultsType());

        if (!added.isEmpty()) {
            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
            InsertedFeatureType inserted = factory.createInsertedFeatureType();
            tr.getInsertResults().getFeature().add(inserted);
            for (String addedId : added) {
                FeatureId featureId = ff.featureId(addedId);
                inserted.getFeatureId().add(featureId);
            }
        }

        Configuration configuration = getStrategy().getWfsConfiguration();
        Encoder enc = new Encoder(configuration);
View Full Code Here

       
        InsertResultsType resultType = wfsfactory.createInsertResultsType();
       
        for (Object featureid : node.getChildValues("FeatureId")){           
            if (! "none".equals(featureid.toString())) {
                InsertedFeatureType feature = wfsfactory.createInsertedFeatureType();               
                feature.getFeatureId().add(featureid);
                resultType.getFeature().add(feature);
            }           
        }
       
        return resultType;
View Full Code Here

                }
            }

            // report back fids, we need to keep the same order the
            // fids were reported in the original feature collection
            InsertedFeatureType insertedFeature = null;

            for (Iterator f = insert.getFeature().iterator(); f.hasNext();) {
                SimpleFeature feature = (SimpleFeature) f.next();
                SimpleFeatureType schema = feature.getFeatureType();

                // get the next fid
                LinkedList fids = (LinkedList) schema2fids.get(schema.getTypeName());
                String fid = ((FeatureId) fids.removeFirst()).getID();

                insertedFeature = WfsFactory.eINSTANCE.createInsertedFeatureType();
                insertedFeature.setHandle(insert.getHandle());
                insertedFeature.getFeatureId().add(filterFactory.featureId(fid));

                response.getInsertResults().getFeature().add(insertedFeature);
            }

            // update the insert counter
View Full Code Here

        String lastHandle = null;
        boolean first = true;

        if (insertResults != null) {
            for (Iterator i = insertResults.getFeature().iterator(); i.hasNext();) {
                InsertedFeatureType insertedFeature = (InsertedFeatureType) i.next();
                String handle = insertedFeature.getHandle();

                if (first || ((lastHandle == null) && (handle != null))
                        || ((lastHandle != null) && (handle != null) && handle.equals(lastHandle))) {
                    if (!first) {
                        //close last one, if not the first time through
                        writer.write("</wfs:InsertResult>");
                    }

                    writer.write("<wfs:InsertResult");

                    if (insertedFeature.getHandle() != null) {
                        writer.write(" handle=\"" + insertedFeature.getHandle() + "\"");
                    }

                    writer.write(">");
                }

                for (Iterator id = insertedFeature.getFeatureId().iterator(); id.hasNext();) {
                    FeatureId featureId = (FeatureId) id.next();
                    writer.write("<ogc:FeatureId fid=\"" + featureId.toString() + "\"/>");
                }

                first = false;
View Full Code Here

TOP

Related Classes of net.opengis.wfs.InsertedFeatureType

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.