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) {