Project

General

Profile

Download (23.3 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.Map.Entry;
19
import java.util.Set;
20
import java.util.UUID;
21

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

    
25
import eu.etaxonomy.cdm.common.CdmUtils;
26
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
27
import eu.etaxonomy.cdm.io.common.DbImportBase;
28
import eu.etaxonomy.cdm.io.common.IPartitionedIO;
29
import eu.etaxonomy.cdm.io.common.ResultSetPartitioner;
30
import eu.etaxonomy.cdm.model.common.CdmBase;
31
import eu.etaxonomy.cdm.model.common.Language;
32
import eu.etaxonomy.cdm.model.common.TimePeriod;
33
import eu.etaxonomy.cdm.model.reference.Reference;
34
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
35
import eu.etaxonomy.cdm.model.taxon.Classification;
36
import eu.etaxonomy.cdm.model.taxon.Synonym;
37
import eu.etaxonomy.cdm.model.taxon.SynonymType;
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 SEQNUM "
66
                + "FROM V_TAXATLAS_D20_EXPORT t "
67
                + " ORDER BY SEQNUM";
68
    }
69

    
70
    @Override
71
    protected String getRecordQuery(RedListGefaesspflanzenImportConfigurator config) {
72
        String result = "select distinct e.*, f.FAMILIE "
73
                + "from V_TAXATLAS_D20_EXPORT e, GATTUNG_FAMILIE f "
74
                + "where e.EPI1 = f.GATTUNG and e.SEQNUM 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
        Classification gesamtListe = makeClassification("Gesamtliste", state.getConfig().getClassificationUuid(), "Gesamtliste", null, RedListUtil.gesamtListeReferenceUuid, state);
82
        Classification checkliste = makeClassification("Checkliste", RedListUtil.checkListClassificationUuid, "Checkliste", null, RedListUtil.checkListReferenceUuid, state);
83
        makeClassification("Ehrendorfer", RedListUtil.uuidClassificationE, "Ehrendorfer", null, RedListUtil.uuidClassificationReferenceE, state);
84
        makeClassification("Wisskirchen (Standardliste)", RedListUtil.uuidClassificationW, "Wisskirchen (Standardliste)", 1998, RedListUtil.uuidClassificationReferenceW, state);
85
        makeClassification("Korneck (Rote Liste)", RedListUtil.uuidClassificationK, "Korneck (Rote Liste)", 1996, RedListUtil.uuidClassificationReferenceK, state);
86
        makeClassification("Atlas (Westdeutschland)", RedListUtil.uuidClassificationAW, "Atlas (Westdeutschland)", 1988, RedListUtil.uuidClassificationReferenceAW, state);
87
        makeClassification("Atlas (Ostdeutschland)", RedListUtil.uuidClassificationAO, "Atlas (Ostdeutschland)", 1996, RedListUtil.uuidClassificationReferenceAO, state);
88
        makeClassification("Rothmaler", RedListUtil.uuidClassificationR, "Rothmaler", 2011, RedListUtil.uuidClassificationReferenceR, state);
89
        makeClassification("Oberdorfer", RedListUtil.uuidClassificationO, "Oberdorfer", 2001, RedListUtil.uuidClassificationReferenceO, state);
90
        makeClassification("Schmeil-Fitschen", RedListUtil.uuidClassificationS, "Schmeil-Fitschen", 2011, RedListUtil.uuidClassificationReferenceS, state);
91
//        importFamilies(gesamtListe, checkliste, state);
92
        super.doInvoke(state);
93
    }
94

    
95

    
96
    private void importFamilies(Classification gesamtListe, Classification checkliste, RedListGefaesspflanzenImportState state) {
97
        for(UUID uuid:state.getFamilyMapGesamtListe().values()){
98
            Taxon familyGL = HibernateProxyHelper.deproxy(getTaxonService().load(uuid, Arrays.asList(new String[]{"*"})), Taxon.class);
99
            Taxon familyCL = (Taxon) familyGL.clone();
100
            getTaxonService().saveOrUpdate(familyCL);
101

    
102
            gesamtListe.addParentChild(null, familyGL, null, null);
103
            familyGL.setSec(gesamtListe.getReference());
104
            familyGL.setTitleCache(null);
105

    
106
            checkliste.addParentChild(null, familyCL, null, null);
107
            familyCL.setSec(checkliste.getReference());
108
            familyCL.setTitleCache(null);
109

    
110
            getClassificationService().saveOrUpdate(gesamtListe);
111
            getClassificationService().saveOrUpdate(checkliste);
112
        }
113
    }
