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
 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, int type)
          DOCUMENT_ME
 void createWatch(Poster poster, Forum forum, int i)
           
 void createWatch(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 removePost(Post post)
          Delete a post
 void removeTopic(Topic topic)
          Delete a topic
 void removeWatch(Watch 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:
userID - 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:
categoryID - Category of forums
Returns:
Forums of one category
Throws:
ModuleException

createTopic

Post createTopic(Forum forum,
                 Message message,
                 java.util.Date creationDate,
                 Poster poster,
                 int type)
                 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:
topic - 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

createWatch

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

findForumWatchByID

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

createWatch

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

findTopicWatchByID

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

removeWatch

void removeWatch(Watch watch)
                 throws ModuleException
Parameters:
watch -
Throws:
ModuleException