assembleDerivateDataDTO(fieldUnitDTO, fieldUnit);\r
\r
//assemble citation\r
- String citation = assembleCitation(fieldUnit);\r
+ String citation = fieldUnit.getTitleCache();\r
if(!preservedSpecimenAccessionNumbers.isEmpty()){\r
citation += " (";\r
for(String accessionNumber:preservedSpecimenAccessionNumbers){\r
}\r
\r
\r
- /**\r
- * @param fieldUnit\r
- * @param fieldUnitDTO\r
- * @param preservedSpecimenAccessionNumbers\r
- * @param SEPARATOR_STRING\r
- * @return\r
- */\r
- private String assembleCitation(FieldUnit fieldUnit) {\r
- String citation = "";\r
- if(fieldUnit.getGatheringEvent()!=null){\r
- //Country\r
- GatheringEvent gatheringEvent = fieldUnit.getGatheringEvent();\r
- NamedArea country = gatheringEvent.getCountry();\r
- String countryString = country!=null?country.getDescription():null;\r
- citation += countryString+SEPARATOR_STRING;\r
-\r
- //Collection\r
- AgentBase collector = gatheringEvent.getCollector();\r
- String fieldNumber = fieldUnit.getFieldNumber();\r
- String collectionString = "";\r
- if(collector!=null || fieldNumber!=null){\r
- collectionString += collector!=null?collector:"";\r
- if(!collectionString.isEmpty()){\r
- collectionString += " ";\r
- }\r
- collectionString += (fieldNumber!=null?fieldNumber:"");\r
- collectionString.trim();\r
- }\r
- citation += collectionString;\r
- if(fieldUnit.getGatheringEvent().getLocality()!=null){\r
- citation += fieldUnit.getGatheringEvent().getLocality().getText();\r
- citation += SEPARATOR_STRING;\r
- }\r
- if(fieldUnit.getGatheringEvent().getExactLocation()!=null\r
- && fieldUnit.getGatheringEvent().getExactLocation().getLatitude()!=null\r
- && fieldUnit.getGatheringEvent().getExactLocation().getLongitude()!=null){\r
- citation += fieldUnit.getGatheringEvent().getExactLocation().getLatitude().toString();\r
- citation += SEPARATOR_STRING;\r
- citation += fieldUnit.getGatheringEvent().getExactLocation().getLongitude().toString();\r
- citation += SEPARATOR_STRING;\r
- }\r
- }\r
- citation = removeTail(citation, SEPARATOR_STRING);\r
- return citation;\r
- }\r
-\r
-\r
@Override\r
public PreservedSpecimenDTO assemblePreservedSpecimenDTO(DerivedUnit derivedUnit){\r
return assemblePreservedSpecimenDTO(derivedUnit, null);\r
//citation\r
Collection<FieldUnit> fieldUnits = getFieldUnits(derivedUnit);\r
if(fieldUnits.size()==1){\r
- preservedSpecimenDTO.setCitation(assembleCitation(fieldUnits.iterator().next()));\r
+ preservedSpecimenDTO.setCitation(fieldUnits.iterator().next().getTitleCache());\r
}\r
else{\r
preservedSpecimenDTO.setCitation("No Citation available. This specimen either has no or multiple field units.");\r
TaxonDescription taxonDescription = HibernateProxyHelper.deproxy(individualsAssociation.getInDescription(), TaxonDescription.class);\r
Taxon taxon = taxonDescription.getTaxon();\r
if(taxon!=null && taxon.getName()!=null){\r
- preservedSpecimenDTO.addAssociatedTaxon(taxon.getName().getFullTitleCache());\r
+ preservedSpecimenDTO.addAssociatedTaxon(taxon.getName().getTitleCache());\r
}\r
}\r
}\r