Project

General

Profile

Revision caac9df5

IDcaac9df5602a01f5a93e3ab3006a04bedafcc214
Parent c02db033
Child 2a055418

Added by Katja Luther 9 months ago

ref #8819: handle cf and aff names in abcd import

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/SpecimenImportBase.java
608 608
		                return existingSpecimens.getRecords().iterator().next();
609 609
		            }
610 610
		        }
611
	        
611

  
612 612
	        }catch(NullPointerException e){
613 613
	        	logger.error("searching for existing specimen creates NPE: " + config.getSignificantIdentifier());
614 614
	        	e.printStackTrace();
615
	        }   
616
	        
617
	        
615
	        }
616

  
617

  
618 618
	        return null;
619 619
	    }
620 620

  
......
861 861
	                    parent = linkParentChildNode(species, subspecies, classification, state);
862 862
	                }
863 863
	            }
864
	        }else{
865
	            //handle cf. and aff. taxa
866
	            String genusEpithet = null;
867
	            if (nvname.getTitleCache().contains("cf.")){
868
	                genusEpithet = nvname.getTitleCache().substring(0, nvname.getTitleCache().indexOf("cf."));
869
	            } else if (nvname.getTitleCache().contains("aff.")){
870
	                genusEpithet = nvname.getTitleCache().substring(0, nvname.getTitleCache().indexOf("aff."));
871
	            }
872
	            if (genusEpithet != null){
873
    	            genusEpithet = genusEpithet.trim();
874
    	            TaxonName taxonName = null;
875
    	            if (genusEpithet.contains(" ")){
876
    	                taxonName = getOrCreateTaxonName(genusEpithet, Rank.SPECIES(), preferredFlag, state, -1);
877
    	            }else{
878
    	                taxonName = getOrCreateTaxonName(genusEpithet, Rank.GENUS(), preferredFlag, state, -1);
879
    	            }
880
    	            genus = getOrCreateTaxonForName(taxonName, state);
881
                    if (genus == null){
882
                        logger.debug("The genus should not be null " + taxonName);
883
                    }
884
                    if (preferredFlag) {
885
                        parent = linkParentChildNode(null, genus, classification, state);
886
                    }
887
	            }
864 888
	        }
865 889
	        if (preferredFlag && parent!=taxon ) {
866 890
	            linkParentChildNode(parent, taxon, classification, state);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)