javadoc
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IDescriptiveDataSetService.java
1 package eu.etaxonomy.cdm.api.service;
2
3 import java.util.Collection;
4 import java.util.List;
5 import java.util.Map;
6 import java.util.Set;
7 import java.util.UUID;
8
9 import eu.etaxonomy.cdm.api.service.dto.RowWrapperDTO;
10 import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
11 import eu.etaxonomy.cdm.model.description.DescriptionBase;
12 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
13 import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
14 import eu.etaxonomy.cdm.model.description.DescriptiveSystemRole;
15 import eu.etaxonomy.cdm.model.description.Feature;
16 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
17 import eu.etaxonomy.cdm.persistence.dto.SpecimenNodeWrapper;
18 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
19
20
21 public interface IDescriptiveDataSetService extends IIdentifiableEntityService<DescriptiveDataSet> {
22 /**
23 * Returns a Map of descriptions each with the description elements that match
24 * the supplied features (or all description elements if no features are supplied)
25 *
26 * @param descriptiveDataSet the data set which the descriptions belong to
27 * @param features restrict the returned description elements to those which have features in this set
28 * @param pageSize The maximum number of descriptions returned (can be null for all descriptions that belong to the data set)
29 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based,
30 * can be null, equivalent of starting at the beginning of the recordset). Descriptions are sorted by titleCache
31 * @param propertyPaths properties to be initialized (applied to the descriptionElements)
32 * @return
33 */
34 public Map<DescriptionBase, Set<DescriptionElementBase>> getDescriptionElements(DescriptiveDataSet descriptiveDataSet, Set<Feature> features, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
35
36 public <T extends DescriptionElementBase> Map<UuidAndTitleCache, Map<UUID, Set<T>>> getTaxonFeatureDescriptionElementMap(Class<T> clazz, UUID descriptiveDataSetUuid, DescriptiveSystemRole role);
37
38 /**
39 * Returns a list of {@link UuidAndTitleCache} elements for all {@link DescriptiveDataSet}s in the data base
40 * @param limitOfInitialElements
41 * @param pattern
42 * @return a list of UuidAndTitleCache element
43 */
44 public List<UuidAndTitleCache<DescriptiveDataSet>> getDescriptiveDataSetUuidAndTitleCache(Integer limitOfInitialElements, String pattern);
45
46 /**
47 * Returns a collection of {@link RowWrapperDTO} objects for the given {@link DescriptiveDataSet}.<br>
48 * A RowWrapper represents on row in the character matrix.
49 * @param descriptiveDataSet the working set for which the row wrapper objects should be fetched
50 * @param the progress monitor
51 * @return a list of row wrapper objects
52 */
53 public Collection<RowWrapperDTO> getRowWrapper(DescriptiveDataSet descriptiveDataSet, IProgressMonitor monitor);
54
55 /**
56 * Monitored invocation of {@link IDescriptiveDataSetService#getRowWrapper(DescriptiveDataSet, IProgressMonitor)}
57 * @param descriptiveDataSet the working set for which getRowWrapper() is invoked
58 * @return the uuid of the monitor
59 */
60 public UUID monitGetRowWrapper(DescriptiveDataSet descriptiveDataSet);
61
62 /**
63 * Loads all avaliable specimens wrapped in a {@link SpecimenNodeWrapper} object for
64 * a given {@link DescriptiveDataSet} according to the filters set in the working set
65 * @param descriptiveDataSet the working set for which the specimens should be fetched
66 * @return a collection of wrapper objects
67 */
68 public Collection<SpecimenNodeWrapper> loadSpecimens(DescriptiveDataSet descriptiveDataSet);
69
70 /**
71 * Creates a row wrapper object for the given specimen
72 * @param specimen the specimen for which the wrapper should be created
73 * @param descriptiveDataSet the data set it should be used in
74 * @return the created row wrapper
75 */
76 public RowWrapperDTO createRowWrapper(SpecimenOrObservationBase specimen, DescriptiveDataSet descriptiveDataSet);
77
78 /**
79 * Creates a row wrapper object for the given description
80 * @param description the description for which the wrapper should be created
81 * @param descriptiveDataSet the data set it should be used in
82 * @return the created row wrapper
83 */
84 public RowWrapperDTO createRowWrapper(DescriptionBase description, DescriptiveDataSet descriptiveDataSet);
85
86 }