114

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

    
134
            }
135
        } catch (SQLException e) {
136
            e.printStackTrace();
137
        }
138

    
139
        logger.info("Update classification (1000 nodes)");
140
        getClassificationService().saveOrUpdate(gesamtListeClassification);
141
        getClassificationService().saveOrUpdate(checklistClassification);
142
        getClassificationService().saveOrUpdate(classificationE);
143
        getClassificationService().saveOrUpdate(classificationW);
144
        getClassificationService().saveOrUpdate(classificationK);
145
        getClassificationService().saveOrUpdate(classificationAW);
146
        getClassificationService().saveOrUpdate(classificationAO);
147
        getClassificationService().saveOrUpdate(classificationR);
148
        getClassificationService().saveOrUpdate(classificationO);
149
        getClassificationService().saveOrUpdate(classificationS);
150
        return true;
151
    }
152

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

    
165
        String relationE = rs.getString(RedListUtil.E);
166
        String relationW = rs.getString(RedListUtil.W);
167
        String relationK = rs.getString(RedListUtil.K);
168
        String relationAW = rs.getString(RedListUtil.AW);
169
        String relationAO = rs.getString(RedListUtil.AO);
170
        String relationR = rs.getString(RedListUtil.R);
171
        String relationO = rs.getString(RedListUtil.O);
172
        String relationS = rs.getString(RedListUtil.S);
173

    
174
        //Gesamtliste
175
        TaxonBase<?> taxonBaseGL = state.getRelatedObject(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, String.valueOf(id), TaxonBase.class);
176
        Taxon parentGL = state.getRelatedObject(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, parentId, Taxon.class);
177
        if(parentGL!=null && !parentGL.isInstanceOf(Taxon.class)){
178
            RedListUtil.logMessage(id, parentGL+" is no taxon but is a parent of "+taxonBaseGL+" (Gesamtliste)", logger);
179
        }
180
        //add to family if no parent found
181
        if(parentGL==null){
182
            if(!taxonBaseGL.isInstanceOf(Taxon.class)){
183
                RedListUtil.logMessage(id, taxonBaseGL+" has no parent but is not a taxon.", logger);
184
            }
185
            else{
186
                Taxon family = (Taxon) state.getRelatedObject(RedListUtil.FAMILY_NAMESPACE_GESAMTLISTE, familieString);
187
                gesamtListeClassification.addParentChild(family, HibernateProxyHelper.deproxy(taxonBaseGL, Taxon.class), null, null);
188
                if(family.getTaxonNodes().isEmpty()){
189
                    gesamtListeClassification.addChildTaxon(family, null, null);
190
                }
191
            }
192
        }
193
        //add to higher taxon
194
        else{
195
            createParentChildNodes(gesamtListeClassification, id, gueltString, taxZusatzString, taxonBaseGL, parentGL);
196
        }
197

    
198
        //Checkliste
199
        TaxonBase<?> taxonBaseCL = state.getRelatedObject(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, String.valueOf(id), TaxonBase.class);
200
        Taxon parentCL = state.getRelatedObject(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, parentId, Taxon.class);
201
        if(parentCL!=null && !parentCL.isInstanceOf(Taxon.class)){
202
            RedListUtil.logMessage(id, parentCL+" is no taxon but is a parent of "+taxonBaseCL+" (Checkliste)", logger);
203
        }
