import eu.etaxonomy.cdm.api.service.pager.Pager;\r
import eu.etaxonomy.cdm.model.common.AnnotatableEntity;\r
import eu.etaxonomy.cdm.model.common.Annotation;\r
+import eu.etaxonomy.cdm.model.common.Marker;\r
import eu.etaxonomy.cdm.model.common.MarkerType;\r
-import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;\r
+import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;\r
import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
\r
-public interface IAnnotatableService<T extends AnnotatableEntity> extends IService<T> {\r
+public interface IAnnotatableService<T extends AnnotatableEntity> extends IVersionableService<T> {\r
\r
/**\r
* Return a Pager containing Annotation entities belonging to the object supplied, optionally\r
* @param pageSize The maximum number of terms returned (can be null for all annotations)\r
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
* @param orderHints may be null\r
- * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
+ * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
* @return a Pager of Annotation entities\r
*/\r
public Pager<Annotation> getAnnotations(T annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
+ \r
+ /**\r
+ * Returns a Pager containing Marker entities belonging to the object supplied, optionally filtered by\r
+ * whether they are technical or non-technical markers\r
+ * \r
+ * @param annotatableEntity the entity which is marked\r
+ * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)\r
+ * @param pageSize The maximum number of markers returned (can be null for all markers)\r
+ * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+ * @param orderHints may be null\r
+ * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
+ * @return a List of Marker instances\r
+ */\r
+ public Pager<Marker> getMarkers(T annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
+ \r
+ /**\r
+ * Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements. \r
+ * The first element is the MarkerType, initialized using the propertyPaths parameter. The second element is the count of all markers of Objects\r
+ * 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\r
+ * titleCache of the markerType, in ascending order.\r
+ * \r
+ * @param clazz optionally restrict the markers to those belonging to this class\r
+ * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)\r
+ * @param pageSize The maximum number of arrays returned (can be null for all arrays)\r
+ * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+ * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
+ * @return\r
+ */\r
+ public List<Object[]> groupMarkers(Class<? extends T> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths);\r
+ \r
+ /**\r
+ * returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.\r
+ * \r
+ * @param clazz optionally restrict the markers to those belonging to this class\r
+ * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)\r
+ * @return a count of markers\r
+ */\r
+ public int countMarkers(Class<? extends T> clazz, Boolean technical);\r
} \r