Project

General

Profile

Download (22.1 KB) Statistics
| Branch: | Revision:
1
/**
2
 * Copyright (C) 2007 EDIT
3
 * European Distributed Institute of Taxonomy
4
 * http://www.e-taxonomy.eu
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9

    
10
package eu.etaxonomy.cdm.io.redlist.gefaesspflanzen;
11

    
12
import java.sql.ResultSet;
13
import java.sql.SQLException;
14
import java.util.Arrays;
15
import java.util.HashMap;
16
import java.util.HashSet;
17
import java.util.Map;
18
import java.util.Set;
19
import java.util.UUID;
20

    
21
import org.apache.log4j.Logger;
22
import org.springframework.stereotype.Component;
23

    
24
import eu.etaxonomy.cdm.common.CdmUtils;
25
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
26
import eu.etaxonomy.cdm.io.common.DbImportBase;
27
import eu.etaxonomy.cdm.io.common.IPartitionedIO;
28
import eu.etaxonomy.cdm.io.common.ResultSetPartitioner;
29
import eu.etaxonomy.cdm.model.common.CdmBase;
30
import eu.etaxonomy.cdm.model.common.Language;
31
import eu.etaxonomy.cdm.model.common.TimePeriod;
32
import eu.etaxonomy.cdm.model.reference.Reference;
33
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
34
import eu.etaxonomy.cdm.model.taxon.Classification;
35
import eu.etaxonomy.cdm.model.taxon.Synonym;
36
import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
37
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
38
import eu.etaxonomy.cdm.model.taxon.Taxon;
39
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
40
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
41

    
42
/**
43
 *
44
 * @author pplitzner
45
 * @date Mar 1, 2016
46
 *
47
 */
