Revision 13444 trunk/extensions/extSDE/src/com/iver/cit/gvsig/fmap/drivers/sde/ArcSdeWriter.java

View differences:

ArcSdeWriter.java
16 16
import com.esri.sde.sdk.client.SeRow;
17 17
import com.esri.sde.sdk.client.SeShape;
18 18
import com.esri.sde.sdk.client.SeUpdate;
19
import com.hardcode.gdbms.driver.exceptions.InitializeWriterException;
19 20
import com.iver.andami.messages.NotificationManager;
21
import com.iver.cit.gvsig.exceptions.visitors.StartWriterVisitorException;
22
import com.iver.cit.gvsig.exceptions.visitors.StopWriterVisitorException;
23
import com.iver.cit.gvsig.exceptions.visitors.VisitorException;
20 24
import com.iver.cit.gvsig.fmap.core.FShape;
21 25
import com.iver.cit.gvsig.fmap.core.IFeature;
22 26
import com.iver.cit.gvsig.fmap.core.IGeometry;
23 27
import com.iver.cit.gvsig.fmap.drivers.DBLayerDefinition;
24 28
import com.iver.cit.gvsig.fmap.drivers.FieldDescription;
25 29
import com.iver.cit.gvsig.fmap.drivers.ITableDefinition;
26
import com.iver.cit.gvsig.fmap.edition.EditionException;
27 30
import com.iver.cit.gvsig.fmap.edition.IFieldManager;
28 31
import com.iver.cit.gvsig.fmap.edition.IRowEdited;
29 32
import com.iver.cit.gvsig.fmap.edition.ISpatialWriter;
......
55 58
     * function
56 59
     *
57 60
     * @param lyrD
61
     * @throws InitializeWriterException
58 62
     *
59 63
     * @throws EditionException
60 64
     */
61
    public void initialize(ITableDefinition lyrD) throws EditionException {
65
    public void initialize(ITableDefinition lyrD) throws InitializeWriterException{
62 66
        super.initialize(lyrD);
63 67
        this.lyrDef = (DBLayerDefinition)lyrD;
64 68
        conex = (SeConnection) lyrDef.getConnection();
......
108 112

  
109 113
    /**
110 114
     * DOCUMENT ME!
115
     * @throws StartWriterVisitorException
111 116
     *
112 117
     * @throws EditionException DOCUMENT ME!
113 118
     */
114
    public void preProcess() throws EditionException {
119
    public void preProcess() throws StartWriterVisitorException {
115 120
        numRows = 0;
116 121

  
117 122
        // ATENTION: We will transform (in PostGIS class; doubleQuote())
......
134 139
            // Intentamos convertir nuestras cadenas a ese encode.
135 140
            //	        postGisSQL.setEncoding(serverEncoding);
136 141
        } catch (SeException e) {
137

  
138
        	NotificationManager.addError(e);
142
        	throw new StartWriterVisitorException(lyrDef.getName(),e);
139 143
        }
140 144
    }
141 145

  
......
143 147
     * DOCUMENT ME!
144 148
     *
145 149
     * @param _row DOCUMENT ME!
150
     * @throws VisitorException
146 151
     *
147 152
     * @throws EditionException DOCUMENT ME!
148 153
     */
149
    public void process(IRowEdited _row) throws EditionException {
154
    public void process(IRowEdited _row) throws VisitorException {
150 155
        int status = _row.getStatus();
151 156

  
152 157
        try {
......
181 186
            }
182 187
        } catch (SeException e) {
183 188
        	NotificationManager.addError(e);
184
            throw new EditionException();
189
            throw new VisitorException(lyrDef.getName(),e);
185 190
        } catch (IOException e) {
186 191
        	NotificationManager.addError(e);
187
            throw new EditionException();
192
            throw new VisitorException(lyrDef.getName(),e);
188 193
        }
189 194
    }
190 195

  
......
275 280
     *
276 281
     * @throws EditionException DOCUMENT ME!
277 282
     */
278
    private void addRow(IRowEdited irow) throws EditionException {
283
    private void addRow(IRowEdited irow){
279 284
        try {
280 285
            //Feature feature = (Feature) this.features.get(this.currentIndex);
281 286
            //FeatureType featureType = feature.getFeatureType();
......
361 366
     * @throws IOException DOCUMENT ME!
362 367
     */
363 368
    private void setRowValue(SeRow row, int index, Object value)
364
        throws SeException, IOException {
369
        throws SeException{
365 370
        SeColumnDefinition seColumnDefinition = null;
366 371
        seColumnDefinition = row.getColumnDef(index);
367 372

  
368 373
        switch (seColumnDefinition.getType()) {
369
        case SeColumnDefinition.TYPE_INTEGER: {
374
        case SeColumnDefinition.TYPE_INT32:
375
        case SeColumnDefinition.TYPE_INT64:
376
        {
370 377
            if (value != null) {
371 378
                row.setInteger(index, new Integer(value.toString()));
372 379
            } else {
......
376 383
            break;
377 384
        }
378 385

  
379
        case SeColumnDefinition.TYPE_SMALLINT: {
386
        case SeColumnDefinition.TYPE_INT16: {
380 387
            if (value != null) {
381 388
                row.setShort(index, new Short(value.toString()));
382 389
            } else {
......
386 393
            break;
387 394
        }
388 395

  
389
        case SeColumnDefinition.TYPE_FLOAT: {
396
        case SeColumnDefinition.TYPE_FLOAT32: {
390 397
            if (value != null) {
391 398
                row.setFloat(index, new Float(value.toString()));
392 399
            } else {
......
396 403
            break;
397 404
        }
398 405

  
399
        case SeColumnDefinition.TYPE_DOUBLE: {
406
        case SeColumnDefinition.TYPE_FLOAT64: {
400 407
            if (value != null) {
401 408
                row.setDouble(index, new Double(value.toString()));
402 409
            } else {
......
406 413
            break;
407 414
        }
408 415

  
409
        case SeColumnDefinition.TYPE_STRING: {
416
        case SeColumnDefinition.TYPE_STRING:
417
        case SeColumnDefinition.TYPE_NSTRING:
410 418
            if (value != null) {
411 419
                row.setString(index, value.toString());
412 420
            } else {
......
414 422
            }
415 423

  
416 424
            break;
417
        }
418

  
419 425
        case SeColumnDefinition.TYPE_DATE: {
420 426
            if (value != null) {
421 427
                Calendar calendar = Calendar.getInstance();
......
450 456

  
451 457
    /**
452 458
     * DOCUMENT ME!
459
     * @throws StopWriterVisitorException
453 460
     *
454 461
     * @throws EditionException DOCUMENT ME!
455 462
     */
456
    public void postProcess() throws EditionException {
463
    public void postProcess() throws StopWriterVisitorException {
457 464
        try {
458 465
            conex.commitTransaction();
459 466
        } catch (SeException e) {
460 467
        	NotificationManager.addError(e);
461
            throw new EditionException(e);
468
            throw new StopWriterVisitorException(lyrDef.getName(),e);
462 469
        }
463 470
    }
464 471

  
......
601 608
     *
602 609
     * @throws EditionException DOCUMENT ME!
603 610
     */
604
    public boolean alterTable() throws EditionException {
611
    public boolean alterTable() {
605 612
        //		return fieldManager.alterTable();
606 613
        return false;
607 614
    }

Also available in: Unified diff