Revision 9834

View differences:

trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dxf/DXFMemoryDriver.java
893 893
		return vector.get(index);
894 894
	}
895 895

  
896
	public boolean isWriteAll() {
897
		return true;
898
	}
899

  
896 900
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/shp/IndexedShpDriver.java
995 995
	public boolean canSaveEdits() {
996 996
		return shpWriter.canSaveEdits();
997 997
	}
998
	
999
	public boolean isWriteAll() {
1000
		return true;
1001
	}
1002

  
998 1003
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/dbf/DBFDriver.java
440 440
		return false;
441 441

  
442 442
	}
443
	public boolean isWriteAll() {
444
		// TODO: DEVOLVER FALSE SI NO HA HABIDO CAMBIOS EN LOS CAMPOS.
445
		return true;
446
	}
443 447

  
444 448
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/IWriter.java
33 33

  
34 34
	public ITableDefinition getTableDefinition();
35 35

  
36
	/**
37
	 * @return true if the driver needs to iterate trhu all records.
38
	 * for example, shp files need return true. jdbc writers will return false
39
	 */
40
	public boolean isWriteAll();
41

  
42

  
36 43
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/EditableAdapter.java
345 345
			}
346 346

  
347 347
			int rowCount = getRowCount();
348
			for (int i = 0; i < rowCount; i++) {
349
				IRowEdited rowEdited = getRow(i);
348
			if (writer.isWriteAll())
349
			{
350
				for (int i = 0; i < rowCount; i++) {
351
					IRowEdited rowEdited = getRow(i);
352
	
353
					if (rowEdited != null) {
354
						writer.process(rowEdited);
355
					}
356
				}
357
			}
358
			else
359
			{
360
				// Escribimos solo aquellos registros que han cambiado
361
				for (int i = 0; i < rowCount; i++) {
362
					int calculatedIndex = getCalculatedIndex(i);
363
					Integer integer = new Integer(calculatedIndex);
364
					DefaultRowEdited edRow = null;
365
					// Si est? en el fichero de expansi?n hay que modificar
366
					if (relations.containsKey(integer)) {
367
						int num = ((Integer) relations.get(integer)).intValue();
350 368

  
351
				if (rowEdited != null) {
352
					writer.process(rowEdited);
369
						// return expansionFile.getRow(num);
370
						// ExpansionFile ya entrega el registro formateado como debe
371
						IRowEdited rowFromExpansion = expansionFile.getRow(num);
372
						// ?Habr?a que hacer aqu? setID(index + "")?
373
						edRow = new DefaultRowEdited(rowFromExpansion.getLinkedRow()
374
								.cloneRow(), rowFromExpansion.getStatus(), i);
375
						writer.process(edRow);
376
					}
353 377
				}
354 378
			}
355 379
			writer.postProcess();
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/writers/shp/MultiShpWriter.java
289 289
		return false;
290 290
	}
291 291
	
292
	public boolean isWriteAll() {
293
		return true;
294
	}
295

  
292 296
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/writers/JdbcWriter.java
7 7

  
8 8
import com.hardcode.gdbms.engine.values.Value;
9 9
import com.iver.cit.gvsig.fmap.core.IRow;
10
import com.iver.cit.gvsig.fmap.drivers.ITableDefinition;
11 10
import com.iver.cit.gvsig.fmap.drivers.XTypes;
12 11
import com.iver.cit.gvsig.fmap.edition.EditionException;
13 12
import com.iver.cit.gvsig.fmap.edition.IRowEdited;
......
18 17
	Value[] record;
19 18
	int numRecord;
20 19
	
21
	private boolean bWriteAll;
22 20
	private boolean bCreateTable;
23 21
	
24 22
	private ResultSetMetaData metaData = null;
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/writers/AbstractWriter.java
4 4

  
5 5
import com.iver.cit.gvsig.fmap.drivers.ITableDefinition;
6 6
import com.iver.cit.gvsig.fmap.edition.EditionException;
7
import com.iver.cit.gvsig.fmap.edition.IRowEdited;
8 7
import com.iver.cit.gvsig.fmap.edition.IWriter;
9 8

  
10 9
public abstract class AbstractWriter implements IWriter {
11 10
	protected Properties capabilities = new Properties();
12 11
	protected ITableDefinition tableDef;
12
	protected boolean bWriteAll;
13 13
	
14 14
	/**
15 15
	 * A developer can use this Properties for his own purposes. For example, to
......
44 44
		return tableDef;
45 45
	}
46 46

  
47
	/**
48
	 * @return Returns the bWriteAll.
49
	 */
50
	public boolean isWriteAll() {
51
		return bWriteAll;
52
	}
47 53

  
54
	/**
55
	 * @param writeAll
56
	 *            The bWriteAll to set.
57
	 */
58
	public void setWriteAll(boolean writeAll) {
59
		bWriteAll = writeAll;
60
	}
61

  
62

  
48 63
}
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/VectorialFileAdapter.java
177 177

  
178 178
					String name = LayerFactory.getDataSourceFactory().addFileDataSource(driverName,
179 179
						dataFile.getAbsolutePath());
180
					ds = new SelectableDataSource(LayerFactory.getDataSourceFactory().createRandomDataSource(name, DataSourceFactory.AUTOMATIC_OPENING));
180
					ds = new SelectableDataSource(LayerFactory.getDataSourceFactory().createRandomDataSource(name, DataSourceFactory.MANUAL_OPENING));
181 181
				} else if (driver instanceof ObjectDriver) {
182 182
					String name = LayerFactory.getDataSourceFactory().addDataSource((ObjectDriver)driver);
183
					ds = new SelectableDataSource(LayerFactory.getDataSourceFactory().createRandomDataSource(name, DataSourceFactory.AUTOMATIC_OPENING));
183
					ds = new SelectableDataSource(LayerFactory.getDataSourceFactory().createRandomDataSource(name, DataSourceFactory.MANUAL_OPENING));
184 184
				} else {
185 185
					return null;
186 186
				}

Also available in: Unified diff