3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.cdm
.api
.service
;
13 import java
.util
.Collection
;
14 import java
.util
.List
;
16 import java
.util
.UUID
;
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
;
29 public interface IAgentService
extends IIdentifiableEntityService
<AgentBase
> {
31 public List
<Institution
> searchInstitutionByCode(String code
);
34 * Return a paged list of the institutional memberships held by a person
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
41 public Pager
<InstitutionalMembership
> getInstitutionalMemberships(Person person
, Integer pageSize
, Integer pageNumber
);
44 * Return a paged list of the members of a team
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
51 public Pager
<Person
> getMembers(Team team
, Integer pageSize
, Integer pageNumber
);
54 * Return a paged list of the addresses of an agent
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
61 public Pager
<Address
> getAddresses(AgentBase agent
, Integer pageSize
, Integer pageNumber
);
64 * Returns a Paged List of AgentBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
66 * @param clazz filter the results by class (or pass null to return all AgentBase instances)
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)
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>
78 public Pager
<AgentBase
> search(Class
<?
extends AgentBase
> clazz
, String queryString
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
81 * Returns a list of <code>UuidAndTitleCache</code> containing all <code>Person</code>s
83 * @return a list of <code>UuidAndTitleCache</code> instances
85 public List
<UuidAndTitleCache
<Person
>> getPersonUuidAndNomenclaturalTitle();
88 * Returns a list of <code>UuidAndTitleCache</code> containing all <code>TeamOrPersonBase</code> obejcts
89 * with their respective nomenclaturalTitle instead of regular titleCache
91 * @return a list of <code>UuidAndTitleCache</code> instances
93 public List
<UuidAndTitleCache
<TeamOrPersonBase
>> getTeamOrPersonBaseUuidAndNomenclaturalTitle();