Revision 10626 trunk/extensions/extCAD/src/com/iver/cit/gvsig/writers/WriterGT2Shp.java

View differences:

WriterGT2Shp.java
16 16
import org.geotools.filter.Filter;
17 17
import org.geotools.filter.FilterFactory;
18 18

  
19
import com.hardcode.gdbms.driver.exceptions.InitializeWriterException;
20
import com.iver.cit.gvsig.exceptions.visitors.ProcessWriterVisitorException;
21
import com.iver.cit.gvsig.exceptions.visitors.StartWriterVisitorException;
22
import com.iver.cit.gvsig.exceptions.visitors.StopWriterVisitorException;
19 23
import com.iver.cit.gvsig.fmap.core.FShape;
20 24
import com.iver.cit.gvsig.fmap.core.IFeature;
21 25
import com.iver.cit.gvsig.fmap.drivers.ITableDefinition;
22 26
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver;
23 27
import com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver;
24
import com.iver.cit.gvsig.fmap.edition.EditionException;
25 28
import com.iver.cit.gvsig.fmap.edition.IRowEdited;
26
import com.iver.cit.gvsig.fmap.edition.IWriter;
27 29
import com.iver.cit.gvsig.fmap.edition.VectorialEditableAdapter;
28 30
import com.iver.cit.gvsig.fmap.edition.writers.AbstractWriter;
29 31
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
......
72 74
	/* (non-Javadoc)
73 75
	 * @see com.iver.cit.gvsig.fmap.edition.IWriter#preProcess()
74 76
	 */
75
	public void preProcess() throws EditionException {
77
	public void preProcess() throws StartWriterVisitorException {
76 78
//		feature attributes creation
77 79
		URL theUrl;
78 80
		try {
......
88 90

  
89 91

  
90 92
			// types = new AttributeType[lyrVect.getRecordset().getFieldCount() +1];
91
		} catch (Exception e) {
92
			e.printStackTrace();
93
			throw new EditionException(e);
93
		} catch (IOException e) {
94
			throw new StartWriterVisitorException(getName(),e);
94 95
		}
95 96

  
96 97

  
......
99 100
	/* (non-Javadoc)
100 101
	 * @see com.iver.cit.gvsig.fmap.edition.IWriter#process(com.iver.cit.gvsig.fmap.edition.IRowEdited)
101 102
	 */
102
	public void process(IRowEdited row) throws EditionException {
103
	public void process(IRowEdited row) throws ProcessWriterVisitorException {
103 104

  
104 105
		IFeature feat = (IFeature) row.getLinkedRow();
105 106
		Object[] values = new Object[types.length];
......
117 118
        		featStore.removeFeatures(theFilter);
118 119
			numReg++;
119 120
		} catch (IOException e) {
120
			e.printStackTrace();
121
			throw new EditionException(e);
121
			throw new ProcessWriterVisitorException(getName(),e);
122 122
		}
123 123

  
124 124

  
......
129 129
	/* (non-Javadoc)
130 130
	 * @see com.iver.cit.gvsig.fmap.edition.IWriter#postProcess()
131 131
	 */
132
	public void postProcess() throws EditionException {
132
	public void postProcess() throws StopWriterVisitorException {
133 133
		try
134 134
		{
135 135
			t.commit(); // commit opperations
......
138 138
			try {
139 139
				t.rollback();
140 140
			} catch (IOException e) {
141
				e.printStackTrace();
142
				throw new EditionException(e);
141
				throw new StopWriterVisitorException(getName(),e);
143 142
			} // cancel opperations
144 143
		}
145 144
		finally {
146 145
			try {
147 146
				t.close();
148 147
			} catch (IOException e) {
149
				e.printStackTrace();
150
				throw new EditionException(e);
148
				throw new StopWriterVisitorException(getName(),e);
151 149
			} // free resources
152 150
		}
153 151

  
......
206 204

  
207 205
	}
208 206

  
209
	public void initialize(ITableDefinition tableDefinition) throws EditionException {
207
	public void initialize(ITableDefinition tableDefinition) throws InitializeWriterException {
210 208
		super.initialize(tableDefinition);
211
		
209

  
212 210
	}
213 211

  
214 212
	public boolean canAlterTable() {

Also available in: Unified diff