org.ow2.dragon.api.service.organization
Interface PersonManager

All Known Implementing Classes:
PersonManagerImpl

@Transactional
public interface PersonManager

A manager of persons. Provides methods to create, retrieve, delete or update persons

Author:
ambarthe, ofabre - eBM WebSourcing

Method Summary
 java.lang.String createPerson(PersonTO personTO)
          Add a new person in registry.
 java.util.List<PersonTO> getAllPersons(RequestOptionsTO requestOptionsTO)
          Return the list of all persons in the registry
 PersonTO getPerson(java.lang.String personId)
          Retrieve the person matching the given ID
 java.util.List<PersonTO> getPersonsByOrgAndPost(java.lang.String organizationId, java.lang.String postId, RequestOptionsTO optionsTO)
          Retrieve the list of persons that are assigned to the given post in the given organization unit
 java.util.List<PersonTO> getPersonsByOrganization(java.lang.String organizationId, RequestOptionsTO requestOptionsTO)
          Retrieve the list of persons that are parts of the given organization unit
 java.util.List<PersonTO> getPersonsByPost(java.lang.String postId, RequestOptionsTO requestOptionsTO)
          Retrieve the list of persons that are assigned to the given post
 void removePerson(java.lang.String personId)
          Remove the person matching the given id from the registry
 java.util.List<PersonTO> searchPersons(java.lang.String searchCriteria, java.util.List<PersonSearchProperties> searchedProperties, RequestOptionsTO iOptions)
          Retrieve a list of persons matching the given criteria for the given properties
 java.lang.String updatePerson(PersonTO personTO)
          Update the person in the registry
 

Method Detail

createPerson

java.lang.String createPerson(PersonTO personTO)
                              throws OrganizationException
Add a new person in registry. Firstname, Lastname and email must be specified

Parameters:
personTO - the PersonTO handling data of the Person to add
Returns:
the id of the added Person
Throws:
OrganizationException - if you try to create a person with firstname/lastname/email that already exists or a person without firstname, lastname and email

getAllPersons

@Transactional(readOnly=true)
java.util.List<PersonTO> getAllPersons(RequestOptionsTO requestOptionsTO)
Return the list of all persons in the registry

Parameters:
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of all PersonTO handling Person data in the registry, couldn't be null, can be empty

getPerson

@Transactional(readOnly=true)
PersonTO getPerson(java.lang.String personId)
                   throws OrganizationException
Retrieve the person matching the given ID

Parameters:
personId - a Person id
Returns:
the PersonTO handling data of the Person matching the given id
Throws:
OrganizationException - if no person found for the given id

getPersonsByOrgAndPost

java.util.List<PersonTO> getPersonsByOrgAndPost(java.lang.String organizationId,
                                                java.lang.String postId,
                                                RequestOptionsTO optionsTO)
Retrieve the list of persons that are assigned to the given post in the given organization unit

Parameters:
organizationId - an OrganizationUnit id
postId - a Post id
optionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of PersonTOs that are assigned to the given post in the given organization unit

getPersonsByOrganization

@Transactional(readOnly=true)
java.util.List<PersonTO> getPersonsByOrganization(java.lang.String organizationId,
                                                                RequestOptionsTO requestOptionsTO)
                                                  throws OrganizationException
Retrieve the list of persons that are parts of the given organization unit

Parameters:
organizationId - an OrganizationUnit id
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of PersonTOs that are parts of the given OrganizationUnit
Throws:
OrganizationException - if an error occurs during persons retrieval

getPersonsByPost

@Transactional(readOnly=true)
java.util.List<PersonTO> getPersonsByPost(java.lang.String postId,
                                                        RequestOptionsTO requestOptionsTO)
                                          throws OrganizationException
Retrieve the list of persons that are assigned to the given post

Parameters:
postId - a Post id
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of PersonTOs that are assigned to the given Post
Throws:
OrganizationException - if an error occurs during persons retrieval

removePerson

void removePerson(java.lang.String personId)
Remove the person matching the given id from the registry

Parameters:
personId - a Person id

searchPersons

@Transactional(readOnly=true)
java.util.List<PersonTO> searchPersons(java.lang.String searchCriteria,
                                                     java.util.List<PersonSearchProperties> searchedProperties,
                                                     RequestOptionsTO iOptions)
                                       throws OrganizationException
Retrieve a list of persons matching the given criteria for the given properties

Parameters:
searchCriteria - the search criteria (a String containing criteria separated with whitespaces)
searchedProperties - the searched properties
iOptions - sort, pagination and case sensitive parameters, could be null
Returns:
a List of PersonTO matching the given criteria for the given properties
Throws:
OrganizationException - if an error occurs during persons retrieval

updatePerson

java.lang.String updatePerson(PersonTO personTO)
                              throws OrganizationException
Update the person in the registry

Parameters:
personTO - the PersonTO handling information of the Person to update
Returns:
the updated Person id
Throws:
OrganizationException - if an error occurs during person update


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.