X-Git-Url: https://dev.e-taxonomy.eu/gitweb/cdmlib.git/blobdiff_plain/d44277a98c7c1eee85292086fa074054ad0b7f1d..921e3d541c1a29c5dadb15bf1970bad79db85ae3:/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAnnotatableService.java diff --git a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAnnotatableService.java b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAnnotatableService.java index aa7928cdd8..e411a17bcf 100644 --- a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAnnotatableService.java +++ b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAnnotatableService.java @@ -14,11 +14,12 @@ import java.util.List; import eu.etaxonomy.cdm.api.service.pager.Pager; import eu.etaxonomy.cdm.model.common.AnnotatableEntity; import eu.etaxonomy.cdm.model.common.Annotation; +import eu.etaxonomy.cdm.model.common.Marker; import eu.etaxonomy.cdm.model.common.MarkerType; -import eu.etaxonomy.cdm.persistence.dao.BeanInitializer; +import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer; import eu.etaxonomy.cdm.persistence.query.OrderHint; -public interface IAnnotatableService extends IService { +public interface IAnnotatableService extends IVersionableService { /** * Return a Pager containing Annotation entities belonging to the object supplied, optionally @@ -29,8 +30,46 @@ public interface IAnnotatableService extends IServi * @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 getAnnotations(T annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List orderHints, List propertyPaths); + + /** + * Returns a Pager containing Marker entities belonging to the object supplied, optionally filtered by + * whether they are technical or non-technical markers + * + * @param annotatableEntity the entity which is marked + * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not) + * @param pageSize The maximum number of markers returned (can be null for all markers) + * @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 IBeanInitializer#initialize(Object, List)} + * @return a List of Marker instances + */ + public Pager getMarkers(T annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List orderHints, List propertyPaths); + + /** + * Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements. + * The first element is the MarkerType, initialized using the propertyPaths parameter. The second element is the count of all markers of Objects + * of type clazz with that MarkerType. The boolean technical can be used to choose only technical or only non-technical marker types. The list is sorted by + * titleCache of the markerType, in ascending order. + * + * @param clazz optionally restrict the markers to those belonging to this class + * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not) + * @param pageSize The maximum number of arrays returned (can be null for all arrays) + * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based) + * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)} + * @return + */ + public List groupMarkers(Class clazz, Boolean technical, Integer pageSize, Integer pageNumber, List propertyPaths); + + /** + * returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers. + * + * @param clazz optionally restrict the markers to those belonging to this class + * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not) + * @return a count of markers + */ + public int countMarkers(Class clazz, Boolean technical); }