Project

General

Profile

Revision 49db4e78

ID49db4e78808aa6e0753412020e0e27895af12626
Parent 2eb8c59a
Child 5cf1f8e1

Added by Andreas Müller 7 months ago

fix #9041 final changes to AltitudeExcelImport

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/fact/altitude/in/AltitudeExcelImport.java
16 16
import eu.etaxonomy.cdm.io.excel.common.ExcelRowBase;
17 17
import eu.etaxonomy.cdm.io.fact.in.FactExcelImportBase;
18 18
import eu.etaxonomy.cdm.model.description.Feature;
19
import eu.etaxonomy.cdm.model.description.MeasurementUnit;
19 20
import eu.etaxonomy.cdm.model.description.QuantitativeData;
20 21
import eu.etaxonomy.cdm.model.description.TaxonDescription;
21 22
import eu.etaxonomy.cdm.model.reference.Reference;
22 23
import eu.etaxonomy.cdm.model.taxon.Taxon;
23 24

  
24 25
/**
26
 * Import for taxon based altitude data as quantitative data.
25 27
 *
26 28
 * @author a.mueller
27 29
 * @since 28.05.2020
......
43 45
//            return;
44 46
            taxon = Taxon.NewInstance(null, null);
45 47
        }
46
        UUID uuid = Feature.uuidAltitude;
48
        UUID featureUuid = Feature.uuidAltitude;
47 49
        String featureLabel = "Altitude";
48
        Feature feature = getFeature(state, uuid);
50
        Feature feature = getFeature(state, featureUuid);
49 51
        if (feature == null){
50
            feature = getFeature(state, uuid, featureLabel, featureLabel, null, null);
52
            feature = getFeature(state, featureUuid, featureLabel, featureLabel, null, null);
51 53
        }
52 54

  
55
        UUID measurementUnitUuid = MeasurementUnit.uuidMeter;
56
        MeasurementUnit unit = getMeasurementUnit(state, measurementUnitUuid, null, null, null, null);
57
        //TODO log error if unit is not persistent yet or handle like for feature first part
58

  
53 59
        String minStr = getValue(state, COL_ALTITUDE_MIN);
54 60
        String maxStr = getValue(state, COL_ALTITUDE_MAX);
55 61

  
......
59 65
            state.addError("No minimum and no maximum exists. Record not imported.");
60 66
            return;
61 67
        }
62
        QuantitativeData qd = QuantitativeData.NewMinMaxInstance(feature, min, max);
68
        QuantitativeData qd = QuantitativeData.NewMinMaxInstance(feature, unit, min, max);
63 69

  
64 70
        //source
65 71
        String id = null;
66 72
        String idNamespace = null;
67 73
        Reference reference = getSourceReference(state);
68 74

  
69

  
75
        //description
70 76
        TaxonDescription taxonDescription = this.getTaxonDescription(taxon, reference, !IMAGE_GALLERY, true);
71 77
        taxonDescription.addElement(qd);
72 78
        qd.addImportSource(id, idNamespace, reference, linePure);
......
87 93
    }
88 94

  
89 95
    @Override
96
    protected boolean requiresNomenclaturalCode() {
97
        return false;
98
    }
99

  
100
    @Override
90 101
    protected boolean isIgnore(AltitudeExcelImportState state) {
91 102
        return false;
92 103
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)