1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* 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
|
package eu.etaxonomy.cdm.api.service;
|
10
|
|
11
|
import java.util.List;
|
12
|
|
13
|
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
|
import eu.etaxonomy.cdm.model.common.Marker;
|
17
|
import eu.etaxonomy.cdm.model.common.MarkerType;
|
18
|
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
|
19
|
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
|
20
|
import eu.etaxonomy.cdm.persistence.query.OrderHint;
|
21
|
|
22
|
public interface IAnnotatableService<T extends AnnotatableEntity>
|
23
|
extends IVersionableService<T> {
|
24
|
|
25
|
/**
|
26
|
* Return a Pager containing Annotation entities belonging to the object supplied, optionally
|
27
|
* filtered by MarkerType
|
28
|
*
|
29
|
* @param annotatedObj The object that "owns" the annotations returned
|
30
|
* @param status Only return annotations which are marked with a Marker of this type (can be null to return all annotations)
|
31
|
* @param pageSize The maximum number of terms returned (can be null for all annotations)
|
32
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
33
|
* @param orderHints may be null
|
34
|
* @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
|
35
|
* @return a Pager of Annotation entities
|
36
|
*/
|
37
|
public Pager<Annotation> getAnnotations(T annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
38
|
|
39
|
/**
|
40
|
* Returns a Pager containing Marker entities belonging to the object supplied, optionally filtered by
|
41
|
* whether they are technical or non-technical markers
|
42
|
*
|
43
|
* @param annotatableEntity the entity which is marked
|
44
|
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
|
45
|
* @param pageSize The maximum number of markers returned (can be null for all markers)
|
46
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
47
|
* @param orderHints may be null
|
48
|
* @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
|
49
|
* @return a List of Marker instances
|
50
|
*/
|
51
|
public Pager<Marker> getMarkers(T annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
52
|
|
53
|
/**
|
54
|
* Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements.
|
55
|
* The first element is the MarkerType, initialized using the propertyPaths parameter. The second element is the count of all markers of Objects
|
56
|
* 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
|
57
|
* titleCache of the markerType, in ascending order.
|
58
|
*
|
59
|
* @param clazz optionally restrict the markers to those belonging to this class
|
60
|
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
|
61
|
* @param pageSize The maximum number of arrays returned (can be null for all arrays)
|
62
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
63
|
* @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
|
64
|
* @return
|
65
|
*/
|
66
|
public List<Object[]> groupMarkers(Class<? extends T> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
67
|
|
68
|
/**
|
69
|
* returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.
|
70
|
*
|
71
|
* @param clazz optionally restrict the markers to those belonging to this class
|
72
|
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
|
73
|
* @return a count of markers
|
74
|
*/
|
75
|
public int countMarkers(Class<? extends T> clazz, Boolean technical);
|
76
|
/**
|
77
|
* Like {@link #getUuidAndTitleCache(Integer, String)} but searching only on a subclass
|
78
|
* of the type handled by the DAO.
|
79
|
*
|
80
|
* @param clazz the (sub)class
|
81
|
* @param limit max number of results
|
82
|
* @param pattern search pattern
|
83
|
|
84
|
* @see #getUuidAndTitleCache(Integer, String)
|
85
|
*/
|
86
|
public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern);
|
87
|
|
88
|
/**
|
89
|
* Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object.
|
90
|
* Retrieving this list is considered to be significantly faster than initializing the fully fledged business
|
91
|
* objects. To be used in cases where you want to present large amount of data and provide details after
|
92
|
* a selection has been made.
|
93
|
*
|
94
|
* @return a list of <code>UuidAndTitleCache</code> instances
|
95
|
*
|
96
|
* @see #getUuidAndTitleCache(Class, Integer, String)
|
97
|
*/
|
98
|
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern);
|
99
|
|
100
|
}
|