48

    
49
@Component
50
@SuppressWarnings("serial")
51
public class RedListGefaesspflanzenImportClassification extends DbImportBase<RedListGefaesspflanzenImportState, RedListGefaesspflanzenImportConfigurator> {
52

    
53
    private static final Logger logger = Logger.getLogger(RedListGefaesspflanzenImportClassification.class);
54

    
55
    private static final String tableName = "Rote Liste Gefäßpflanzen";
56

    
57
    private static final String pluralString = "classifications";
58

    
59
    public RedListGefaesspflanzenImportClassification() {
60
        super(tableName, pluralString);
61
    }
62

    
63
    @Override
64
    protected String getIdQuery(RedListGefaesspflanzenImportState state) {
65
        return "SELECT NAMNR "
66
                + "FROM V_TAXATLAS_D20_EXPORT t "
67
                + " ORDER BY NAMNR";
68
    }
69

    
70
    @Override
71
    protected String getRecordQuery(RedListGefaesspflanzenImportConfigurator config) {
72
        String result = "select e.*, f.FAMILIE "
73
                + "from V_TAXATLAS_D20_EXPORT e, GATTUNG_FAMILIE f "
74
                + "where e.EPI1 = f.GATTUNG and e.NAMNR IN (@IDSET)";
75
        result = result.replace("@IDSET", IPartitionedIO.ID_LIST_TOKEN);
76
        return result;
77
    }
78

    
79
    @Override
80
    protected void doInvoke(RedListGefaesspflanzenImportState state) {
81
        makeClassification("Gesamtliste", state.getConfig().getClassificationUuid(), "Gesamtliste", null, RedListUtil.gesamtListeReferenceUuid, state);
82
        makeClassification("Checkliste", RedListUtil.checkListClassificationUuid, "Checkliste", null, RedListUtil.checkListReferenceUuid, state);
83
        makeClassification("E", RedListUtil.uuidClassificationE, "Ehrendorfer", null, RedListUtil.uuidClassificationReferenceE, state);
84
        makeClassification("W", RedListUtil.uuidClassificationW, "Wisskirchen (Standardliste)", 1998, RedListUtil.uuidClassificationReferenceW, state);
85
        makeClassification("K", RedListUtil.uuidClassificationK, "Korneck (Rote Liste)", 1996, RedListUtil.uuidClassificationReferenceK, state);
86
        makeClassification("AW", RedListUtil.uuidClassificationAW, "Atlas (Westdeutschland)", 1988, RedListUtil.uuidClassificationReferenceAW, state);
87
        makeClassification("AO", RedListUtil.uuidClassificationAO, "Atlas (Ostdeutschland)", 1996, RedListUtil.uuidClassificationReferenceAO, state);
88
        makeClassification("R", RedListUtil.uuidClassificationR, "Rothmaler", 2011, RedListUtil.uuidClassificationReferenceR, state);
89
        makeClassification("O", RedListUtil.uuidClassificationO, "Oberdorfer", 2001, RedListUtil.uuidClassificationReferenceO, state);
90
        makeClassification("S", RedListUtil.uuidClassificationS, "Schmeil-Fitschen", 2011, RedListUtil.uuidClassificationReferenceS, state);
91
        importFamilies(state);
92
        super.doInvoke(state);
93
    }
94

    
95

    
96
    private void importFamilies(RedListGefaesspflanzenImportState state) {
97
        Classification gesamtListe = getClassificationService().load(state.getConfig().getClassificationUuid(), Arrays.asList(new String[]{"*, rootNode.childNodes"}));
98
        Classification checkliste = getClassificationService().load(RedListUtil.checkListClassificationUuid, Arrays.asList(new String[]{"*, rootNode.childNodes"}));
99
        for(UUID uuid:state.getFamilyMap().values()){
100
            Taxon familyGL = HibernateProxyHelper.deproxy(getTaxonService().load(uuid, Arrays.asList(new String[]{"*, taxon"})), Taxon.class);
101
            Taxon familyCL = (Taxon) familyGL.clone();
102
            getTaxonService().saveOrUpdate(familyCL);
103

    
104
            gesamtListe.addChildTaxon(familyGL, null, null);
105
            familyGL.setSec(gesamtListe.getReference());
106
            familyGL.setTitleCache(null);
107

    
108
            checkliste.addChildTaxon(familyCL, null, null);
109
            familyCL.setSec(checkliste.getReference());
110
            familyCL.setTitleCache(null);
111

    
112
            getClassificationService().saveOrUpdate(gesamtListe);
113
            getClassificationService().saveOrUpdate(checkliste);
114
        }
115
    }
116

    
117
    @Override
118
    public boolean doPartition(ResultSetPartitioner partitioner, RedListGefaesspflanzenImportState state) {
119
        ResultSet rs = partitioner.getResultSet();
120
        Classification gesamtListeClassification = getClassificationService().load(state.getConfig().getClassificationUuid());
121
        Classification checklistClassification = getClassificationService().load(RedListUtil.checkListClassificationUuid);
122
        Classification classificationE = getClassificationService().load(RedListUtil.uuidClassificationE);
123
        Classification classificationW = getClassificationService().load(RedListUtil.uuidClassificationW);
124
        Classification classificationK = getClassificationService().load(RedListUtil.uuidClassificationK);
125
        Classification classificationAW = getClassificationService().load(RedListUtil.uuidClassificationAW);
126
        Classification classificationAO = getClassificationService().load(RedListUtil.uuidClassificationAO);
127
        Classification classificationR = getClassificationService().load(RedListUtil.uuidClassificationR);
128
        Classification classificationO = getClassificationService().load(RedListUtil.uuidClassificationO);
129
        Classification classificationS = getClassificationService().load(RedListUtil.uuidClassificationS);
130
        try {
131
            while (rs.next()){
132
                makeSingleTaxonNode(state, rs, gesamtListeClassification, checklistClassification,
133
                        classificationE, classificationW, classificationK, classificationAW
134
                        , classificationAO, classificationR, classificationO, classificationS);
135

    
136
            }
137
        } catch (SQLException e) {
138
            e.printStackTrace();
139
        }
140

    
141
        logger.info("Update classification (1000 nodes)");
142
        getClassificationService().saveOrUpdate(gesamtListeClassification);
143
        getClassificationService().saveOrUpdate(checklistClassification);
144
        return true;
145
    }
146

    
147
    private void makeSingleTaxonNode(RedListGefaesspflanzenImportState state, ResultSet rs,
148
            Classification gesamtListeClassification, Classification checklistClassification,
149
            Classification classificationE, Classification classificationW, Classification classificationK,
150
            Classification classificationAW, Classification classificationAO, Classification classificationR,
151
            Classification classificationO, Classification classificationS)
152
            throws SQLException {
153
        long id = rs.getLong(RedListUtil.NAMNR);
154
        String parentId = String.valueOf(rs.getLong(RedListUtil.LOWER));
155
        String gueltString = rs.getString(RedListUtil.GUELT);
156
        String taxZusatzString = rs.getString(RedListUtil.TAX_ZUSATZ);
157
        String familieString = rs.getString(RedListUtil.FAMILIE);
158

    
159
        String relationE = rs.getString(RedListUtil.E);
160
        String relationW = rs.getString(RedListUtil.W);
161
        String relationK = rs.getString(RedListUtil.K);
162
        String relationAW = rs.getString(RedListUtil.AW);
163
        String relationAO = rs.getString(RedListUtil.AO);
164
        String relationR = rs.getString(RedListUtil.R);
165
        String relationO = rs.getString(RedListUtil.O);
166
        String relationS = rs.getString(RedListUtil.S);
167

    
168
        //Gesamtliste
169
        TaxonBase<?> taxonBaseGL = state.getRelatedObject(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, String.valueOf(id), TaxonBase.class);
170
        TaxonBase<?> parentBaseGL = state.getRelatedObject(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, parentId, TaxonBase.class);
171
        if(parentBaseGL!=null && !parentBaseGL.isInstanceOf(Taxon.class)){
172
            RedListUtil.logMessage(id, parentBaseGL+" is no taxon but is a parent of "+taxonBaseGL+" (Gesamtliste)", logger);
173
        }
174
        Taxon parentGL = (Taxon) state.getRelatedObject(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, parentId, TaxonBase.class);
175
        //add to family if no parent found
176
        if(taxonBaseGL.getName().getRank()!=null && taxonBaseGL.getName().getRank().isGenus()){
177
            if(parentBaseGL!=null){
178
                RedListUtil.logMessage(id, taxonBaseGL+" is genus but already had a parent when trying to add to family", logger);
179
            }
180
            if(taxonBaseGL.isInstanceOf(Taxon.class)){
181
                Taxon family = HibernateProxyHelper.deproxy(getTaxonService().load(state.getFamilyMap().get(familieString)), Taxon.class);
182
                gesamtListeClassification.addParentChild(family, HibernateProxyHelper.deproxy(taxonBaseGL, Taxon.class), null, null);
183
            }
184
            else{
185
                RedListUtil.logMessage(id, taxonBaseGL+" has no parent but is not a taxon.", logger);
186
            }
187
        }
188
        else{
189
            createParentChildNodes(gesamtListeClassification, id, gueltString, taxZusatzString, taxonBaseGL, parentGL);
190
        }
191

    
192
        //Checkliste
193
        TaxonBase<?> taxonBaseCL = state.getRelatedObject(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, String.valueOf(id), TaxonBase.class);
194
        TaxonBase<?> parentBaseCL = state.getRelatedObject(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, parentId, TaxonBase.class);
195
        if(parentBaseCL!=null && !parentBaseCL.isInstanceOf(Taxon.class)){
196
            RedListUtil.logMessage(id, parentBaseCL+" is no taxon but is a parent of "+taxonBaseCL+" (Checkliste)", logger);
197
        }
198
        Taxon parentCL = (Taxon) state.getRelatedObject(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, parentId, TaxonBase.class);
199
        //add to family if no parent found
200
        if(parentCL==null){
201

    
202
        }
203
        else{
204
            if(taxonBaseCL!=null){//null check necessary because not all taxa exist in the checklist
205
                createParentChildNodes(checklistClassification, id, gueltString, taxZusatzString, taxonBaseCL, parentCL);
206
            }
207
        }
208

    
209
        //check uuids
210
        if(taxonBaseGL!= null && taxonBaseCL!=null
211
                && taxonBaseGL.getUuid().equals(taxonBaseCL.getUuid())){
212
            RedListUtil.logMessage(id, "Same UUID for "+taxonBaseGL+ " (Gesamtliste) and "+taxonBaseCL+" (Checkliste)", logger);
213
        }
214
        if(parentGL!=null && parentCL!=null && parentGL.getUuid().equals(parentCL.getUuid())){
215
            RedListUtil.logMessage(id, "Same UUID for "+parentGL+ " (Gesamtliste) and "+parentCL+" (Checkliste)", logger);
216
        }
217

    
218
        //add taxa for concept relationships to E, W, K, AW, AO, R, O, S
219
        addTaxonToClassification(classificationE, RedListUtil.CLASSIFICATION_NAMESPACE_E, relationE, taxonBaseGL, taxonBaseCL, id, state);
220
        addTaxonToClassification(classificationW, RedListUtil.CLASSIFICATION_NAMESPACE_W, relationW, taxonBaseGL, taxonBaseCL, id, state);
221
        addTaxonToClassification(classificationK, RedListUtil.CLASSIFICATION_NAMESPACE_K, relationK, taxonBaseGL, taxonBaseCL, id, state);
222
        addTaxonToClassification(classificationAW, RedListUtil.CLASSIFICATION_NAMESPACE_AW, relationAW, taxonBaseGL, taxonBaseCL, id, state);
223
        addTaxonToClassification(classificationAO, RedListUtil.CLASSIFICATION_NAMESPACE_AO, relationAO, taxonBaseGL, taxonBaseCL, id, state);
224
        addTaxonToClassification(classificationR, RedListUtil.CLASSIFICATION_NAMESPACE_R, relationR, taxonBaseGL, taxonBaseCL, id, state);
225
        addTaxonToClassification(classificationO, RedListUtil.CLASSIFICATION_NAMESPACE_O, relationO, taxonBaseGL, taxonBaseCL, id, state);
226
        addTaxonToClassification(classificationS, RedListUtil.CLASSIFICATION_NAMESPACE_S, relationS, taxonBaseGL, taxonBaseCL, id, state);
227
    }
228

    
229
    private void addTaxonToClassification(Classification classification, String classificationNamespace, String relationString, final TaxonBase<?> gesamtListeTaxon, final TaxonBase<?> checklisteTaxon, long id, RedListGefaesspflanzenImportState state){
230
        Taxon taxon = HibernateProxyHelper.deproxy(state.getRelatedObject(classificationNamespace, String.valueOf(id), TaxonBase.class), Taxon.class);
231
        //add concept relation to gesamtliste and checkliste
232
        if(taxon!=null && CdmUtils.isNotBlank(relationString) && !relationString.equals(".")){
233
            //if the related concept in gesamtliste/checkliste is a synonym then we
234
            //create a relation to the accepted taxon
235
            Taxon acceptedGesamtListeTaxon = getAcceptedTaxon(gesamtListeTaxon);
236
            Taxon acceptedChecklistTaxon = getAcceptedTaxon(checklisteTaxon);
237
            String relationSubstring = relationString.substring(relationString.length()-1, relationString.length());
238
            TaxonRelationshipType taxonRelationshipTypeByKey = new RedListGefaesspflanzenTransformer().getTaxonRelationshipTypeByKey(relationSubstring);
239
            if(taxonRelationshipTypeByKey==null){
240
                RedListUtil.logMessage(id, "Could not interpret relationship "+relationString+" for taxon "+gesamtListeTaxon.generateTitle(), logger);
241
            }
242
            //there is no type "included in" so we have to reverse the direction
243
            if(relationSubstring.equals("<")){
244
                if(acceptedGesamtListeTaxon!=null){
245
                    acceptedGesamtListeTaxon.addTaxonRelation(taxon, taxonRelationshipTypeByKey, null, null);
246
                }
247
                if(acceptedChecklistTaxon!=null) {
248
                    acceptedChecklistTaxon.addTaxonRelation(taxon, taxonRelationshipTypeByKey, null, null);
249
                }
250
            }
251
            else{
252
                if(acceptedGesamtListeTaxon!=null){
253
                    taxon.addTaxonRelation(acceptedGesamtListeTaxon, taxonRelationshipTypeByKey, null, null);
254
                }
255
                if(acceptedChecklistTaxon!=null) {
256
                    taxon.addTaxonRelation(acceptedChecklistTaxon, taxonRelationshipTypeByKey, null, null);
257
                }
258
            }
259

    
260
            taxon.setSec(classification.getReference());
261
            classification.addChildTaxon(taxon, null, null);
262
            //TODO is saving and setting the title cache to null neccessary?
263
            getTaxonService().saveOrUpdate(taxon);
264
            getTaxonService().saveOrUpdate(gesamtListeTaxon);
265
            if(checklisteTaxon!=null){
266
                getTaxonService().saveOrUpdate(checklisteTaxon);
267
            }
268
            taxon.setTitleCache(null);//Reset title cache to see sec ref in title
269
        }
270
    }
271

    
272
    private void createParentChildNodes(Classification classification, long id, String gueltString,
273
            String taxZusatzString, TaxonBase<?> taxonBase, Taxon parent) {
274
        if(taxonBase==null){
275
            RedListUtil.logMessage(id, "child taxon/synonym of "+parent+"  is null. ("+classification.generateTitle()+")" , logger);
276
            return;
277
        }
278
        //taxon
279
        if(taxonBase.isInstanceOf(Taxon.class)){
280
            //misapplied name
281
            String appendedPhrase = taxonBase.getAppendedPhrase();
282
            if(appendedPhrase!=null && appendedPhrase.equals(RedListUtil.AUCT)){
283
                if(parent==null){
284
                    RedListUtil.logMessage(id, "parent taxon of misapplied name "+taxonBase+"  is null. ("+classification.getTitleCache()+")" , logger);
285
                    return;
286
                }
287
                parent.addMisappliedName((Taxon) taxonBase, null, null);
288
            }
289
            else{
290
                classification.addParentChild(parent, (Taxon)taxonBase, null, null);
291
            }
292

    
293
            if(CdmUtils.isNotBlank(taxZusatzString)){
294
                if(taxZusatzString.trim().equals("p. p.")){
295
                    RedListUtil.logMessage(id, "pro parte for accepted taxon "+taxonBase, logger);
296
                }
297
            }
298
        }
299
        //synonym
300
        else if(taxonBase.isInstanceOf(Synonym.class)){
301
            if(parent==null){
302
                RedListUtil.logMessage(id, "parent taxon of synonym "+taxonBase+"  is null. ("+classification.getTitleCache()+")" , logger);
303
                return;
304
            }
305
            //basionym
306
            if(gueltString.equals(RedListUtil.GUELT_BASIONYM)){
307
                parent.addHomotypicSynonym((Synonym) taxonBase, null, null);
308
                parent.getName().addBasionym(taxonBase.getName());
309
            }
310
            //regular synonym
311
            else{
312
                SynonymRelationship synonymRelationship = parent.addSynonym((Synonym) taxonBase, SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF(), null, null);
313

    
314
                //TAX_ZUSATZ
315
                if(CdmUtils.isNotBlank(taxZusatzString)){
316
                    if(taxZusatzString.trim().equals("p. p.")){
317
                        synonymRelationship.setProParte(true);
318
                    }
319
                    else if(taxZusatzString.trim().equals("s. l. p. p.")){
320
                        synonymRelationship.setProParte(true);
321
                        taxonBase.setAppendedPhrase("s. l.");
322
                    }
323
                    else if(taxZusatzString.trim().equals("s. str. p. p.")){
324
                        synonymRelationship.setProParte(true);
325
                        taxonBase.setAppendedPhrase("s. str.");
326
                    }
327
                    else if(taxZusatzString.trim().equals("s. l.")
328
                            || taxZusatzString.trim().equals("s. str.")){
329
                        taxonBase.setAppendedPhrase(taxZusatzString);
330
                    }
331
                    else{
332
                        RedListUtil.logMessage(id, "unknown value "+taxZusatzString+" for column "+RedListUtil.TAX_ZUSATZ, logger);
333
                    }
334
                }
335
            }
336
        }
337
        //set sec reference
338
        taxonBase.setSec(classification.getReference());
339
        taxonBase.setTitleCache(null, false);//refresh title cache
340
    }
341

    
342
    @Override
343
    public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs,
344
            RedListGefaesspflanzenImportState state) {
345
        Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<>();
346

    
347
        Set<String> idSet = new HashSet<String>();
348
        try {
349
            while (rs.next()){
350
                idSet.add(String.valueOf(rs.getLong(RedListUtil.NAMNR)));
351
                idSet.add(String.valueOf(rs.getLong(RedListUtil.LOWER)));
352
            }
353
        } catch (SQLException e) {
354
            e.printStackTrace();
355
        }
356
        result.put(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.TAXON_GESAMTLISTE_NAMESPACE));
