commit e56ebfbd81d6a12b01ae9e492967a20cfb89e169
Author: Katja Luther <k.luther@bgbm.org>
Date:   Thu Sep 29 11:21:47 2022 +0200

    ref #10156: addOriginals to taxonServive.listMedia

diff --git a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITaxonService.java b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITaxonService.java
index 374e69afb1..ec1e73bd85 100644
--- a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITaxonService.java
+++ b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITaxonService.java
@@ -769,6 +769,33 @@ public interface ITaxonService
     public List<Media> listMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships,
             Boolean limitToGalleries, Boolean includeTaxonDescriptions, Boolean includeOccurrences,
             Boolean includeTaxonNameDescriptions, List<String> propertyPath);
+    
+    /**
+     * Lists all Media found in an any TaxonDescription, NameDescription,
+     * SpecimenOrObservationBase, DnaSample Chromatograms, etc. associated with this taxon.
+     *
+     * @param taxon
+     * @param includeRelationships
+     *            the given list of TaxonRelationshipEdges will be taken into
+     *            account when retrieving media associated with the given taxon.
+     *            Can be NULL.
+     * @param limitToGalleries
+     *            whether to take only descriptions into account which are
+     *            marked as gallery, can be NULL
+     * @param includeTaxonDescriptions
+     *            whether to take TaxonDescriptions into account, can be NULL
+     * @param includeOccurrences
+     *          whether to take SpecimenDescriptions into account, can be NULL
+     * @param includeOriginals
+     *          whether to take SpecimenDescriptions of the originals of associated derived units into account, can be NULL
+     * @param includeTaxonNameDescriptions
+     *       whether to take TaxonNameDescriptions into account, can be NULL
+     * @param propertyPath
+     * @return
+     */
+    public List<Media> listMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships,
+            Boolean limitToGalleries, Boolean includeTaxonDescriptions, Boolean includeOccurrences, Boolean includeOriginals,
+            Boolean includeTaxonNameDescriptions, List<String> propertyPath);
 
     public List<TaxonBase> findTaxaByID(Set<Integer> listOfIDs);
 
diff --git a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
index ff99b9becf..cd7b662072 100644
--- a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
+++ b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
@@ -967,11 +967,19 @@ public class TaxonServiceImpl
     public List<Media> listTaxonDescriptionMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, boolean limitToGalleries, List<String> propertyPath){
         return listMedia(taxon, includeRelationships, limitToGalleries, true, false, false, propertyPath);
     }
-
+    
     @Override
     public List<Media> listMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships,
             Boolean limitToGalleries, Boolean includeTaxonDescriptions, Boolean includeOccurrences,
             Boolean includeTaxonNameDescriptions, List<String> propertyPath) {
+    	return  listMedia(taxon, includeRelationships, limitToGalleries, includeTaxonDescriptions, includeOccurrences, false,
+                includeTaxonNameDescriptions, propertyPath);
+    }
+
+    @Override
+    public List<Media> listMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships,
+            Boolean limitToGalleries, Boolean includeTaxonDescriptions, Boolean includeOccurrences, Boolean includeOriginalOccurences,
+            Boolean includeTaxonNameDescriptions, List<String> propertyPath) {
 
         //TODO let inherit
         boolean includeUnpublished = INCLUDE_UNPUBLISHED;
@@ -1059,6 +1067,7 @@ public class TaxonServiceImpl
                 }
                 //media in hierarchy
                 taxonMedia.addAll(occurrenceService.getMediaInHierarchy(occurrence, null, null, propertyPath).getRecords());
+                
             }
         }
 
