Project

General

Profile

Download (1.85 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2017 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
package eu.etaxonomy.cdm.io.fact.temporal.in;
10

    
11
import java.util.Map;
12
import java.util.UUID;
13

    
14
import org.springframework.stereotype.Component;
15

    
16
import eu.etaxonomy.cdm.model.description.Feature;
17
import eu.etaxonomy.cdm.model.taxon.Taxon;
18

    
19
/**
20
 * Import for taxon based phenology data.
21
 *
22
 * @author a.mueller
23
 * @since 15.07.2020
24
 */
25
@Component
26
public class PhenologyExcelImport
27
        extends TemporalDataExcelImport<PhenologyExcelImportState, PhenologyExcelImportConfigurator>{
28

    
29
    private static final long serialVersionUID = 1050528888222978429L;
30

    
31
    public static final String FLOWERING_START = "Flowering start";
32
    public static final String FLOWERING_END = "Flowering end";
33
    public static final String FRUITING_START = "Fruiting start";
34
    public static final String FRUITING_END = "Fruiting end";
35

    
36
    @Override
37
    protected void doFirstPass(PhenologyExcelImportState state, Taxon taxon,
38
            String line, String linePure){
39

    
40
        super.doFirstPass(state, taxon, line, linePure);
41

    
42
        if (taxon == null){
43
//            return;
44
            taxon = Taxon.NewInstance(null, null);
45
        }
46

    
47
        Map<String, String> record = state.getOriginalRecord();
48

    
49
        UUID uuidFeatureFruiting = state.getConfig().getFruitingFeatureUuid();
50
        Feature featureFruiting = (Feature)getTermService().find(uuidFeatureFruiting);
51
        String colFruitingStart = state.getConfig().getFruitingStartColumnLabel();
52
        String colFruitingEnd = state.getConfig().getFruitingEndColumnLabel();
53

    
54
        handleFeature(state, taxon, line, linePure, record, featureFruiting, colFruitingStart, colFruitingEnd);
55
    }
56
}
(2-2/8)