org.jboss.portlet.forums
Interface ForumsModule

All Known Implementing Classes:
ForumsModuleImpl

public interface ForumsModule


Method Summary
 void addAllForums(Category source, Category target)
          DOCUMENT_ME
 Category createCategory(java.lang.String name)
          DOCUMENT_ME
 Forum createForum(Category category, java.lang.String name, java.lang.String description)
          DOCUMENT_ME
 void createForumWatch(Poster poster, Forum forum, int i)
           
 Post createPost(Topic topic, Forum forum, Message message, java.util.Date creationTime, Poster poster)
          DOCUMENT_ME
 Poster createPoster(java.lang.Integer userId)
           
 Post createTopic(Forum forum, Message message, java.util.Date creationDate, Poster poster)
          DOCUMENT_ME
 void createTopicWatch(Poster poster, Topic topic)
           
 java.util.List findAnnouncements(Forum forum)
          Returns all the announcements of the forum
 java.util.List findCategories()
          Get all the categories of forums.
 Category findCategoryByID(java.lang.Integer categoryId)
          DOCUMENT_ME
 Post findFirstPost(Topic topic)
           
 Forum findForumByID(java.lang.Integer id)
          Find a forum by specifying its ID
 java.util.List findForums()
          DOCUMENT_ME
 java.util.List findForumsByCategoryID(java.lang.Integer categoryId)
          Get all the forums of a category
 ForumWatch findForumWatchByID(java.lang.Integer forumWatchId)
           
 java.util.List findForumWatchByUser(User user)
           
 Post findLastPost(Forum forum)
           
 Post findLastPost(Topic topic)
           
 java.util.Date findLastPostDateForUser(User user)
           
 Post findPostByID(java.lang.Integer id)
          DOCUMENT_ME
 Poster findPosterByUserID(java.lang.Integer userID)
          DOCUMENT_ME
 java.util.List findPostsByTopicIDAsc(java.lang.Integer topicId, int start, int limit)
          DOCUMENT_ME
 java.util.List findPostsByTopicIDDesc(java.lang.Integer topicId, int start, int limit)
          DOCUMENT_ME
 Topic findTopicByID(java.lang.Integer topicId)
           
 java.util.List findTopicsAsc(Forum forum, int type, int start, int perPage)
          Returns some topics of a forum that are not of a certain type The topics are ordered by creation date from oldest to newest
 java.util.List findTopicsBefore(Forum forum, int type, int start, int perPage, java.util.Date date)
          DOCUMENT_ME
 java.util.List findTopicsDesc(Forum forum, int type, int start, int perPage)
          Returns some topics of a forum that are not of a certain type The topics are ordered by creation date from newest to oldest
 TopicWatch findTopicWatchByID(java.lang.Integer topicWatchId)
           
 void removeCategory(Category category)
          DOCUMENT_ME
 void removeForum(Forum forum)
          DOCUMENT_ME
 void removeForumWatch(ForumWatch watch)
           
 void removePost(Post post)
          Delete a post
 void removeTopic(Topic topic)
          Delete a topic
 void removeTopicWatch(TopicWatch watch)
           
 

Method Detail

findAnnouncements

java.util.List findAnnouncements(Forum forum)
                                 throws ModuleException
Returns all the announcements of the forum

Parameters:
forum - Forum in which we want to search for the announcements
Returns:
List of topics
Throws:
ModuleException - Throws an exception if unable to find the announcements.

findTopicsAsc

java.util.List findTopicsAsc(Forum forum,
                             int type,
                             int start,
                             int perPage)
                             throws ModuleException
Returns some topics of a forum that are not of a certain type The topics are ordered by creation date from oldest to newest

Parameters:
forum - Forum in which we want to search for topics
type - Type to avoid
start - Index for fetching result
perPage - Number of result to return
Returns:
List of perPage topics ordered by creation date.
Throws:
ModuleException - Throws an excpetion if unable to find the topics.

findTopicsDesc

java.util.List findTopicsDesc(Forum forum,
                              int type,
                              int start,
                              int perPage)
                              throws ModuleException
Returns some topics of a forum that are not of a certain type The topics are ordered by creation date from newest to oldest

Parameters:
forum - Forum in which we want to search for topics
type - Type to avoid
start - Index for fetching result
perPage - Number of result to return
Returns:
List of perPage topics ordered by opposite creation date.
Throws:
ModuleException - Throws an excpetion if unable to find the topics.

findTopicsBefore

java.util.List findTopicsBefore(Forum forum,
                                int type,
                                int start,
                                int perPage,
                                java.util.Date date)
                                throws ModuleException
DOCUMENT_ME

Parameters:
forum - DOCUMENT_ME
type - DOCUMENT_ME
start - DOCUMENT_ME
perPage - DOCUMENT_ME
date - DOCUMENT_ME
Returns:
DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

findForumByID

Forum findForumByID(java.lang.Integer id)
                    throws ModuleException
Find a forum by specifying its ID

Parameters:
id - ID of the forum to retrieve
Returns:
Forum with specified ID
Throws:
ModuleException - Throws an exception if the forum cannot be found

createForum

Forum createForum(Category category,
                  java.lang.String name,
                  java.lang.String description)
                  throws ModuleException
DOCUMENT_ME

Parameters:
category - DOCUMENT_ME
name - DOCUMENT_ME
description - DOCUMENT_ME
Returns:
DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

findPostByID

Post findPostByID(java.lang.Integer id)
                  throws ModuleException
