Project

General

Profile

« Previous | Next » 

Revision 017d8abd

Added by Patrick Plitzner about 5 years ago

Only add example annotation when it exists

View differences:

app-import/src/main/java/eu/etaxonomy/cdm/io/plantglossary/PlantGlossaryStateImport.java
15 15
import org.apache.log4j.Logger;
16 16
import org.springframework.stereotype.Component;
17 17

  
18
import eu.etaxonomy.cdm.common.CdmUtils;
18 19
import eu.etaxonomy.cdm.io.csv.in.CsvImportBase;
19 20
import eu.etaxonomy.cdm.model.common.Annotation;
20 21
import eu.etaxonomy.cdm.model.common.AnnotationType;
......
56 57
        State stateTerm = State.NewInstance(currentRecord.get(HEADER_DEFINITION), termLabel, null);
57 58
        stateTerm.setIdInVocabulary(termLabel);
58 59
        stateTerm.setUri(URI.create(currentRecord.get(HEADER_URI)));
59
        stateTerm.addAnnotation(Annotation.NewInstance(currentRecord.get(HEADER_NOTES), AnnotationType.EDITORIAL(), Language.ENGLISH()));
60
        if(CdmUtils.isNotBlank(currentRecord.get(HEADER_NOTES))){
61
            stateTerm.addAnnotation(Annotation.NewInstance(currentRecord.get(HEADER_NOTES), AnnotationType.EDITORIAL(), Language.ENGLISH()));
62
        }
60 63

  
61 64
        String vocName = currentRecord.get(HEADER_CATEGORY);
62 65
        // TODO how should we handle multiple possible categories?

Also available in: Unified diff