Package net.opengis.wfs

Examples of net.opengis.wfs.InsertResultsType


        String baseUrl = buildSchemaURL(req.getBaseUrl(), "wfs/1.0.0/WFS-transaction.xsd");

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

        InsertResultsType insertResults = response.getInsertResults();

        //JD: make sure we group insert results by handle, this is wfs 1.0 cite
        // thing that conflicts with wfs 1.1 cite, i am pretty sure its just a
        // problem with the 1.0 tests
        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))) {
View Full Code Here


     * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
     * @generated
     */
  public NotificationChain basicSetInsertResults(InsertResultsType newInsertResults, NotificationChain msgs) {
        InsertResultsType oldInsertResults = insertResults;
        insertResults = newInsertResults;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, WfsPackage.TRANSACTION_RESPONSE_TYPE__INSERT_RESULTS, oldInsertResults, newInsertResults);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
View Full Code Here

        assertNotNull(parsed);
        assertTrue(parsed.getClass().getName(), parsed instanceof TransactionResponseType);
       
        TransactionResponseType response = (TransactionResponseType) parsed;
       
        InsertResultsType insert = response.getInsertResults();
       
        assertEquals(0, insert.getFeature().size());
       
        parsed = parser.parse(getClass().getResourceAsStream("transactionResponse2.xml"));

        assertNotNull(parsed);
        assertTrue(parsed.getClass().getName(), parsed instanceof TransactionResponseType);
       
        response = (TransactionResponseType) parsed;
       
        insert = response.getInsertResults();
       
        assertEquals(2, insert.getFeature().size());
        assertEquals("fid1", ((InsertedFeatureType) insert.getFeature().get(0)).getFeatureId().get(0).toString());
        assertEquals("fid2", ((InsertedFeatureType) insert.getFeature().get(1)).getFeatureId().get(0).toString());
    }
View Full Code Here

            action.setLocator("actionLocator");
            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);
        final Element root = dom.getDocumentElement();
View Full Code Here

                assertEquals("errorCode", action2.getCode());
                assertEquals("failure", action2.getMessage());
            }
        }
        {
            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

            response.dispose();
        }

        if (parsed instanceof TransactionResponseType) {
            TransactionResponseType tr = (TransactionResponseType) parsed;
            InsertResultsType insertResults = tr.getInsertResults();
            if (insertResults != null) {
                @SuppressWarnings("unchecked")
                List<InsertedFeatureType> inserted = insertResults.getFeature();
                for (InsertedFeatureType i : inserted) {
                    @SuppressWarnings("unchecked")
                    List<FeatureId> featureIds = i.getFeatureId();
                    if (null != featureIds) {
                        this.inserted.addAll(featureIds);
View Full Code Here

        return InsertResultsType.class;
    }
   
    public Object parse(ElementInstance instance, Node node, Object value) throws Exception{
       
        InsertResultsType resultType = (InsertResultsType) super.parse(instance, node, value);
       
        //remove 'none'
        Iterator it = resultType.getFeature().iterator();
        while (it.hasNext()) {
              EList fids = ((InsertedFeatureType)it.next()).getFeatureId();
              if (fids.size() == 1 && "none".equals(fids.get(0).toString())){
                  it.remove();
              }
View Full Code Here

        assertNotNull(parsed);
        assertTrue(parsed.getClass().getName(), parsed instanceof TransactionResponseType);
       
        TransactionResponseType response = (TransactionResponseType) parsed;
       
        InsertResultsType insert = response.getInsertResults();
       
        assertEquals(0, insert.getFeature().size());
       
        parsed = parser.parse(getClass().getResourceAsStream("transactionResponse2.xml"));

        assertNotNull(parsed);
        assertTrue(parsed.getClass().getName(), parsed instanceof TransactionResponseType);
       
        response = (TransactionResponseType) parsed;
       
        insert = response.getInsertResults();
       
        assertEquals(2, insert.getFeature().size());
        assertEquals("fid1", ((InsertedFeatureType) insert.getFeature().get(0)).getFeatureId().get(0).toString());
        assertEquals("fid2", ((InsertedFeatureType) insert.getFeature().get(1)).getFeatureId().get(0).toString());
    }
View Full Code Here

        return InsertResultsType.class;
    }
   
    public Object parse(ElementInstance instance, Node node, Object value){
       
        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

       
    @Override
    public Element encode(Object object, Document document, Element value) throws Exception {
        Element e = super.encode(object, document, value);
       
        InsertResultsType resultType = (InsertResultsType) object;
       
        Iterator it = resultType.getFeature().iterator();
        while (it.hasNext()) {
              Iterator fidit = ((InsertedFeatureType)it.next()).getFeatureId().iterator();
              while (fidit.hasNext()) {
                 Element node = document.createElementNS(OGC.NAMESPACE, "FeatureId");
                 node.setAttribute("fid", fidit.next().toString());
View Full Code Here

TOP

Related Classes of net.opengis.wfs.InsertResultsType

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.