\r
child.setParentTreeNode(this, index);\r
\r
- //TODO workaround (see sortIndex doc) => not really required anymore here, as it is done in child.setParentTreeNode already\r
- for(int i = 0; i < childNodes.size(); i++){\r
- childNodes.get(i).sortIndex = i;\r
- }\r
- child.sortIndex = index;\r
- \r
+ //TODO workaround (see sortIndex doc) => not really required anymore here, as it is done in child.setParentTreeNode already\r
+ for(int i = 0; i < childNodes.size(); i++){\r
+ childNodes.get(i).sortIndex = i;\r
+ }\r
+ child.sortIndex = index;\r
+\r
//TODO workaround (see sortIndex doc)\r
for(int i = 0; i < childNodes.size(); i++){\r
childNodes.get(i).sortIndex = i;\r
// add this node to the parent child nodes\r
List<TaxonNode> parentChildren = parent.getChildNodes();\r
if (parentChildren.contains(this)){\r
- //avoid duplicates\r
- if (parentChildren.indexOf(this) < index){\r
- index = index -1;\r
- }\r
- parentChildren.remove(this);\r
- parentChildren.add(index, this);\r
+ //avoid duplicates\r
+ if (parentChildren.indexOf(this) < index){\r
+ index = index -1;\r
+ }\r
+ parentChildren.remove(this);\r
+ parentChildren.add(index, this);\r
}else{\r
- parentChildren.add(index, this);\r
+ parentChildren.add(index, this);\r
}\r
\r
//TODO workaround (see sortIndex doc)\r
- //TODO check if it is correct to use the parentChildren here \r
- for(int i = 0; i < parentChildren.size(); i++){\r
- parentChildren.get(i).sortIndex = i;\r
- }\r
+ //TODO check if it is correct to use the parentChildren here\r
+ for(int i = 0; i < parentChildren.size(); i++){\r
+ parentChildren.get(i).sortIndex = i;\r
+ }\r
// this.sortIndex = index;\r
- \r
+\r
// update the children count\r
if(parent instanceof TaxonNode){\r
TaxonNode parentTaxonNode = (TaxonNode) parent;\r
@Component\r
public class TaxonNodeByNameComparator extends AbstractStringComparator<TaxonNode> implements Comparator<TaxonNode>, ITaxonNodeComparator<TaxonNode> {\r
\r
- private static final String HYBRID_SIGN = "\u00D7";\r
+ private static final String HYBRID_SIGN = "\u00D7";\r
\r
- private static final Logger logger = Logger.getLogger(TaxonNodeByNameComparator.class);\r
+ private static final Logger logger = Logger.getLogger(TaxonNodeByNameComparator.class);\r
\r
private boolean ignoreHybridSign = true;\r
private boolean sortInfraGenericFirst = true;\r
/* (non-Javadoc)\r
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)\r
*/\r
+ @Override\r
public int compare(TaxonNode o1, TaxonNode o2) {\r
\r
String titleCache1 = createSortableTitleCache(o1);\r
String titleCache2 = createSortableTitleCache(o2);\r
\r
if(isIgnoreHybridSign()) {\r
- logger.trace("ignoring Hybrid Signs: " + HYBRID_SIGN);\r
+ logger.trace("ignoring Hybrid Signs: " + HYBRID_SIGN);\r
titleCache1 = titleCache1.replace(HYBRID_SIGN, "");\r
titleCache2 = titleCache2.replace(HYBRID_SIGN, "");\r
}\r
}\r
\r
\r
- private String createSortableTitleCache(TaxonNode taxonNode) {\r
+ private String createSortableTitleCache(TaxonNode taxonNode) {\r
\r
- String titleCache = null;\r
- if(taxonNode.getTaxon() != null && taxonNode.getTaxon().getName() != null ){\r
- TaxonNameBase<?,?> name = HibernateProxyHelper.deproxy(taxonNode.getTaxon().getName(), TaxonNameBase.class);\r
- \r
- if (name instanceof NonViralName){\r
- if (logger.isTraceEnabled()){logger.trace(name + " isNonViralName");}\r
- NonViralName<?> nonViralName = (NonViralName<?>)name;\r
+ String titleCache = null;\r
+ if(taxonNode.getTaxon() != null && taxonNode.getTaxon().getName() != null ){\r
+ TaxonNameBase<?,?> name = HibernateProxyHelper.deproxy(taxonNode.getTaxon().getName(), TaxonNameBase.class);\r
+\r
+ if (name instanceof NonViralName){\r
+ if (logger.isTraceEnabled()){logger.trace(name + " isNonViralName");}\r
+ NonViralName<?> nonViralName = (NonViralName<?>)name;\r
if (name.isInfraSpecific()){\r
- if (logger.isTraceEnabled()){logger.trace(name + " isInfraSpecific");}\r
+ if (logger.isTraceEnabled()){logger.trace(name + " isInfraSpecific");}\r
if (nonViralName.getSpecificEpithet().equals(nonViralName.getInfraSpecificEpithet())){\r
titleCache = nonViralName.getNameCache() + " "+nonViralName.getAuthorshipCache();\r
}\r
}\r
if (name.isInfraGeneric()){\r
- if (logger.isTraceEnabled()){logger.trace(name + " isInfraGeneric");}\r
- titleCache = nonViralName.getGenusOrUninomial() + " " + nonViralName.getInfraGenericEpithet();\r
+ if (logger.isTraceEnabled()){logger.trace(name + " isInfraGeneric");}\r
+ titleCache = nonViralName.getGenusOrUninomial() + " " + nonViralName.getInfraGenericEpithet();\r
}\r
if (nonViralName.isSpeciesAggregate()){\r
- if (logger.isTraceEnabled()){logger.trace(name + " isSpeciesAggregate");}\r
- titleCache = nonViralName.getGenusOrUninomial() + " " + nonViralName.getSpecificEpithet();\r
+ if (logger.isTraceEnabled()){logger.trace(name + " isSpeciesAggregate");}\r
+ titleCache = nonViralName.getGenusOrUninomial() + " " + nonViralName.getSpecificEpithet();\r
}\r
\r
}\r
if (titleCache == null){\r
- if (logger.isTraceEnabled()){logger.trace("titleCache still null, using name.getTitleCache()");}\r
+ if (logger.isTraceEnabled()){logger.trace("titleCache still null, using name.getTitleCache()");}\r
titleCache = name.getTitleCache();\r
}\r
}\r
- if (titleCache == null){\r
- if (logger.isTraceEnabled()){logger.trace("titleCache still null, using taxonNode id");}\r
+ if (titleCache == null){\r
+ if (logger.isTraceEnabled()){logger.trace("titleCache still null, using taxonNode id");}\r
titleCache = String.valueOf(taxonNode.getId());\r
}\r
if (logger.isTraceEnabled()){logger.trace("SortableTitleCache: " + titleCache);}\r
- return titleCache;\r
- }\r
+ return titleCache;\r
+ }\r
\r
\r
+ @Override\r
public boolean isIgnoreHybridSign() {\r
return ignoreHybridSign;\r
}\r
\r
+ @Override\r
public void setIgnoreHybridSign(boolean ignore) {\r
this.ignoreHybridSign = ignore;\r
}\r
\r
private static final List<String> NODE_INIT_STRATEGY = Arrays.asList(new String[]{\r
"taxon.sec",\r
- "taxon.name"\r
+ "taxon.name.rank"\r
});\r
\r
\r
protected static final List<String> DESCRIPTION_INIT_STRATEGY = Arrays.asList(new String []{\r
"$",\r
"elements.$",\r
+ "elements.annotations",\r
+ "elements.markers",\r
"elements.states.$",\r
"elements.sources.citation.authorTeam",\r
"elements.sources.nameUsedInSource.originalNameString",\r
\r
protected static final List<String> DESCRIPTION_ELEMENT_INIT_STRATEGY = Arrays.asList(new String []{\r
"$",\r
+ "annotations",\r
+ "markers",\r
"states.$",\r
"sources.citation.authorTeam",\r
"sources.nameUsedInSource.originalNameString",\r
}\r
}\r
//TODO it seems as if the InitializationStrategy is not appropriate here !!!\r
- // see #3728 (DescriptionListPortalController.getDescriptionElementsForTaxon() seems to be using inapproptiate init strategy)\r
+ // see #3728 (DescriptionListPortalController.getDescriptionElementsForTaxon() seems to be using in-appropriate init strategy)\r
if (logger.isDebugEnabled()){logger.debug("get pager ...");}\r
Pager<T> pager = service.pageDescriptionElementsForTaxon(\r
taxon,\r
private IFeatureTreeService featureTreeService;\r
\r
private static final List<String> TAXON_INIT_STRATEGY = Arrays.asList(new String []{\r
- "*",\r
+ "$",\r
+ "sources",\r
// taxon relations\r
- "relationsToThisName.fromTaxon.name",\r
+// "relationsToThisName.fromTaxon.name",\r
// the name\r
"name.$",\r
+ "name.nomenclaturalReference.authorTeam",\r
+ "name.nomenclaturalReference.inReference",\r
"name.rank.representations",\r
"name.status.type.representations",\r
\r
- // taxon descriptions\r
-// "descriptions.elements.area.$",\r
-// "descriptions.elements.multilanguageText",\r
-// "descriptions.elements.media",\r
+ "descriptions" // TODO remove\r
\r
});\r
\r
"name.$",\r
"name.rank.representations",\r
"name.status.type.representations",\r
- "name.nomenclaturalReference.authorTeam"\r
+ "name.nomenclaturalReference.authorTeam",\r
+ "name.nomenclaturalReference.inReference",\r
+ "taxonNodes.classification"\r
});\r
\r
private static final List<String> SYNONYMY_INIT_STRATEGY = Arrays.asList(new String []{\r
"synonymRelations.$",\r
"synonymRelations.synonym.$",\r
"synonymRelations.synonym.name.status.type.representation",\r
+ "synonymRelations.synonym.name.nomenclaturalReference.authorTeam",\r
"synonymRelations.synonym.name.nomenclaturalReference.inReference",\r
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.$",\r
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.taxonBases.$",\r
"name.homotypicalGroup.$",\r
"name.homotypicalGroup.typifiedNames.$",\r
"name.homotypicalGroup.typifiedNames.nomenclaturalReference.authorTeam",\r
-\r
+ "name.homotypicalGroup.typifiedNames.nomenclaturalReference.inReference",\r
"name.homotypicalGroup.typifiedNames.taxonBases.$"\r
});\r
\r
"synonymRelations.$",\r
"synonymRelations.synonym.$",\r
"synonymRelations.synonym.name.status.type.representation",\r
+ "synonymRelations.synonym.name.nomenclaturalReference.authorTeam",\r
"synonymRelations.synonym.name.nomenclaturalReference.inReference",\r
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.$",\r
"synonymRelations.synonym.name.homotypicalGroup.typifiedNames.taxonBases.$",\r
"name.homotypicalGroup.$",\r
"name.homotypicalGroup.typifiedNames.$",\r
"name.homotypicalGroup.typifiedNames.nomenclaturalReference.authorTeam",\r
+ "name.homotypicalGroup.typifiedNames.nomenclaturalReference.inReference",\r
\r
"name.homotypicalGroup.typifiedNames.taxonBases.$",\r
\r
"name.$",\r
"name.rank.representations",\r
"name.status.type.representations",\r
- "name.nomenclaturalReference",\r
+ "name.nomenclaturalReference.authorTeam",\r
+ "name.nomenclaturalReference.inReference",\r
\r
"taxonNodes.$",\r
"taxonNodes.classification.$",\r
"type.inverseRepresentations",\r
"fromName",\r
"toName.$",\r
+ "toName.nomenclaturalReference.authorTeam",\r
+ "toName.nomenclaturalReference.inReference",\r
+\r
});\r
\r
\r