Revision 41502854
Added by Andreas Müller over 2 years ago
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java | ||
---|---|---|
977 | 977 |
// logger.setLevel(Level.TRACE); |
978 | 978 |
// Logger.getLogger("org.hibernate.SQL").setLevel(Level.TRACE); |
979 | 979 |
|
980 |
logger.trace("listMedia() - START");
|
|
980 |
if (logger.isTraceEnabled()){logger.trace("listMedia() - START");}
|
|
981 | 981 |
|
982 | 982 |
Set<Taxon> taxa = new HashSet<>(); |
983 | 983 |
List<Media> taxonMedia = new ArrayList<>(); |
... | ... | |
989 | 989 |
|
990 | 990 |
// --- resolve related taxa |
991 | 991 |
if (includeRelationships != null && ! includeRelationships.isEmpty()) { |
992 |
logger.trace("listMedia() - resolve related taxa");
|
|
992 |
if (logger.isTraceEnabled()){logger.trace("listMedia() - resolve related taxa");}
|
|
993 | 993 |
taxa = listRelatedTaxa(taxon, includeRelationships, null, includeUnpublished, null, null, null); |
994 | 994 |
} |
995 | 995 |
|
996 | 996 |
taxa.add((Taxon) dao.load(taxon.getUuid())); |
997 | 997 |
|
998 | 998 |
if(includeTaxonDescriptions != null && includeTaxonDescriptions){ |
999 |
logger.trace("listMedia() - includeTaxonDescriptions");
|
|
999 |
if (logger.isTraceEnabled()){logger.trace("listMedia() - includeTaxonDescriptions");}
|
|
1000 | 1000 |
List<TaxonDescription> taxonDescriptions = new ArrayList<>(); |
1001 | 1001 |
// --- TaxonDescriptions |
1002 | 1002 |
for (Taxon t : taxa) { |
... | ... | |
1022 | 1022 |
|
1023 | 1023 |
|
1024 | 1024 |
if(includeOccurrences != null && includeOccurrences) { |
1025 |
logger.trace("listMedia() - includeOccurrences");
|
|
1025 |
if (logger.isTraceEnabled()){logger.trace("listMedia() - includeOccurrences");}
|
|
1026 | 1026 |
@SuppressWarnings("rawtypes") |
1027 | 1027 |
Set<SpecimenOrObservationBase> specimensOrObservations = new HashSet<>(); |
1028 | 1028 |
// --- Specimens |
... | ... | |
1061 | 1061 |
} |
1062 | 1062 |
|
1063 | 1063 |
if(includeTaxonNameDescriptions != null && includeTaxonNameDescriptions) { |
1064 |
logger.trace("listMedia() - includeTaxonNameDescriptions");
|
|
1064 |
if (logger.isTraceEnabled()){logger.trace("listMedia() - includeTaxonNameDescriptions");}
|
|
1065 | 1065 |
// --- TaxonNameDescription |
1066 | 1066 |
Set<TaxonNameDescription> nameDescriptions = new HashSet<>(); |
1067 | 1067 |
for (Taxon t : taxa) { |
1068 |
nameDescriptions .addAll(t.getName().getDescriptions());
|
|
1068 |
nameDescriptions.addAll(t.getName().getDescriptions()); |
|
1069 | 1069 |
} |
1070 | 1070 |
for(TaxonNameDescription nameDescription: nameDescriptions){ |
1071 | 1071 |
if (!limitToGalleries || nameDescription.isImageGallery()) { |
... | ... | |
1082 | 1082 |
logger.trace("listMedia() - initialize"); |
1083 | 1083 |
beanInitializer.initializeAll(taxonMedia, propertyPath); |
1084 | 1084 |
|
1085 |
logger.trace("listMedia() - END");
|
|
1085 |
if (logger.isTraceEnabled()){logger.trace("listMedia() - END");}
|
|
1086 | 1086 |
|
1087 | 1087 |
return taxonMedia; |
1088 | 1088 |
} |
Also available in: Unified diff
cleanup