merging /branches/cdmlib/SPRINT-Chichorieae1/ to trunk
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IAgentService.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
11 package eu.etaxonomy.cdm.api.service;
12
13 import java.util.Collection;
14 import java.util.List;
15 import java.util.Map;
16 import java.util.UUID;
17
18 import eu.etaxonomy.cdm.api.service.pager.Pager;
19 import eu.etaxonomy.cdm.model.agent.Address;
20 import eu.etaxonomy.cdm.model.agent.AgentBase;
21 import eu.etaxonomy.cdm.model.agent.Institution;
22 import eu.etaxonomy.cdm.model.agent.InstitutionalMembership;
23 import eu.etaxonomy.cdm.model.agent.Person;
24 import eu.etaxonomy.cdm.model.agent.Team;
25 import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
26 import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
27 import eu.etaxonomy.cdm.persistence.query.OrderHint;
28
29 public interface IAgentService extends IIdentifiableEntityService<AgentBase> {
30
31 public List<Institution> searchInstitutionByCode(String code);
32
33 /**
34 * Return a paged list of the institutional memberships held by a person
35 *
36 * @param person the person
37 * @param pageSize The maximum number of memberships returned (can be null for all memberships)
38 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
39 * @return a Pager containing InstitutionalMembership instances
40 */
41 public Pager<InstitutionalMembership> getInstitutionalMemberships(Person person, Integer pageSize, Integer pageNumber);
42
43 /**
44 * Return a paged list of the members of a team
45 *
46 * @param team the team
47 * @param pageSize The maximum number of members returned (can be null for all members)
48 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
49 * @return a Pager containing Person instances
50 */
51 public Pager<Person> getMembers(Team team, Integer pageSize, Integer pageNumber);
52
53 /**
54 * Return a paged list of the addresses of an agent
55 *
56 * @param agent the agent
57 * @param pageSize The maximum number of addresses returned (can be null for all members)
58 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
59 * @return a Pager containing Address instances
60 */
61 public Pager<Address> getAddresses(AgentBase agent, Integer pageSize, Integer pageNumber);
62
63 /**
64 * Returns a Paged List of AgentBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
65 *
66 * @param clazz filter the results by class (or pass null to return all AgentBase instances)
67 * @param queryString
68 * @param pageSize The maximum number of agents returned (can be null for all matching agents)
69 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
70 * @param orderHints
71 * Supports path like <code>orderHints.propertyNames</code> which
72 * include *-to-one properties like createdBy.username or
73 * authorTeam.persistentTitleCache
74 * @param propertyPaths properties to be initialized
75 * @return a Pager Agent instances
76 * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
77 */
78 public Pager<AgentBase> search(Class<? extends AgentBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
79
80 /**
81 * Returns a list of <code>UuidAndTitleCache</code> containing all <code>Person</code>s
82 *
83 * @return a list of <code>UuidAndTitleCache</code> instances
84 */
85 public List<UuidAndTitleCache<Person>> getPersonUuidAndNomenclaturalTitle();
86
87 /**
88 * Returns a list of <code>UuidAndTitleCache</code> containing all <code>TeamOrPersonBase</code> obejcts
89 * with their respective nomenclaturalTitle instead of regular titleCache
90 *
91 * @return a list of <code>UuidAndTitleCache</code> instances
92 */
93 public List<UuidAndTitleCache<Team>> getTeamUuidAndNomenclaturalTitle();
94 }