Project

General

Profile

Download (4.24 KB) Statistics
| Branch: | Tag: | Revision:
1 c2f269f9 Andreas Kohlbecker
/**
2
 * Copyright (C) 2007 EDIT
3 ede5b774 Andreas Müller
 * European Distributed Institute of Taxonomy
4 c2f269f9 Andreas Kohlbecker
 * http://www.e-taxonomy.eu
5 ede5b774 Andreas Müller
 *
6 c2f269f9 Andreas Kohlbecker
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9 d57c0df0 ben.clark
package eu.etaxonomy.cdm.api.service;
10
11 d44277a9 ben.clark
import java.util.List;
12
13 d57c0df0 ben.clark
import eu.etaxonomy.cdm.api.service.pager.Pager;
14
import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
15
import eu.etaxonomy.cdm.model.common.Annotation;
16 a784f00f Katja Luther
import eu.etaxonomy.cdm.model.common.Marker;
17 d57c0df0 ben.clark
import eu.etaxonomy.cdm.model.common.MarkerType;
18 b9cbcc7c Andreas Kohlbecker
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
19 d44277a9 ben.clark
import eu.etaxonomy.cdm.persistence.query.OrderHint;
20 d57c0df0 ben.clark
21 ede5b774 Andreas Müller
public interface IAnnotatableService<T extends AnnotatableEntity>
22
            extends IVersionableService<T> {
23
24 d57c0df0 ben.clark
	/**
25
	 * Return a Pager containing Annotation entities belonging to the object supplied, optionally
26
	 * filtered by MarkerType
27 ede5b774 Andreas Müller
	 *
28 d57c0df0 ben.clark
	 * @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 d44277a9 ben.clark
	 * @param orderHints may be null
33 dd4c21b7 Andreas Kohlbecker
	 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
34 d57c0df0 ben.clark
	 * @return a Pager of Annotation entities
35
	 */
36 d44277a9 ben.clark
	public Pager<Annotation> getAnnotations(T annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
37 ede5b774 Andreas Müller
38 a784f00f Katja Luther
	/**
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 ede5b774 Andreas Müller
	 *
42 a784f00f Katja Luther
	 * @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 dd4c21b7 Andreas Kohlbecker
	 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
48 a784f00f Katja Luther
	 * @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 ede5b774 Andreas Müller
52 a784f00f Katja Luther
	/**
53 ede5b774 Andreas Müller
	 * Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements.
54 a784f00f Katja Luther
	 * 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 ede5b774 Andreas Müller
	 *
58 a784f00f Katja Luther
	 * @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 dd4c21b7 Andreas Kohlbecker
	 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
63 a784f00f Katja Luther
	 * @return
64
	 */
65
	public List<Object[]> groupMarkers(Class<? extends T> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
66 ede5b774 Andreas Müller
67 a784f00f Katja Luther
	/**
68
	 * returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.
69 ede5b774 Andreas Müller
	 *
70 a784f00f Katja Luther
	 * @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 42d4306a Katja Luther
76
77 ede5b774 Andreas Müller
}