X-Git-Url: https://dev.e-taxonomy.eu/gitweb/cdmlib.git/blobdiff_plain/d57c0df0b31a0f07c484e48338b6b56e01324c4e..404c00360ac8b821764dcf03e0b5b9fb365074ca:/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAgentService.java?ds=sidebyside diff --git a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAgentService.java b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAgentService.java index 735e4f78a4..dba4504c08 100644 --- a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAgentService.java +++ b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAgentService.java @@ -1,3 +1,4 @@ +// $Id$ /** * Copyright (C) 2007 EDIT * European Distributed Institute of Taxonomy @@ -9,36 +10,21 @@ package eu.etaxonomy.cdm.api.service; -import java.util.Collection; import java.util.List; -import java.util.Map; -import java.util.UUID; import eu.etaxonomy.cdm.api.service.pager.Pager; -import eu.etaxonomy.cdm.model.agent.Agent; +import eu.etaxonomy.cdm.model.agent.Address; +import eu.etaxonomy.cdm.model.agent.AgentBase; import eu.etaxonomy.cdm.model.agent.Institution; import eu.etaxonomy.cdm.model.agent.InstitutionalMembership; import eu.etaxonomy.cdm.model.agent.Person; import eu.etaxonomy.cdm.model.agent.Team; +import eu.etaxonomy.cdm.model.common.UuidAndTitleCache; +import eu.etaxonomy.cdm.persistence.query.OrderHint; -public interface IAgentService extends IIdentifiableEntityService { - - // FIXME Candidate for harmonization - public abstract Agent getAgentByUuid(UUID uuid); - - // FIXME Candidate for harmonization - public abstract UUID saveAgent(Agent agent); - - // FIXME Candidate for harmonization - public abstract Map saveAgentAll(Collection agentCollection); - - // FIXME Candidate for harmonization - public abstract List findAgentsByTitle(String title); - - // FIXME Candidate for harmonization - public abstract List getAllAgents(int limit, int start); - - public abstract List searchInstitutionByCode(String code); +public interface IAgentService extends IIdentifiableEntityService { + + public List searchInstitutionByCode(String code); /** * Return a paged list of the institutional memberships held by a person @@ -59,4 +45,63 @@ public interface IAgentService extends IIdentifiableEntityService { * @return a Pager containing Person instances */ public Pager getMembers(Team team, Integer pageSize, Integer pageNumber); + + /** + * Return a paged list of the addresses of an agent + * + * @param agent the agent + * @param pageSize The maximum number of addresses returned (can be null for all members) + * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based) + * @return a Pager containing Address instances + */ + public Pager
getAddresses(AgentBase agent, Integer pageSize, Integer pageNumber); + + /** + * Returns a Paged List of AgentBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser) + * + * @param clazz filter the results by class (or pass null to return all AgentBase instances) + * @param queryString + * @param pageSize The maximum number of agents returned (can be null for all matching agents) + * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based) + * @param orderHints + * Supports path like orderHints.propertyNames which + * include *-to-one properties like createdBy.username or + * authorTeam.persistentTitleCache + * @param propertyPaths properties to be initialized + * @return a Pager Agent instances + * @see Apache Lucene - Query Parser Syntax + */ + public Pager search(Class clazz, String queryString, Integer pageSize, Integer pageNumber, List orderHints, List propertyPaths); + + /** + * Returns a list of UuidAndTitleCache containing all Persons + * + * @return a list of UuidAndTitleCache instances + */ + public List> getPersonUuidAndTitleCache(); + + /** + * Returns a list of UuidAndTitleCache containing all TeamOrPersonBase objects + * with their respective titleCache + * + * @return a list of UuidAndTitleCache instances + */ + public List> getTeamUuidAndTitleCache(); + + /** + * Returns a list of UuidAndTitleCache containing all TeamOrPersonBase objects + * with their respective nomenclaturalTitle instead of regular titleCache + * + * @return a list of UuidAndTitleCache instances + */ + public List> getTeamUuidAndNomenclaturalTitle(); + + /** + * Returns a list of UuidAndTitleCache containing all {@link Institution} objects + * with their respective titleCache + * + * @return a list of UuidAndTitleCache instances + */ + public List> getInstitutionUuidAndTitleCache(); + }