Project

General

Profile

Revision 15b4b2c0

ID15b4b2c053f5fe15d3178f344247ed0a16dc3b88
Parent adfafad3
Child 67cecfbb

Added by Patrick Plitzner almost 3 years ago

#5251 Fix Incorrect taxon source attachments

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/abcd206/in/Abcd206Import.java
799 799
            if (state.getDataHolder().recordBasis.toLowerCase().startsWith("s") || state.getDataHolder().recordBasis.toLowerCase().indexOf("specimen")>-1) {// specimen
800 800
                type = SpecimenOrObservationType.PreservedSpecimen;
801 801
            }
802
            if (state.getDataHolder().recordBasis.toLowerCase().startsWith("o") ||state.getDataHolder().recordBasis.toLowerCase().indexOf("observation")>-1 ) {
802
            else if (state.getDataHolder().recordBasis.toLowerCase().startsWith("o") ||state.getDataHolder().recordBasis.toLowerCase().indexOf("observation")>-1 ) {
803 803
                type = SpecimenOrObservationType.Observation;
804 804
            }
805
            if (state.getDataHolder().recordBasis.toLowerCase().indexOf("fossil")>-1){
805
            else if (state.getDataHolder().recordBasis.toLowerCase().indexOf("fossil")>-1){
806 806
                type = SpecimenOrObservationType.Fossil;
807 807
            }
808
            if (state.getDataHolder().recordBasis.toLowerCase().indexOf("living")>-1) {
808
            else if (state.getDataHolder().recordBasis.toLowerCase().indexOf("living")>-1) {
809 809
                type = SpecimenOrObservationType.LivingSpecimen;
810 810
            }
811 811
            if (type == null) {
812 812
                logger.info("The basis of record does not seem to be known: " + state.getDataHolder().recordBasis);
813 813
                type = SpecimenOrObservationType.DerivedUnit;
814 814
            }
815
            // TODO fossils?
816 815
        } else {
817 816
            logger.info("The basis of record is null");
818 817
            type = SpecimenOrObservationType.DerivedUnit;
......
1077 1076
            }
1078 1077
        } else {
1079 1078
            for (TaxonDescription description : descriptions){
1080
                Set<IdentifiableSource> sources =  description.getTaxon().getSources();
1079
                Set<IdentifiableSource> sources =  new HashSet<>();
1080
                sources.addAll(description.getTaxon().getSources());
1081 1081
                sources.addAll(description.getSources());
1082 1082
                for (IdentifiableSource source:sources){
1083 1083
                    if(state.getRef().equals(source.getCitation())) {
......
1099 1099

  
1100 1100
        Map<String,OriginalSourceBase<?>> sourceMap = new HashMap<String, OriginalSourceBase<?>>();
1101 1101

  
1102
        List<IdentifiableSource> issTmp = getCommonService().list(IdentifiableSource.class, null, null, null, null);
1103
        List<DescriptionElementSource> issTmp2 = getCommonService().list(DescriptionElementSource.class, null, null, null, null);
1102
        List<IdentifiableSource> issTmp = new ArrayList<>();//getCommonService().list(IdentifiableSource.class, null, null, null, null);
1103
        List<DescriptionElementSource> issTmp2 = new ArrayList<>();//getCommonService().list(DescriptionElementSource.class, null, null, null, null);
1104 1104

  
1105 1105
        Set<OriginalSourceBase> osbSet = new HashSet<OriginalSourceBase>();
1106 1106
        if(issTmp2!=null) {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)