Revision 1cdff041
Added by Katja Luther almost 3 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdmLight/CdmLightClassificationExport.java | ||
---|---|---|
86 | 86 |
import eu.etaxonomy.cdm.model.occurrence.GatheringEvent; |
87 | 87 |
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen; |
88 | 88 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
89 |
import eu.etaxonomy.cdm.model.reference.NamedSource; |
|
89 | 90 |
import eu.etaxonomy.cdm.model.reference.OriginalSourceType; |
90 | 91 |
import eu.etaxonomy.cdm.model.reference.Reference; |
91 | 92 |
import eu.etaxonomy.cdm.model.reference.ReferenceType; |
... | ... | |
1700 | 1701 |
synonymsInGroup.stream().forEach(synonym -> typifiedNames.add(HibernateProxyHelper.deproxy(synonym.getName(), TaxonName.class))); |
1701 | 1702 |
} |
1702 | 1703 |
|
1703 |
// group.getTypifiedNames().stream().forEach(name -> typifiedNames.add(HibernateProxyHelper.deproxy(name, TaxonName.class))); |
|
1704 |
|
|
1704 | 1705 |
TaxonName firstname = null; |
1705 | 1706 |
for (TaxonName name: typifiedNames){ |
1706 | 1707 |
Iterator<Taxon> taxa = name.getTaxa().iterator(); |
... | ... | |
1734 | 1735 |
nameString = createNameWithItalics(name.getTaggedFullTitle()) ; |
1735 | 1736 |
} |
1736 | 1737 |
|
1738 |
Set<NameRelationship> relatedNames = name.getNameRelations(); |
|
1739 |
|
|
1740 |
List<NameRelationship> nonNames = new ArrayList<>(); |
|
1741 |
List<NameRelationship> otherRelationships = new ArrayList<>(); |
|
1742 |
|
|
1743 |
for (NameRelationship rel: relatedNames){ |
|
1744 |
// alle Homonyme und inverse blocking names |
|
1745 |
if (rel.getType().equals(NameRelationshipType.LATER_HOMONYM()) || rel.getType().equals(NameRelationshipType.TREATED_AS_LATER_HOMONYM()) || (rel.getType().equals(NameRelationshipType.BLOCKING_NAME_FOR()) && rel.getToName().equals(name))){ |
|
1746 |
nonNames.add(rel); |
|
1747 |
}else if (!rel.getType().isBasionymRelation()){ |
|
1748 |
otherRelationships.add(rel); |
|
1749 |
} |
|
1750 |
} |
|
1751 |
|
|
1752 |
String nonRelNames = ""; |
|
1753 |
String relNames = ""; |
|
1754 |
|
|
1755 |
if (nonNames.size() > 0){ |
|
1756 |
nonRelNames += " ["; |
|
1757 |
} |
|
1758 |
for (NameRelationship relName: nonNames){ |
|
1759 |
String label = "non "; |
|
1760 |
TaxonName relatedName = null; |
|
1761 |
if (relName.getFromName().equals(name)){ |
|
1762 |
label = relName.getType().getLabel() + " "; |
|
1763 |
relatedName = relName.getToName(); |
|
1764 |
}else{ |
|
1765 |
relatedName = relName.getFromName(); |
|
1766 |
} |
|
1767 |
nonRelNames += label + relatedName.getTitleCache() + " "; |
|
1768 |
} |
|
1769 |
relNames.trim(); |
|
1770 |
if (nonNames.size() > 0){ |
|
1771 |
nonRelNames += "] "; |
|
1772 |
} |
|
1773 |
|
|
1774 |
if (otherRelationships.size() > 0){ |
|
1775 |
relNames += " ["; |
|
1776 |
} |
|
1777 |
for (NameRelationship rel: otherRelationships){ |
|
1778 |
String label = ""; |
|
1779 |
TaxonName relatedName = null; |
|
1780 |
if (rel.getFromName().equals(name)){ |
|
1781 |
label = rel.getType().getLabel() + " "; |
|
1782 |
relatedName = rel.getToName(); |
|
1783 |
}else { |
|
1784 |
label = rel.getType().getInverseLabel() + " "; |
|
1785 |
relatedName = rel.getFromName(); |
|
1786 |
} |
|
1787 |
relNames += label + relatedName.getTitleCache() + " "; |
|
1788 |
} |
|
1789 |
relNames.trim(); |
|
1790 |
if (otherRelationships.size() > 0){ |
|
1791 |
relNames += "] "; |
|
1792 |
} |
|
1793 |
|
|
1737 | 1794 |
String synonymSign = ""; |
1738 | 1795 |
if (index > 0){ |
1739 | 1796 |
if (name.isInvalid()){ |
... | ... | |
1761 | 1818 |
sec = ""; |
1762 | 1819 |
} |
1763 | 1820 |
|
1764 |
typifiedNamesWithoutAccepted += synonymSign + doubtful + nameString ; |
|
1765 |
typifiedNamesWithoutAcceptedWithSec += synonymSign + doubtful + nameString + sec ; |
|
1821 |
typifiedNamesWithoutAccepted += synonymSign + doubtful + nameString + nonRelNames + relNames;
|
|
1822 |
typifiedNamesWithoutAcceptedWithSec += synonymSign + doubtful + nameString + sec + nonRelNames + relNames;
|
|
1766 | 1823 |
}else{ |
1767 | 1824 |
sec = ""; |
1768 | 1825 |
if (!(((Taxon)taxonBase).isProparteSynonym() || ((Taxon)taxonBase).isMisapplication())){ |
... | ... | |
1803 | 1860 |
typifiedNamesWithoutAcceptedWithSec = typifiedNamesWithoutAcceptedWithSec.trim() + "; "; |
1804 | 1861 |
} |
1805 | 1862 |
} |
1806 |
typifiedNamesString += synonymSign + doubtful + nameString ; |
|
1807 |
typifiedNamesWithSecString += synonymSign + doubtful + nameString + sec; |
|
1863 |
typifiedNamesString += synonymSign + doubtful + nameString + nonRelNames + relNames;
|
|
1864 |
typifiedNamesWithSecString += synonymSign + doubtful + nameString + sec + nonRelNames + relNames;
|
|
1808 | 1865 |
|
1809 | 1866 |
|
1810 | 1867 |
csvLine[table.getIndex(CdmLightExportTable.HOMOTYPIC_GROUP_STRING)] = typifiedNamesString.trim(); |
... | ... | |
1840 | 1897 |
for (TypeDesignationBase<?> typeDes: designationList) { |
1841 | 1898 |
if (typeDes instanceof TextualTypeDesignation) { |
1842 | 1899 |
typeTextDesignations = typeTextDesignations + ((TextualTypeDesignation)typeDes).getText(Language.getDefaultLanguage()); |
1843 |
typeTextDesignations = typeTextDesignations + "; "; |
|
1900 |
String typeDesStateRefs = ""; |
|
1901 |
if (typeDes.getDesignationSource() != null ){ |
|
1902 |
typeDesStateRefs = "["; |
|
1903 |
NamedSource source = typeDes.getDesignationSource(); |
|
1904 |
if (source.getCitation() != null){ |
|
1905 |
typeDesStateRefs += "fide " + OriginalSourceFormatter.INSTANCE.format(source.getCitation(), null); |
|
1906 |
} |
|
1907 |
typeDesStateRefs += "]"; |
|
1908 |
}else if (typeDes.getSources() != null && !typeDes.getSources().isEmpty()){ |
|
1909 |
typeDesStateRefs = "["; |
|
1910 |
for (IdentifiableSource source: typeDes.getSources()) { |
|
1911 |
if (source.getCitation() != null){ |
|
1912 |
typeDesStateRefs += "fide " +OriginalSourceFormatter.INSTANCE.format(source.getCitation(), null); |
|
1913 |
} |
|
1914 |
} |
|
1915 |
|
|
1916 |
typeDesStateRefs += "]"; |
|
1917 |
} |
|
1918 |
|
|
1919 |
typeTextDesignations = typeTextDesignations + typeDesStateRefs +"; "; |
|
1920 |
|
|
1844 | 1921 |
} |
1845 | 1922 |
} |
1846 | 1923 |
if (typeTextDesignations.equals("; ")) { |
Also available in: Unified diff
ref #9645, #9646: add namerelations to homotypicGrouString and reference to type/specimenstatement