import eu.etaxonomy.cdm.model.media.MediaRepresentationPart;
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
import eu.etaxonomy.cdm.model.name.NameRelationship;
+import eu.etaxonomy.cdm.model.name.NameRelationshipType;
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
import eu.etaxonomy.cdm.model.name.Rank;
for (NameRelationship rel : fromRels) {
ColDpNameRelType coldpType = transformer.getColDpNameRelTypeByNameRelationType(rel.getType());
if (coldpType == null) {
- //TODO warning
+ handleNoColDpNameRelType(state, rel.getType(), name);
+ continue;
}else if (coldpType.getDirection() == 0) {
continue; //the relation is handled the other way round if necessary
}
for (NameRelationship rel : toRels) {
ColDpNameRelType coldpType = transformer.getColDpNameRelTypeByNameRelationType(rel.getType());
if (coldpType == null) {
- //TODO warning
+ handleNoColDpNameRelType(state, rel.getType(), name);
+ continue;
}else if (coldpType.getDirection() == 1) {
continue; //the relation is handled the other way round if necessary
}
}
}
+ private void handleNoColDpNameRelType(ColDpExportState state, NameRelationshipType nameRelType, TaxonName taxonName) {
+ String warning;
+ if (nameRelType == null) {
+ warning = "Name relationship has not type for name " + taxonName.getTitleCache();
+ } else {
+ //TODO misspelling, alternative name, blocking name for, avoids homonym of, unspecific "non"
+ warning = "Name relationship type not yet handled by COL-DP: " + nameRelType.getTitleCache() + "; name: " + taxonName.getTitleCache();
+ }
+ state.getResult().addWarning(warning);
+ }
+
private void handleRelNameCommonData(ColDpExportState state, ColDpExportTable table,
NameRelationship rel, TaxonName name, TaxonName relatedName, ColDpNameRelType coldpType) {
} else {
//TODO misspelling, alternative name, blocking name for, avoids homonym of, unspecific "non"
String warning = "Name relationship type not yet handled by COL-DP: " + nameRelType.getTitleCache();
- //TODO handle warning
+ //TODO handle warning, is currently handled in calling method
Representation preferredRep = nameRelType.getPreferredRepresentation(Language.ENGLISH());
// if (preferredRep != null) {
// return preferredRep.getLabel() == null ? null :preferredRep.getLabel().toLowerCase();