Project

General

Profile

« Previous | Next » 

Revision c167aac2

Added by Andreas Kohlbecker over 6 years ago

ref #6026 importing Basionyms

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/app/iapt/IAPTActivator.java
40 40
    public static final String DATA_ENCODING_PROBLEMS = "encoding-problems.xls";
41 41
    public static final String DATA_IAPT_TYPES_100 = "iapt-types-100.xls";
42 42
    public static final String DATA_TYPE_LEG_100 = "iapt-type-leg-100.xls";
43
    public static final String DATA_FILE = DATA_TYPE_LEG_100;   
43
    public static final String DATA_FILE = DATA_FILE_0_100;
44 44

  
45 45
    //database validation status (create, update, validate ...)
46 46
    static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;
app-import/src/main/java/eu/etaxonomy/cdm/io/iapt/IAPTExcelImport.java
176 176
        String notesTxt = getValue(record, NOTESTXT, true);
177 177
        String caveats = getValue(record, CAVEATS, true);
178 178
        String fullSynSubstStr = getValue(record, FULLSYNSUBST, true);
179
        String fullBasionymStr = getValue(record, FULLBASIONYM, true);
180
        String basionymNameStr = getValue(record, FULLBASIONYM, true);
179 181
        String synSubstStr = getValue(record, SYNSUBSTSTR, true);
180 182
        String typeStr = getValue(record, TYPE, true);
181 183

  
......
226 228
            caveats = caveats.replace("Caveats: ", "").trim();
227 229
            taxonName.addAnnotation(Annotation.NewInstance(caveats, annotationTypeCaveats(), Language.DEFAULT()));
228 230
        }
229
        //
231

  
232
        getNameService().save(taxonName);
230 233

  
231 234
        // Namerelations
232 235
        if(!StringUtils.isEmpty(authorsSpelling)){
......
265 268
        Reference sec = state.getConfig().getSecReference();
266 269
        Taxon taxon = Taxon.NewInstance(taxonName, sec);
267 270

  
271
        // Basionym
272
        if(fullBasionymStr != null){
273
            fullBasionymStr = fullBasionymStr.replaceAll("^\\w*:\\s", ""); // Strip off the leading 'Basionym: "
274
            BotanicalName basionym = makeBotanicalName(state, regNumber, fullBasionymStr, basionymNameStr, null, null);
275
            getNameService().save(basionym);
276
            taxonName.addBasionym(basionym);
277

  
278
            Synonym syn = Synonym.NewInstance(basionym, sec);
279
            taxon.addSynonym(syn, SynonymRelationshipType.HOMOTYPIC_SYNONYM_OF());
280
            getTaxonService().save(syn);
281
        }
282

  
268 283
        // Markers
269 284
        if(isFossil){
270 285
            taxon.addMarker(Marker.NewInstance(markerTypeFossil(), true));
......
654 669
        if(titleCacheStr.endsWith(ANNOTATION_MARKER_STRING) || (authorStr != null && authorStr.endsWith(ANNOTATION_MARKER_STRING))){
655 670
            nameAnnotations.put("Author abbreviation not checked.", AnnotationType.EDITORIAL());
656 671
            titleCacheStr = titleCacheStr.replace(ANNOTATION_MARKER_STRING, "").trim();
657
            authorStr = authorStr.replace(ANNOTATION_MARKER_STRING, "").trim();
672
            if(authorStr != null) {
673
                authorStr = authorStr.replace(ANNOTATION_MARKER_STRING, "").trim();
674
            }
658 675
        }
659 676

  
660 677
        // parse the full taxon name

Also available in: Unified diff