Revision b7f82569
Added by Alexander Oppermann almost 9 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/redlist/bfnXml/BfnXmlImportTaxonName.java | ||
---|---|---|
29 | 29 |
import eu.etaxonomy.cdm.common.XmlHelp; |
30 | 30 |
import eu.etaxonomy.cdm.io.common.ICdmIO; |
31 | 31 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
32 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
|
32 | 33 |
import eu.etaxonomy.cdm.model.common.Language; |
33 | 34 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
34 | 35 |
import eu.etaxonomy.cdm.model.description.CategoricalData; |
... | ... | |
836 | 837 |
|
837 | 838 |
String strDistributionValue = elInfoDetail.getChild("WERT").getValue(); |
838 | 839 |
String strGermanState = elInfoDetail.getAttributeValue("standardname"); |
839 |
//TODO match DistributionValue
|
|
840 |
//match DistributionValue |
|
840 | 841 |
UUID matchedDistributionUUID = null; |
842 |
PresenceAbsenceTerm status = null; |
|
841 | 843 |
try { |
842 | 844 |
matchedDistributionUUID = BfnXmlTransformer.matchDistributionValue(strDistributionValue); |
845 |
DefinedTermBase load = getTermService().load(matchedDistributionUUID); |
|
846 |
if(load.isInstanceOf(PresenceAbsenceTerm.class)) { |
|
847 |
status = CdmBase.deproxy(load, PresenceAbsenceTerm.class); |
|
848 |
}else{ |
|
849 |
logger.warn(strDistributionValue + " is not PresenceAbsence Term " + load.getTitleCache() + " " + load.getTermType().toString()); |
|
850 |
return; |
|
851 |
} |
|
843 | 852 |
} catch (UnknownCdmTypeException e1) { |
844 | 853 |
logger.warn("could not match xml value "+ strDistributionValue +" to distribution status for "+strGermanState); |
845 | 854 |
e1.printStackTrace(); |
846 | 855 |
return; |
847 | 856 |
} |
848 |
PresenceAbsenceTerm status = (PresenceAbsenceTerm) getTermService().load(matchedDistributionUUID); |
|
849 |
//TODO load vocabulary and german state |
|
857 |
//load vocabulary and german state |
|
850 | 858 |
UUID vocabularyUUID = null; |
851 | 859 |
TermVocabulary vocabulary = null; |
852 | 860 |
UUID stateUUID = null; |
... | ... | |
880 | 888 |
// } |
881 | 889 |
// |
882 | 890 |
// } |
883 |
//TODO create new taxon description
|
|
891 |
//create new taxon description |
|
884 | 892 |
DescriptionElementBase descriptionElement = Distribution.NewInstance(area, status); |
885 | 893 |
taxonDescription.addElement(descriptionElement); |
886 | 894 |
} |
Also available in: Unified diff
fixed class cast exception in importer