/** * Writes out the current feature. * * @throws IOException * @see org.geotools.data.FeatureWriter#write() */ public void write() throws IOException { if (writer == null) { throw new IOException("FeatureWriter has been closed"); } writer.write(); if (feature == null) { throw new IOException("No feature available to write"); } if (writer.hasNext()) { // modify existing feature ReferencedEnvelope bounds = ReferencedEnvelope.reference(feature.getBounds()); state.fireFeatureUpdated(store, feature, bounds); feature = null; } else { // modify a new feature - ie we are adding something state.fireFeatureAdded(store, feature); } }
public void write() throws IOException { if (live == null) { throw new IOException("No current feature to write"); } if (live.equals(origional)) { writeImplementation(origional); } else { writeImplementation(live); // String typeName = live.getFeatureType().getTypeName(); // Transaction autoCommit = Transaction.AUTO_COMMIT; if (origional != null) { ReferencedEnvelope bounds = ReferencedEnvelope.reference(live.getBounds()); bounds.include(origional.getBounds()); state.fireFeatureUpdated(featureSource, live, bounds); // store.listenerManager.fireFeaturesChanged(typeName, autoCommit, bounds, false); } else { state.fireFeatureAdded(featureSource, live); // store.listenerManager.fireFeaturesAdded(typeName, autoCommit, // ReferencedEnvelope.reference(live.getBounds()), false); } } origional = null; live = null; } // write end
public void write() throws IOException { try { // figure out what the fid is PrimaryKey key = dataStore.getPrimaryKey(featureType); String fid = dataStore.encodeFID(key, rs); Id filter = dataStore .getFilterFactory() .id(Collections.singleton(dataStore.getFilterFactory().featureId(fid))); // figure out which attributes changed List<AttributeDescriptor> changed = new ArrayList<AttributeDescriptor>(); List<Object> values = new ArrayList<Object>(); for (AttributeDescriptor att : featureType.getAttributeDescriptors()) { if (last.isDirty(att.getLocalName())) { changed.add(att); values.add(last.getAttribute(att.getLocalName())); } } // do the write dataStore.update(featureType, changed, values, filter, st.getConnection()); // issue notification ContentEntry entry = featureSource.getEntry(); ContentState state = entry.getState(this.tx); if (state.hasListener()) { state.fireFeatureUpdated(featureSource, last, lastBounds); } } catch (Exception e) { throw (IOException) new IOException().initCause(e); } }
state.fireFeatureUpdated(store, live, bounds); live = null; current = null;
/** * Writes out the current feature. * * @throws IOException * * @see org.geotools.data.FeatureWriter#write() */ public void write() throws IOException { writer.write(); if (feature == null) { throw new IOException("No feature available to write"); } if (writer.hasNext()) { // modify existing feature ReferencedEnvelope bounds = ReferencedEnvelope.reference(feature.getBounds()); state.fireFeatureUpdated(store, feature, bounds); feature = null; } else { // modify a new feature - ie we are adding something state.fireFeatureAdded(store, feature); } }
public void write() throws IOException { try { //figure out what the fid is PrimaryKey key = dataStore.getPrimaryKey(featureType); String fid = dataStore.encodeFID(key, rs); Id filter = dataStore.getFilterFactory() .id(Collections.singleton(dataStore.getFilterFactory() .featureId(fid))); //figure out which attributes changed List<AttributeDescriptor> changed = new ArrayList<AttributeDescriptor>(); List<Object> values = new ArrayList<Object>(); for (AttributeDescriptor att : featureType.getAttributeDescriptors()) { if (last.isDirrty(att.getLocalName())) { changed.add(att); values.add(last.getAttribute(att.getLocalName())); } } // do the write dataStore.update(featureType, changed, values, filter, st.getConnection()); // issue notification ContentEntry entry = featureSource.getEntry(); ContentState state = entry.getState( this.tx ); if( state.hasListener() ){ state.fireFeatureUpdated( featureSource, last, lastBounds ); } } catch (Exception e) { throw (IOException) new IOException().initCause(e); } }
state.fireFeatureUpdated(store, live, bounds); live = null; current = null;
state.fireFeatureUpdated(store, update, bounds); } catch (IllegalAttributeException e) { throw new DataSourceException("Could update " + fid, e);