Fix specimen retrieval by assignment status
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IAnnotatableService.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.cdm.api.service;
11
12 import java.util.List;
13
14 import eu.etaxonomy.cdm.api.service.pager.Pager;
15 import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
16 import eu.etaxonomy.cdm.model.common.Annotation;
17 import eu.etaxonomy.cdm.model.common.Marker;
18 import eu.etaxonomy.cdm.model.common.MarkerType;
19 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
20 import eu.etaxonomy.cdm.persistence.query.OrderHint;
21
22 public interface IAnnotatableService<T extends AnnotatableEntity> extends IVersionableService<T> {
23
24 /**
25 * Return a Pager containing Annotation entities belonging to the object supplied, optionally
26 * filtered by MarkerType
27 *
28 * @param annotatedObj The object that "owns" the annotations returned
29 * @param status Only return annotations which are marked with a Marker of this type (can be null to return all annotations)
30 * @param pageSize The maximum number of terms returned (can be null for all annotations)
31 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
32 * @param orderHints may be null
33 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
34 * @return a Pager of Annotation entities
35 */
36 public Pager<Annotation> getAnnotations(T annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
37
38 /**
39 * Returns a Pager containing Marker entities belonging to the object supplied, optionally filtered by
40 * whether they are technical or non-technical markers
41 *
42 * @param annotatableEntity the entity which is marked
43 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
44 * @param pageSize The maximum number of markers returned (can be null for all markers)
45 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
46 * @param orderHints may be null
47 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
48 * @return a List of Marker instances
49 */
50 public Pager<Marker> getMarkers(T annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
51
52 /**
53 * Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements.
54 * The first element is the MarkerType, initialized using the propertyPaths parameter. The second element is the count of all markers of Objects
55 * 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
56 * titleCache of the markerType, in ascending order.
57 *
58 * @param clazz optionally restrict the markers to those belonging to this class
59 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
60 * @param pageSize The maximum number of arrays returned (can be null for all arrays)
61 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
62 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
63 * @return
64 */
65 public List<Object[]> groupMarkers(Class<? extends T> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
66
67 /**
68 * returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.
69 *
70 * @param clazz optionally restrict the markers to those belonging to this class
71 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
72 * @return a count of markers
73 */
74 public int countMarkers(Class<? extends T> clazz, Boolean technical);
75 }