InsertResultsType insertResults = tr.getInsertResults(); if (insertResults != null) { @SuppressWarnings("unchecked") TransactionSummaryType ts = tr.getTransactionSummary(); if (ts != null) { BigInteger totalInserted = ts.getTotalInserted();
@Override public Object getProperty(Object object, QName name) throws Exception { if ("InsertResult".equals(name.getLocalPart())) { return ((TransactionResponseType) object).getInsertResults(); } if ("TransactionResult".equals(name.getLocalPart())) { return ((TransactionResponseType) object).getTransactionResults(); } return super.getProperty(object, name); } }
@Override public TransactionResponse createResponse() { WfsFactory factory = (WfsFactory) getFactory(); TransactionResponseType tr = factory.createTransactionResponseType(); tr.setTransactionSummary(factory.createTransactionSummaryType()); tr.getTransactionSummary().setTotalInserted(BigInteger.valueOf(0)); tr.getTransactionSummary().setTotalUpdated(BigInteger.valueOf(0)); tr.getTransactionSummary().setTotalDeleted(BigInteger.valueOf(0)); tr.setTransactionResults(factory.createTransactionResultsType()); tr.setInsertResults(factory.createInsertResultsType()); return new TransactionResponse.WFS11(tr); }
public void addInsertedFeature(String handle, FeatureId featureId) { InsertedFeatureType insertedFeature = ((WfsFactory) getFactory()).createInsertedFeatureType(); insertedFeature.setHandle(handle); insertedFeature.getFeatureId().add(featureId); ((TransactionResponseType) adaptee) .getInsertResults() .getFeature() .add(insertedFeature); }
@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); }
/** * Sets the "TransactionResponse" element */ public void setTransactionResponse(net.opengis.wfs.TransactionResponseType transactionResponse) { synchronized (monitor()) { check_orphaned(); net.opengis.wfs.TransactionResponseType target = null; target = (net.opengis.wfs.TransactionResponseType)get_store().find_element_user(TRANSACTIONRESPONSE$0, 0); if (target == null) { target = (net.opengis.wfs.TransactionResponseType)get_store().add_element_user(TRANSACTIONRESPONSE$0); } target.set(transactionResponse); } }
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())); TransactionType req = (TransactionType) operation.getParameters()[0]; encoder.setSchemaLocation( org.geoserver.wfs.xml.v1_1_0.WFS.NAMESPACE, buildSchemaURL(req.getBaseUrl(), "wfs/1.1.0/wfs.xsd")); encoder.encode(response, org.geoserver.wfs.xml.v1_1_0.WFS.TRANSACTIONRESPONSE, output); } }
InsertResultsType insertResults = tr.getInsertResults(); if (insertResults != null) { @SuppressWarnings("unchecked") TransactionSummaryType ts = tr.getTransactionSummary(); if (ts != null) { BigInteger totalInserted = ts.getTotalInserted();
public void v_1_0(TransactionResponseType response, OutputStream output, Operation operation) throws IOException, ServiceException { TransactionResultsType result = response.getTransactionResults(); writer.write("\">"); InsertResultsType insertResults = response.getInsertResults();
final QName layerName = rollback.getTypeName(); VersioningFeatureStore vstore = (VersioningFeatureStore) featureStores.get(layerName); long inserted = response.getTransactionSummary().getTotalInserted().longValue(); long updated = response.getTransactionSummary().getTotalUpdated().longValue(); long deleted = response.getTransactionSummary().getTotalDeleted().longValue(); insertedFeature.setHandle(rollback.getHandle()); insertedFeature.getFeatureId().add(filterFactory.featureId(fd.getID())); response.getInsertResults().getFeature().add(insertedFeature); response.getTransactionSummary().setTotalInserted(BigInteger.valueOf(inserted)); response.getTransactionSummary().setTotalUpdated(BigInteger.valueOf(updated)); response.getTransactionSummary().setTotalDeleted(BigInteger.valueOf(deleted)); } catch (IOException e) { throw new WFSTransactionException("Could not perform the rollback", e, rollback