357
        result.put(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.TAXON_CHECKLISTE_NAMESPACE));
358
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_E, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_E));
359
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_W, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_W));
360
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_K, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_K));
361
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_AW, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_AW));
362
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_AO, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_AO));
363
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_R, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_R));
364
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_O, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_O));
365
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_S, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_S));
366
        return result;
367
    }
368

    
369
    private void makeClassification(String classificationName, UUID classificationUuid, String referenceName, Integer yearPublished, UUID referenceUuid, RedListGefaesspflanzenImportState state) {
370
        Classification classification = Classification.NewInstance(classificationName, Language.DEFAULT());
371
        classification.setUuid(classificationUuid);
372
        Reference reference = ReferenceFactory.newGeneric();
373
        reference.setTitle(referenceName);
374
        reference.setUuid(referenceUuid);
375
        classification.setReference(reference);
376
        if(yearPublished!=null){
377
            reference.setDatePublished(TimePeriod.NewInstance(yearPublished));
378
        }
379
        getClassificationService().save(classification);
380
    }
381

    
382
    @Override
383
    protected boolean doCheck(RedListGefaesspflanzenImportState state) {
384
        return false;
385
    }
386

    
387
    @Override
388
    protected boolean isIgnore(RedListGefaesspflanzenImportState state) {
389
        return false;
390
    }
391

    
392
}
(2-2/8)