Project

General

Profile

Download (2.44 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.util.HashMap;
14
import java.util.Map;
15

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

    
19
import eu.etaxonomy.cdm.io.common.DbImportBase;
20
import eu.etaxonomy.cdm.io.common.ResultSetPartitioner;
21
import eu.etaxonomy.cdm.model.common.CdmBase;
22
import eu.etaxonomy.cdm.model.common.Language;
23
import eu.etaxonomy.cdm.model.name.Rank;
24

    
25
/**
26
 *
27
 * @author pplitzner
28
 * @date Mar 1, 2016
29
 *
30
 */
31

    
32
@Component
33
@SuppressWarnings("serial")
34
public class RedListGefaesspflanzenImportRank extends DbImportBase<RedListGefaesspflanzenImportState, RedListGefaesspflanzenImportConfigurator> {
35

    
36
    private static final Logger logger = Logger.getLogger(RedListGefaesspflanzenImportRank.class);
37

    
38
    private static final String tableName = "Rote Liste Gefäßpflanzen";
39

    
40
    private static final String pluralString = "ranks";
41

    
42

    
43
    public RedListGefaesspflanzenImportRank() {
44
        super(tableName, pluralString);
45
    }
46

    
47
    @Override
48
    protected String getIdQuery(RedListGefaesspflanzenImportState state) {
49
        return null;
50
    }
51

    
52
    @Override
53
    protected String getRecordQuery(RedListGefaesspflanzenImportConfigurator config) {
54
        return null;
55
    }
56

    
57
    @Override
58
    protected void doInvoke(RedListGefaesspflanzenImportState state) {
59
        Rank rank = (Rank) getTermService().load(Rank.uuidInfraspecificTaxon);
60
        rank.getRepresentation(Language.DEFAULT()).setAbbreviatedLabel("[unranked]");
61
        getTermService().saveOrUpdate(rank);
62
    }
63

    
64

    
65
    @Override
66
    public boolean doPartition(ResultSetPartitioner partitioner, RedListGefaesspflanzenImportState state) {
67
        return true;
68
    }
69

    
70
    @Override
71
    public Map<Object, Map<String, ? extends CdmBase>> getRelatedObjectsForPartition(ResultSet rs,
72
            RedListGefaesspflanzenImportState state) {
73
        Map<Object, Map<String, ? extends CdmBase>> result = new HashMap<>();
74
        return result;
75
    }
76

    
77
    @Override
78
    protected boolean doCheck(RedListGefaesspflanzenImportState state) {
79
        return false;
80
    }
81

    
82
    @Override
83
    protected boolean isIgnore(RedListGefaesspflanzenImportState state) {
84
        return false;
85
    }
86

    
87
}
(6-6/9)