Project

General

Profile

« Previous | Next » 

Revision aea90ab7

Added by Andreas Müller almost 7 years ago

ref #6286 updates for Flora Hellenica import (including new image import)

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/greece/FloraHellenicaCommentsImport.java
15 15

  
16 16
import org.apache.log4j.Logger;
17 17
import org.springframework.stereotype.Component;
18
import org.springframework.transaction.TransactionStatus;
19 18

  
20 19
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState;
21 20
import eu.etaxonomy.cdm.model.common.Language;
......
54 53
        return "comments";
55 54
    }
56 55

  
57
    private boolean isFirst = true;
58
    private TransactionStatus tx = null;
59 56
    /**
60 57
     * {@inheritDoc}
61 58
     */
62 59
    @Override
63 60
    protected void firstPass(SimpleExcelTaxonImportState<CONFIG> state) {
64
        if (isFirst){
65
            tx = this.startTransaction();
66
            isFirst = false;
67
        }
68 61

  
69 62
        String line = state.getCurrentLine() + ": ";
70 63
        HashMap<String, String> record = state.getOriginalRecord();
......
80 73
        makeComment(state, line, record, noStr);
81 74
    }
82 75

  
83
    @Override
84
    protected void secondPass(SimpleExcelTaxonImportState<CONFIG> state) {
85
        if (tx != null){
86
            this.commitTransaction(tx);
87
            tx = null;
88
        }
89
    }
90

  
91 76

  
92 77
    /**
93 78
     * @param state

Also available in: Unified diff