import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.Taxon;
-import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;
+import eu.etaxonomy.cdm.persistence.dao.IBeanInitializer;
import eu.etaxonomy.cdm.persistence.query.OrderHint;
public interface IDescriptionService extends IIdentifiableEntityService<DescriptionBase> {
* <code>propertyPaths</code> parameter.
* <p>
* For detailed description and examples <b>please refer to:</b>
- * {@link BeanInitializer#initialize(Object, List)}
+ * {@link IBeanInitializer#initialize(Object, List)}
*
* @param uuid the uuid of the DescriptionElement of interest
* @return a DescriptionElement, or null if the DescriptionElement does not exist
* @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
* @param orderHints may be null
- * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
+ * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
* @return a Pager containing DescriptionBase instances
*/
public Pager<DescriptionBase> page(Class<? extends DescriptionBase> type, Boolean hasMedia, Boolean hasText, Set<Feature> feature, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
* @param class
* @param pageSize The maximum number of description elements returned (can be null for all description elements)
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
- * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link BeanInitializer#initialize(Object, List)}
+ * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
* @return a Pager containing DescriptionElementBase instances
*
* FIXME candidate for harmonization - rename to pageDescriptionElements
* @param class
* @param pageSize The maximum number of description elements returned (can be null for all description elements)
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
- * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link BeanInitializer#initialize(Object, List)}
+ * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
* @return a List containing DescriptionElementBase instances
*/
public List<DescriptionElementBase> listDescriptionElements(DescriptionBase description,Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
* @param pageSize The maximum number of terms returned (can be null for all annotations)
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
* @param orderHints may be null
- * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
+ * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
* @return a Pager of Annotation entities
*/
public Pager<Annotation> getDescriptionElementAnnotations(DescriptionElementBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
* @param geographicalScope Restrict the results to those descriptions which have a geographical scope that overlaps with the NamedArea instances passed (can be null or empty)
* @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
- * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link BeanInitializer#initialize(Object, List)}
+ * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
* @return a Pager containing TaxonDescription instances
*
* FIXME candidate for harmonization - rename to pageTaxonDescriptions
* @param markerType Restrict the results to those descriptions which are marked as true by one of the given marker types (can be null or empty)
* @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
- * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link BeanInitializer#initialize(Object, List)}
+ * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
* @return a Pager containing TaxonDescription instances
*/
public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
*/
public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+ /**
+ * Returns all {@link Media} attached to a taxon via TaxonDescription.elements.media.
+ * @param taxonUuid the taxons uuid, if null media for all taxa are returned
+ * @param limitToGalleries if true only media in TaxonDescriptions with imageGallery flag=true are returned
+ * @param markerTypes only media for TaxonDescriptions with marker of type markerType and marker.flag=true are returned, one matching marker type is sufficient
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
+ * @return
+ */
+ public List<Media> listTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+
+ /**
+ * Returns count for all {@link Media} attached to a taxon via TaxonDescription.elements.media.
+ * @param taxonUuid the taxons uuid, if null media for all taxa are returned
+ * @param limitToGalleries if true only media in TaxonDescriptions with imageGallery flag=true are returned
+ * @param markerTypes only media for TaxonDescriptions with marker of type markerType and marker.flag=true are returned, one matching marker type is sufficient
+ * @return
+ */
+ public int countTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes);
+
+
/**
* Returns a List of TaxonNameDescription instances, optionally filtered by the name which they refer to
* @param name Restrict the results to those descriptions that refer to a specific name (can be null for all TaxonNameDescription instances)
* @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
- * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link BeanInitializer#initialize(Object, List)}
+ * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
* @return a Pager containing TaxonNameBase instances
*
* FIXME candidate for harmonization - rename to pageTaxonNameDescriptions
*/
public Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonNameBase name, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
+
/**
* Returns a List of distinct TaxonDescription instances which have Distribution elements that refer to one of the NamedArea instances passed (optionally
* @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
- * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link BeanInitializer#initialize(Object, List)}
+ * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
* @return a Pager containing TaxonDescription instances
*/
public Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTermBase presence, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
* @param descriptionElement the description element associated with these media
* @param pageSize The maximum number of media returned (can be null for all related media)
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
- * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
+ * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
* @return a Pager containing media instances
*
* FIXME candidate for harmonization - rename to pageMedia