org.ow2.dragon.service.organization
Class PostManagerImpl

java.lang.Object
  extended by org.ow2.dragon.service.organization.PostManagerImpl
All Implemented Interfaces:
PostManager

public class PostManagerImpl
extends java.lang.Object
implements PostManager

Author:
ofabre - eBM WebSourcing

Constructor Summary
PostManagerImpl()
           
 
Method Summary
 java.lang.String createPost(PostTO postTO)
          Add a new post in registry.
 java.util.List<PostTO> getAllPosts(RequestOptionsTO requestOptionsTO)
          Return the list of all posts in the registry
 PostTO getPost(java.lang.String postId)
          Retrieve the post matching the given id
 java.util.List<PostTO> getPostsNotLinkedToOrganization(java.lang.String orgId, RequestOptionsTO requestOptionsTO)
          Return the list of all posts in the registry that aren't linked to the given organization
 java.util.List<PostTO> getPostsNotLinkedToPersons(RequestOptionsTO requestOptionsTO)
          Return the list of all posts in the registry that aren't linked to a person
 void removePost(java.lang.String postId)
          Remove the post matching the given id from the registry
 java.util.List<PostTO> searchPost(java.lang.String searchCriteria, java.util.List<PostSearchProperties> searchedProperties, RequestOptionsTO requestOptionsTO)
          Retrieve a list of posts matching the given criteria for the given properties
 void setOrganizationUnitDAO(OrganizationUnitDAO organizationUnitDAO)
           
 void setPersonUnifiedDAO(GenericUnifiedDAO<Person,java.lang.String> personUnifiedDAO)
           
 void setPostDAO(GenericUnifiedDAO<Post,java.lang.String> postDAO)
           
 void setTransfertObjectAssembler(TransfertObjectAssembler transfertObjectAssembler)
           
 java.lang.String updatePost(PostTO postTO)
          Update the post in the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostManagerImpl

public PostManagerImpl()
Method Detail

createPost

public java.lang.String createPost(PostTO postTO)
                            throws OrganizationException
Description copied from interface: PostManager
Add a new post in registry. The post name must be specified.

Specified by:
createPost in interface PostManager
Parameters:
postTO - the PostTO handling data of the Post to add
Returns:
the added Post id
Throws:
OrganizationException - if you try to create a post with no name or a name that already exist

searchPost

public java.util.List<PostTO> searchPost(java.lang.String searchCriteria,
                                         java.util.List<PostSearchProperties> searchedProperties,
                                         RequestOptionsTO requestOptionsTO)
                                  throws OrganizationException
Description copied from interface: PostManager
Retrieve a list of posts matching the given criteria for the given properties

Specified by:
searchPost in interface PostManager
Parameters:
searchCriteria - the search criteria (a String containing criteria separated with whitespaces), mustn't be empty
searchedProperties - the searched properties, mustn't be empty
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
a List of PostTO matching the given criteria for the given properties
Throws:
OrganizationException - if you try to search posts without specifying search criteria

getAllPosts

public java.util.List<PostTO> getAllPosts(RequestOptionsTO requestOptionsTO)
Description copied from interface: PostManager
Return the list of all posts in the registry

Specified by:
getAllPosts in interface PostManager
Parameters:
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of all PostTOs in the registry. Not null, could be empty

getPost

public PostTO getPost(java.lang.String postId)
               throws OrganizationException
Description copied from interface: PostManager
Retrieve the post matching the given id

Specified by:
getPost in interface PostManager
Parameters:
postId - a Post id
Returns:
the PostTO handling data of the Post that match the given id
Throws:
OrganizationException - if you try to retrieve a post that doesn't exist

getPostsNotLinkedToOrganization

public java.util.List<PostTO> getPostsNotLinkedToOrganization(java.lang.String orgId,
                                                              RequestOptionsTO requestOptionsTO)
                                                       throws OrganizationException
Description copied from interface: PostManager
Return the list of all posts in the registry that aren't linked to the given organization

Specified by:
getPostsNotLinkedToOrganization in interface PostManager
Parameters:
orgId - an OrganizationUnit id
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of all PostTOs in the registry that aren't linked to the given organization
Throws:
OrganizationException - if an error occurs during posts retrieval

getPostsNotLinkedToPersons

public java.util.List<PostTO> getPostsNotLinkedToPersons(RequestOptionsTO requestOptionsTO)
                                                  throws OrganizationException
Description copied from interface: PostManager
Return the list of all posts in the registry that aren't linked to a person

Specified by:
getPostsNotLinkedToPersons in interface PostManager
Parameters:
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of all PostTOs in the registry that aren't linked to a person
Throws:
OrganizationException - if an error occurs during posts retrieval

removePost

public void removePost(java.lang.String postId)
                throws OrganizationException
Description copied from interface: PostManager
Remove the post matching the given id from the registry

Specified by:
removePost in interface PostManager
Parameters:
postId - a Post id
Throws:
OrganizationException - if no post found for the given id

setOrganizationUnitDAO

public void setOrganizationUnitDAO(OrganizationUnitDAO organizationUnitDAO)

setPostDAO

public void setPostDAO(GenericUnifiedDAO<Post,java.lang.String> postDAO)

setTransfertObjectAssembler

public void setTransfertObjectAssembler(TransfertObjectAssembler transfertObjectAssembler)

updatePost

public java.lang.String updatePost(PostTO postTO)
                            throws OrganizationException
Description copied from interface: PostManager
Update the post in the registry. Post name and id must be specified

Specified by:
updatePost in interface PostManager
Parameters:
postTO - the PostTO handling data of the Post to update
Returns:
the updated post ID
Throws:
OrganizationException - if you try to update a post with a name that already exist or with a null or empty name, or if you try to update a post that doesn't exist

setPersonUnifiedDAO

public void setPersonUnifiedDAO(GenericUnifiedDAO<Person,java.lang.String> personUnifiedDAO)


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.