204
        if(taxonBaseCL!=null){//null check necessary because not all taxa exist in the checklist
205
            //add to family if no parent found
206
            if(parentCL==null){
207
                if(!taxonBaseCL.isInstanceOf(Taxon.class)){
208
                    RedListUtil.logMessage(id, taxonBaseCL+" has no parent but is not a taxon.", logger);
209
                }
210
                else{
211
                    Taxon family = (Taxon) state.getRelatedObject(RedListUtil.FAMILY_NAMESPACE_CHECKLISTE, familieString);
212
                    checklistClassification.addParentChild(family, HibernateProxyHelper.deproxy(taxonBaseCL, Taxon.class), null, null);
213
                    if(family.getTaxonNodes().isEmpty()){
214
                        checklistClassification.addChildTaxon(family, null, null);
215
                    }
216
                }
217
            }
218
            //add to higher taxon
219
            else{
220
                createParentChildNodes(checklistClassification, id, gueltString, taxZusatzString, taxonBaseCL, parentCL);
221
            }
222
        }
223

    
224
        //check uuids
225
        if(taxonBaseGL!= null && taxonBaseCL!=null
226
                && taxonBaseGL.getUuid().equals(taxonBaseCL.getUuid())){
227
            RedListUtil.logMessage(id, "Same UUID for "+taxonBaseGL+ " (Gesamtliste) and "+taxonBaseCL+" (Checkliste)", logger);
228
        }
229
        if(parentGL!=null && parentCL!=null && parentGL.getUuid().equals(parentCL.getUuid())){
230
            RedListUtil.logMessage(id, "Same UUID for "+parentGL+ " (Gesamtliste) and "+parentCL+" (Checkliste)", logger);
231
        }
232

    
233
        //add taxa for concept relationships to E, W, K, AW, AO, R, O, S
234
        addTaxonToClassification(classificationE, RedListUtil.CLASSIFICATION_NAMESPACE_E, relationE, taxonBaseGL, taxonBaseCL, id, state);
235
        addTaxonToClassification(classificationW, RedListUtil.CLASSIFICATION_NAMESPACE_W, relationW, taxonBaseGL, taxonBaseCL, id, state);
236
        addTaxonToClassification(classificationK, RedListUtil.CLASSIFICATION_NAMESPACE_K, relationK, taxonBaseGL, taxonBaseCL, id, state);
237
        addTaxonToClassification(classificationAW, RedListUtil.CLASSIFICATION_NAMESPACE_AW, relationAW, taxonBaseGL, taxonBaseCL, id, state);
238
        addTaxonToClassification(classificationAO, RedListUtil.CLASSIFICATION_NAMESPACE_AO, relationAO, taxonBaseGL, taxonBaseCL, id, state);
239
        addTaxonToClassification(classificationR, RedListUtil.CLASSIFICATION_NAMESPACE_R, relationR, taxonBaseGL, taxonBaseCL, id, state);
240
        addTaxonToClassification(classificationO, RedListUtil.CLASSIFICATION_NAMESPACE_O, relationO, taxonBaseGL, taxonBaseCL, id, state);
241
        addTaxonToClassification(classificationS, RedListUtil.CLASSIFICATION_NAMESPACE_S, relationS, taxonBaseGL, taxonBaseCL, id, state);
242
    }