DOCUMENT_ME

Parameters:
id - DOCUMENT_ME
Returns:
DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

findPosterByUserID

Poster findPosterByUserID(java.lang.Integer userID)
                          throws ModuleException
DOCUMENT_ME

Parameters:
userName - DOCUMENT_ME
Returns:
DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

findCategories

java.util.List findCategories()
                              throws ModuleException
Get all the categories of forums.

Returns:
All the categories
Throws:
ModuleException

findForums

java.util.List findForums()
                          throws ModuleException
DOCUMENT_ME

Returns:
DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

findForumsByCategoryID

java.util.List findForumsByCategoryID(java.lang.Integer categoryId)
                                      throws ModuleException
Get all the forums of a category

Parameters:
category - Category of forums
Returns:
Forums of one category
Throws:
ModuleException

createTopic

Post createTopic(Forum forum,
                 Message message,
                 java.util.Date creationDate,
                 Poster poster)
                 throws ModuleException
DOCUMENT_ME

Parameters:
forum - DOCUMENT_ME
message - DOCUMENT_ME
creationDate - DOCUMENT_ME
poster - DOCUMENT_ME
Returns:
The new post created
Throws:
ModuleException - DOCUMENT_ME

createPost

Post createPost(Topic topic,
                Forum forum,
                Message message,
                java.util.Date creationTime,
                Poster poster)
                throws ModuleException
DOCUMENT_ME

Parameters:
topic - DOCUMENT_ME
forum - DOCUMENT_ME
message - DOCUMENT_ME
creationTime - DOCUMENT_ME
poster - DOCUMENT_ME
Returns:
DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

createCategory

Category createCategory(java.lang.String name)
                        throws ModuleException
DOCUMENT_ME

Parameters:
name - DOCUMENT_ME
Returns:
DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

removeCategory

void removeCategory(Category category)
                    throws ModuleException
DOCUMENT_ME

Parameters:
category - DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

removeForum

void removeForum(Forum forum)
                 throws ModuleException
DOCUMENT_ME

Parameters:
forum - DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

removePost

void removePost(Post post)
                throws ModuleException
Delete a post

Parameters:
post - Post to delete
Throws:
ModuleException - DOCUMENT_ME

removeTopic

void removeTopic(Topic topic)
                 throws ModuleException
Delete a topic

Parameters:
post - Topic to delete
Throws:
ModuleException - DOCUMENT_ME

findCategoryByID

Category findCategoryByID(java.lang.Integer categoryId)
                          throws ModuleException
DOCUMENT_ME

Parameters:
categoryId - DOCUMENT_ME
Returns:
DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

addAllForums

void addAllForums(Category source,
                  Category target)
DOCUMENT_ME

Parameters:
source - DOCUMENT_ME
target - DOCUMENT_ME

findTopicByID

Topic findTopicByID(java.lang.Integer topicId)
                    throws ModuleException
Parameters:
topicId -
Returns:
Throws:
ModuleException

findPostsByTopicIDAsc

java.util.List findPostsByTopicIDAsc(java.lang.Integer topicId,
                                     int start,
                                     int limit)
                                     throws ModuleException
DOCUMENT_ME

Parameters:
topicId - DOCUMENT_ME
start - DOCUMENT_ME
limit - DOCUMENT_ME
Returns:
DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

findPostsByTopicIDDesc

java.util.List findPostsByTopicIDDesc(java.lang.Integer topicId,
                                      int start,
                                      int limit)
                                      throws ModuleException
DOCUMENT_ME

Parameters:
topicId - DOCUMENT_ME
start - DOCUMENT_ME
limit - DOCUMENT_ME
Returns:
DOCUMENT_ME
Throws:
ModuleException - DOCUMENT_ME

findLastPostDateForUser

java.util.Date findLastPostDateForUser(User user)
                                       throws ModuleException
Throws:
ModuleException

findLastPost

Post findLastPost(Forum forum)
                  throws ModuleException
Throws:
ModuleException

findFirstPost

Post findFirstPost(Topic topic)
                   throws ModuleException
Throws:
ModuleException

findLastPost

Post findLastPost(Topic topic)
                  throws ModuleException
Throws:
ModuleException

findForumWatchByUser

java.util.List findForumWatchByUser(User user)
                                    throws ModuleException
Throws:
ModuleException

createPoster

Poster createPoster(java.lang.Integer userId)
                    throws ModuleException
Throws:
ModuleException

createForumWatch

void createForumWatch(Poster poster,
                      Forum forum,
                      int i)
                      throws ModuleException
Parameters:
user -
forum -
i -
Throws:
ModuleException

removeForumWatch

void removeForumWatch(ForumWatch watch)
                      throws ModuleException
Parameters:
watch -
Throws:
ModuleException

findForumWatchByID

ForumWatch findForumWatchByID(java.lang.Integer forumWatchId)
                              throws ModuleException
Parameters:
forumWatchId -
Returns:
Throws:
ModuleException

createTopicWatch

void createTopicWatch(Poster poster,
                      Topic topic)
                      throws ModuleException
Parameters:
poster -
topic -
Throws:
ModuleException

removeTopicWatch

void removeTopicWatch(TopicWatch watch)
                      throws ModuleException
Parameters:
watch -
Throws:
ModuleException

findTopicWatchByID

TopicWatch findTopicWatchByID(java.lang.Integer topicWatchId)
                              throws ModuleException
Parameters:
topicWatchId -
Returns:
Throws:
ModuleException