import eu.etaxonomy.cdm.format.taxon.TaxonRelationshipFormatter;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction;
-import eu.etaxonomy.cdm.model.common.Representation;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.cdm.model.term.Representation;
import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.cdm.strategy.cache.TagEnum;
import eu.etaxonomy.cdm.strategy.cache.TaggedCacheHelper;
TaxonRelationshipType relType = relation.getType();
if (relType != null){
- this.misapplication = relType.isMisappliedNameOrInvalidDesignation();
+ this.misapplication = relType.isMisappliedName();
this.synonym = relType.isAnySynonym();
this.typeUuid = relType.getUuid();
// TODO there must be a better DTO which also includes
Set<Representation> representations = direction.isDirect() ? relType.getRepresentations() : relType.getInverseRepresentations();
- UUID vocUuid = relType.getVocabulary() != null ? relType.getVocabulary().getUuid(): null;
- TermDto termDto = new TermDto(relType.getUuid(), representations, null, vocUuid, relType.getOrderIndex());
+ TermDto termDto = TermDto.fromTerm(relType, representations);
this.type = termDto;
// TODO localize
// termDto.localize(representation_L10n);
relations.add(relation);
}
- /**
- * @param relation
- * @param direction
- */
public TaxonRelationDTO addRelation(TaxonRelationship relation, Direction direction, List<Language> languages) {
TaxonRelationDTO newRelation = new TaxonRelationDTO(relation, direction, languages);
relations.add(newRelation);
return newRelation;
}
-
- /**
- *
- */
public void createMisapplicationString() {
List<List<TaggedText>> result = new ArrayList<>();
}
}
- /**
- * @param taggedText
- * @return
- */
private boolean tagIsSensu(TaggedText tag) {
if (tag.getType() == TagEnum.secReference ||
tag.getType() == TagEnum.secMicroReference ||
return false;
}
- /**
- * @param tag
- * @return
- */
private boolean isSensuSeparator(TaggedText tag) {
if (SENSU_SEPARATOR.equals(tag.getText())
&& tag.getType() == TagEnum.separator) {
return false;
}
- /**
- * @param x
- * @param y
- * @return
- */
private boolean tagEqualsMisapplied(TaggedText x, TaggedText y) {
if (CdmUtils.nullSafeEqual(x.getText(),y.getText())
&& x.getType().equals(y.getType())
return result;
}
- /**
- * @return the misapplications
- */
public List<List<TaggedText>> getMisapplications() {
return misapplications;
}
-
- /**
- * @param misapplications the misapplications to set
- */
public void setMisapplications(List<List<TaggedText>> misapplications) {
this.misapplications = misapplications;
}
-
-
}