243

    
244

    
245

    
246
    private void addTaxonToClassification(Classification classification, String classificationNamespace, String relationString, final TaxonBase<?> gesamtListeTaxon, final TaxonBase<?> checklisteTaxon, long id, RedListGefaesspflanzenImportState state){
247
        Taxon taxon = HibernateProxyHelper.deproxy(state.getRelatedObject(classificationNamespace, String.valueOf(id), TaxonBase.class), Taxon.class);
248
        //add concept relation to gesamtliste and checkliste
249
        if(taxon!=null && CdmUtils.isNotBlank(relationString) && !relationString.equals(".")){
250
            //if the related concept in gesamtliste/checkliste is a synonym then we
251
            //create a relation to the accepted taxon
252
            Taxon acceptedGesamtListeTaxon = getAcceptedTaxon(gesamtListeTaxon);
253
            Taxon acceptedChecklistTaxon = getAcceptedTaxon(checklisteTaxon);
254
            String relationSubstring = relationString.substring(relationString.length()-1, relationString.length());
255
            TaxonRelationshipType taxonRelationshipTypeByKey = new RedListGefaesspflanzenTransformer().getTaxonRelationshipTypeByKey(relationSubstring);
256
            if(taxonRelationshipTypeByKey==null){
257
                RedListUtil.logMessage(id, "Could not interpret relationship "+relationString+" for taxon "+gesamtListeTaxon.generateTitle(), logger);
258
            }
259
            //there is no type "included in" so we have to reverse the direction
260
            if(relationSubstring.equals("<")){
261
                if(acceptedGesamtListeTaxon!=null){
262
                    acceptedGesamtListeTaxon.addTaxonRelation(taxon, taxonRelationshipTypeByKey, null, null);
263
                }
264
                if(acceptedChecklistTaxon!=null) {
265
                    acceptedChecklistTaxon.addTaxonRelation(taxon, taxonRelationshipTypeByKey, null, null);
266
                }
267
            }
268
            else{
269
                if(acceptedGesamtListeTaxon!=null){
270
                    taxon.addTaxonRelation(acceptedGesamtListeTaxon, taxonRelationshipTypeByKey, null, null);
271
                }
272
                if(acceptedChecklistTaxon!=null) {
273
                    taxon.addTaxonRelation(acceptedChecklistTaxon, taxonRelationshipTypeByKey, null, null);
274
                }
275
            }
276

    
277
            taxon.setSec(classification.getReference());
278
            classification.addChildTaxon(taxon, null, null);
279
            taxon.setTitleCache(null);//Reset title cache to see sec ref in title
280
        }
281
    }
282

    
283
    private void createParentChildNodes(Classification classification, long id, String gueltString,
284
            String taxZusatzString, TaxonBase<?> taxonBase, Taxon parent) {
285
        if(taxonBase==null){
286
            RedListUtil.logMessage(id, "child taxon/synonym of "+parent+"  is null. ("+classification.generateTitle()+")" , logger);
287
            return;
288
        }
289
        //taxon
290
        if(taxonBase.isInstanceOf(Taxon.class)){
291
            //misapplied name
292
            String appendedPhrase = taxonBase.getAppendedPhrase();
293
            if(appendedPhrase!=null && appendedPhrase.equals(RedListUtil.AUCT)){
294
                if(parent==null){
295
                    RedListUtil.logMessage(id, "parent taxon of misapplied name "+taxonBase+"  is null. ("+classification.getTitleCache()+")" , logger);
296
                    return;
297
                }
298
                parent.addMisappliedName((Taxon) taxonBase, null, null);
299
            }
300
            else{
301
                classification.addParentChild(parent, (Taxon)taxonBase, null, null);
302
            }
303

    
304
            if(CdmUtils.isNotBlank(taxZusatzString)){
305
                if(taxZusatzString.trim().equals("p. p.")){
306
                    RedListUtil.logMessage(id, "pro parte for accepted taxon "+taxonBase, logger);
307
                }
308
            }
309
        }
310
        //synonym
311
        else if(taxonBase.isInstanceOf(Synonym.class)){
312
            if(parent==null){
313
                RedListUtil.logMessage(id, "parent taxon of synonym "+taxonBase+"  is null. ("+classification.getTitleCache()+")" , logger);
314
                return;
315
            }
316
            //basionym
317
            if(gueltString.equals(RedListUtil.GUELT_BASIONYM)){
318
                parent.addHomotypicSynonym((Synonym) taxonBase);
319
                parent.getName().addBasionym(taxonBase.getName());
320
            }
321
            //regular synonym
322
            else{
323
                Synonym synonym = (Synonym) taxonBase;
324
                parent.addSynonym((Synonym) taxonBase, SynonymType.HETEROTYPIC_SYNONYM_OF());
325

    
326
                //TAX_ZUSATZ
327
                if(CdmUtils.isNotBlank(taxZusatzString)){
328
                    if(taxZusatzString.trim().equals("p. p.")){
329
                        synonym.setProParte(true);
330
                    }
331
                    else if(taxZusatzString.trim().equals("s. l. p. p.")){
332
                        synonym.setProParte(true);
333
                        taxonBase.setAppendedPhrase("s. l.");
334
                    }
335
                    else if(taxZusatzString.trim().equals("s. str. p. p.")){
336
                        synonym.setProParte(true);
337
                        taxonBase.setAppendedPhrase("s. str.");
338
                    }
339
                    else if(taxZusatzString.trim().equals("s. l.")
340
                            || taxZusatzString.trim().equals("s. str.")){
341
                        taxonBase.setAppendedPhrase(taxZusatzString);
342
                    }
343
                    else{
344
                        RedListUtil.logMessage(id, "unknown value "+taxZusatzString+" for column "+RedListUtil.TAX_ZUSATZ, logger);
345
                    }
346
                }
347
            }
348
        }
349
        //set sec reference
350
        taxonBase.setSec(classification.getReference());
351
        taxonBase.setTitleCache(null, false);//refresh title cache
352
    }
