Package net.opengis.wfs

Examples of net.opengis.wfs.ActionType


        } catch (WFSTransactionException e) {
            exception = true;
            LOGGER.log(Level.SEVERE, "Transaction failed", e);

            // transaction failed, rollback
            ActionType action = WfsFactory.eINSTANCE.createActionType();

            if (e.getCode() != null) {
                action.setCode(e.getCode());
            } else {
                action.setCode("InvalidParameterValue");
            }

            action.setLocator(e.getLocator());
            action.setMessage(e.getMessage());
            result.getTransactionResults().getAction().add(action);
        }

        // commit
        boolean committed = false;
View Full Code Here


        }

        writer.write(indent + offset + "</wfs:Status>");

        if (!result.getAction().isEmpty()) {
            ActionType action = (ActionType) result.getAction().get(0);

            if (action.getLocator() != null) {
                writer.write(indent + offset + "<wfs:Locator>");
                writer.write(action.getLocator() + "</wfs:Locator>");
            }

            if (action.getMessage() != null) {
                writer.write(indent + offset + "<wfs:Message>");
                ResponseUtils.writeEscapedString(writer, action.getMessage());
                writer.write("</wfs:Message>");
            }
        }

        writer.write(indent + "</wfs:TransactionResult>");
View Full Code Here

    public void v_1_1(TransactionResponseType response, OutputStream output, Operation operation)
        throws IOException, ServiceException {
        if (!response.getTransactionResults().getAction().isEmpty()) {
            //since we do atomic transactions, an action failure means all we rolled back
            // spec says to throw exception
            ActionType action = (ActionType) response.getTransactionResults().getAction().iterator()
                                                     .next();
            throw new WFSException(action.getMessage(), action.getCode(), action.getLocator());
        }

        Encoder encoder = new Encoder(configuration, configuration.schema());
        encoder.setEncoding(Charset.forName( wfs.getGeoServer().getGlobal().getCharset()) );
View Full Code Here

            summary.setTotalInserted(BigInteger.valueOf(3));
            summary.setTotalUpdated(BigInteger.valueOf(4));
            tr.setTransactionSummary(summary);

            TransactionResultsType results = factory.createTransactionResultsType();
            ActionType action = factory.createActionType();
            action.setCode("actionCode");
            action.setLocator("actionLocator");
            action.setMessage("actionMessage");
            results.getAction().add(action);
            tr.setTransactionResults(results);

            InsertResultsType insertResults = factory.createInsertResultsType();
            InsertedFeatureType feature = factory.createInsertedFeatureType();
View Full Code Here

        {
            TransactionResultsType results = tr.getTransactionResults();
            assertEquals(2, results.getAction().size());
            {
                ActionType action1 = (ActionType) results.getAction().get(0);
                assertEquals("locator.1", action1.getLocator());
                assertNull(action1.getCode());
                assertEquals("success", action1.getMessage());
            }
            {
                ActionType action2 = (ActionType) results.getAction().get(1);
                assertEquals("locator.2", action2.getLocator());
                assertEquals("errorCode", action2.getCode());
                assertEquals("failure", action2.getMessage());
            }
        }
        {
            InsertResultsType insertResults = tr.getInsertResults();
            assertEquals(2, insertResults.getFeature().size());
View Full Code Here

        }

        writer.write(indent + offset + "</wfs:Status>");

        if (!result.getAction().isEmpty()) {
            ActionType action = (ActionType) result.getAction().get(0);

            if (action.getLocator() != null) {
                writer.write(indent + offset + "<wfs:Locator>");
                writer.write(action.getLocator() + "</wfs:Locator>");
            }

            if (action.getMessage() != null) {
                writer.write(indent + offset + "<wfs:Message>");
                ResponseUtils.writeEscapedString(writer, action.getMessage());
                writer.write("</wfs:Message>");
            }
        }

        writer.write(indent + "</wfs:TransactionResult>");
View Full Code Here

    public void v_1_1(TransactionResponseType response, OutputStream output, Operation operation)
        throws IOException, ServiceException {
        if (!response.getTransactionResults().getAction().isEmpty()) {
            //since we do atomic transactions, an action failure means all we rolled back
            // spec says to throw exception
            ActionType action = (ActionType) response.getTransactionResults().getAction().iterator()
                                                     .next();
            throw new WFSException(action.getMessage(), action.getCode(), action.getLocator());
        }

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

        }

        writer.write(indent + offset + "</wfs:Status>");

        if (!result.getAction().isEmpty()) {
            ActionType action = (ActionType) result.getAction().get(0);

            if (action.getLocator() != null) {
                writer.write(indent + offset + "<wfs:Locator>");
                writer.write(action.getLocator() + "</wfs:Locator>");
            }

            if (action.getMessage() != null) {
                writer.write(indent + offset + "<wfs:Message>");
                ResponseUtils.writeEscapedString(writer, action.getMessage());
                writer.write("</wfs:Message>");
            }
        }

        writer.write(indent + "</wfs:TransactionResult>");
View Full Code Here

    public void v_1_1(TransactionResponseType response, OutputStream output, Operation operation)
        throws IOException, ServiceException {
        if (!response.getTransactionResults().getAction().isEmpty()) {
            //since we do atomic transactions, an action failure means all we rolled back
            // spec says to throw exception
            ActionType action = (ActionType) response.getTransactionResults().getAction().iterator()
                                                     .next();
            throw new WFSException(action.getMessage(), action.getCode(), action.getLocator());
        }

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

        }

        @Override
        public void addAction(String code, String locator, String message) {
            // transaction failed, rollback
            ActionType action = ((WfsFactory)getFactory()).createActionType();
            action.setCode(code);
            action.setLocator(locator);
            action.setMessage(message);
           
            ((TransactionResponseType)adaptee).getTransactionResults().getAction().add(action);
        }
View Full Code Here

TOP

Related Classes of net.opengis.wfs.ActionType

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.