Merging r13268 through r14040 from trunk/cdmlib into branches/cdmlib-unitils3
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / ICollectionService.java
1 /**
2 * Copyright (C) 2009 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
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.UuidAndTitleCache;
16 import eu.etaxonomy.cdm.model.occurrence.Collection;
17 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
18
19 import eu.etaxonomy.cdm.persistence.query.OrderHint;
20
21 public interface ICollectionService extends IIdentifiableEntityService<Collection> {
22
23 /**
24 * Returns a Paged List of Collection instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
25 *
26 * @param clazz filter the results by class (or pass null to return all Collection instances)
27 * @param queryString
28 * @param pageSize The maximum number of collections returned (can be null for all matching collections)
29 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
30 * @param orderHints
31 * Supports path like <code>orderHints.propertyNames</code> which
32 * include *-to-one properties like createdBy.username or
33 * authorTeam.persistentTitleCache
34 * @param propertyPaths properties to be initialized
35 * @return a Pager Collection instances
36 * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
37 */
38 public Pager<Collection> search(Class<? extends Collection> clazz, String query, Integer pageSize,Integer pageNumber, List<OrderHint> orderHints,List<String> propertyPaths);
39
40 /**
41 * Return a list of collections matching the given code
42 * @param code
43 * @return a List of Collection objects
44 */
45 public List<Collection> searchByCode(String code);
46 }