353

    
354
    @Override
355
    public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs,
356
            RedListGefaesspflanzenImportState state) {
357
        Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<>();
358

    
359
        Set<String> idSet = new HashSet<String>();
360
        try {
361
            while (rs.next()){
362
                idSet.add(String.valueOf(rs.getLong(RedListUtil.NAMNR)));
363
                idSet.add(String.valueOf(rs.getLong(RedListUtil.LOWER)));
364
            }
365
        } catch (SQLException e) {
366
            e.printStackTrace();
367
        }
368
        //add taxa and their parent taxa
369
        result.put(RedListUtil.TAXON_GESAMTLISTE_NAMESPACE, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.TAXON_GESAMTLISTE_NAMESPACE));
370
        result.put(RedListUtil.TAXON_CHECKLISTE_NAMESPACE, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.TAXON_CHECKLISTE_NAMESPACE));
371
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_E, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_E));
372
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_W, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_W));
373
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_K, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_K));
374
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_AW, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_AW));
375
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_AO, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_AO));
376
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_R, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_R));
377
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_O, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_O));
378
        result.put(RedListUtil.CLASSIFICATION_NAMESPACE_S, (Map<String, TaxonBase>) getCommonService().getSourcedObjectsByIdInSource(TaxonBase.class, idSet, RedListUtil.CLASSIFICATION_NAMESPACE_S));
379

    
380
        //add families
381
        //gesamtliste
382
        Map<String, Taxon> familyMapGL = new HashMap<String, Taxon>();
383
        for (Entry<String, UUID> entry: state.getFamilyMapGesamtListe().entrySet()) {
384
            familyMapGL.put(entry.getKey(), HibernateProxyHelper.deproxy(getTaxonService().load(entry.getValue()), Taxon.class));
385
        }
386
        result.put(RedListUtil.FAMILY_NAMESPACE_GESAMTLISTE, familyMapGL);
387
        //checkliste
388
        Map<String, Taxon> familyMapCL = new HashMap<String, Taxon>();
389
        for (Entry<String, UUID> entry: state.getFamilyMapCheckliste().entrySet()) {
390
            familyMapCL.put(entry.getKey(), HibernateProxyHelper.deproxy(getTaxonService().load(entry.getValue()), Taxon.class));
391
        }
392
        result.put(RedListUtil.FAMILY_NAMESPACE_CHECKLISTE, familyMapCL);
393
        return result;
394
    }
395

    
396
    private Classification makeClassification(String classificationName, UUID classificationUuid, String referenceName, Integer yearPublished, UUID referenceUuid, RedListGefaesspflanzenImportState state) {
397
        Classification classification = Classification.NewInstance(classificationName, Language.DEFAULT());
398
        classification.setUuid(classificationUuid);
399
        Reference reference = ReferenceFactory.newGeneric();
400
        reference.setTitle(referenceName);
401
        reference.setUuid(referenceUuid);
402
        classification.setReference(reference);
403
        if(yearPublished!=null){
404
            reference.setDatePublished(TimePeriod.NewInstance(yearPublished));
405
        }
406
        return getClassificationService().save(classification);
407
    }
408

    
409
    @Override
410
    protected boolean doCheck(RedListGefaesspflanzenImportState state) {
411
        return false;
412
    }
413

    
414
    @Override
415
    protected boolean isIgnore(RedListGefaesspflanzenImportState state) {
416
        return false;
417
    }
418

    
419
}
(2-2/9)