info.magnolia.module.forum
Interface ForumManager

All Known Implementing Classes:
DefaultForumManager

public interface ForumManager

Basic forum contract defining all mandatory operations for each manager implementation.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Nested Class Summary
static class ForumManager.Factory
          Use this to retrieve the configured impl of ForumManager.
 
Method Summary
 info.magnolia.cms.core.Content createForum(String name, String title)
          Creates a forum with the given name and returns its node.
 info.magnolia.cms.core.Content createForum(String name, String title, boolean withMessageNesting)
          Creates a forum with the given name and returns its node.
 info.magnolia.cms.core.Content createThread(String forumID, String threadTitle, String messageText, String author, boolean isAnonymous)
          Creates a new thread in the given forum and returns this thread's node.
 info.magnolia.cms.core.Content createThread(String forumID, String threadTitle, String messageTitle, String messageText, String author, boolean isAnonymous)
          Creates a new thread in the given forum and returns this thread's node.
 void deleteForum(String forumID)
           
 void deleteMessage(String messageID)
           
 void deleteThread(String threadID)
           
 info.magnolia.cms.core.Content getForum(String forumId)
           
 info.magnolia.cms.core.Content getForumFromThread(info.magnolia.cms.core.Content thread)
          Returns the forum node associated to the given thread.
 String getForumId(String shortName)
          Resolves forum short name into uuid.
 Collection<info.magnolia.cms.core.Content> getForumList()
          Returns a Collection of available forums.
 Collection<info.magnolia.cms.core.Content> getForumMessages(String forumName)
          Gets all messages for given forum ordered by publication date.
 PagedResult getMessages(info.magnolia.cms.core.Content thread, long page)
          Returns a given page of messages from the given thread.
 info.magnolia.cms.core.Content getThread(String threadID)
           
 info.magnolia.cms.core.Content getThreadFromMessage(info.magnolia.cms.core.Content message)
          Returns the thread associated to the given message.
 Collection<info.magnolia.cms.core.Content> getThreads(info.magnolia.cms.core.Content forum)
          Returns a Collection of threads in the given forum.
 void invalidate(String messageID)
          Marks a message as explicitly invalid.
 boolean isAllowedToPostOnForum(info.magnolia.cms.core.Content forum)
          Checks if current user is allowed to post on the given forum.
 boolean isAllowedToPostOnThread(info.magnolia.cms.core.Content thread)
          Checks if current user is allowed to post on the given thread.
 void isModerator()
          Checks whether the current logged-in user is moderator.
 void lockForum(String forumID)
          A locked forum can not have threads created in it by users.
 void lockThread(String threadID)
           
 info.magnolia.cms.core.Content replyToThread(String threadID, String inReplyToID, String messageTitle, String messageText, String author, boolean isAnonymous)
          Adds a message to a thread and returns this new message's node.
 void unlockForum(String forumID)
           
 void unlockThread(String threadID)
           
 void validate(String messageID)
           
 

Method Detail

createForum

info.magnolia.cms.core.Content createForum(String name,
                                           String title)
                                           throws javax.jcr.RepositoryException
Creates a forum with the given name and returns its node.

Throws:
javax.jcr.RepositoryException

createForum

info.magnolia.cms.core.Content createForum(String name,
                                           String title,
                                           boolean withMessageNesting)
                                           throws javax.jcr.RepositoryException
Creates a forum with the given name and returns its node.

Throws:
javax.jcr.RepositoryException

getForumList

Collection<info.magnolia.cms.core.Content> getForumList()
                                                        throws javax.jcr.RepositoryException
Returns a Collection of available forums. This potentially filters out content unavailable to the current user. TODO : should return a List

Throws:
javax.jcr.RepositoryException

getForumId

String getForumId(String shortName)
                  throws javax.jcr.RepositoryException
Resolves forum short name into uuid.

Throws:
javax.jcr.RepositoryException

getForum

info.magnolia.cms.core.Content getForum(String forumId)
                                        throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getThreads

Collection<info.magnolia.cms.core.Content> getThreads(info.magnolia.cms.core.Content forum)
                                                      throws javax.jcr.RepositoryException
Returns a Collection of threads in the given forum. This potentially filters out content unavailable to the current user. TODO : should return a List

Throws:
javax.jcr.RepositoryException

createThread

info.magnolia.cms.core.Content createThread(String forumID,
                                            String threadTitle,
                                            String messageText,
                                            String author,
                                            boolean isAnonymous)
                                            throws javax.jcr.RepositoryException
Creates a new thread in the given forum and returns this thread's node.

Throws:
javax.jcr.RepositoryException

createThread

info.magnolia.cms.core.Content createThread(String forumID,
                                            String threadTitle,
                                            String messageTitle,
                                            String messageText,
                                            String author,
                                            boolean isAnonymous)
                                            throws javax.jcr.RepositoryException
Creates a new thread in the given forum and returns this thread's node.

Throws:
javax.jcr.RepositoryException

replyToThread

info.magnolia.cms.core.Content replyToThread(String threadID,
                                             String inReplyToID,
                                             String messageTitle,
                                             String messageText,
                                             String author,
                                             boolean isAnonymous)
                                             throws javax.jcr.RepositoryException
Adds a message to a thread and returns this new message's node.

Parameters:
isAnonymous - TODO
Throws:
javax.jcr.RepositoryException

getThread

info.magnolia.cms.core.Content getThread(String threadID)
                                         throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getForumFromThread

info.magnolia.cms.core.Content getForumFromThread(info.magnolia.cms.core.Content thread)
                                                  throws javax.jcr.RepositoryException
Returns the forum node associated to the given thread.

Throws:
javax.jcr.RepositoryException

getThreadFromMessage

info.magnolia.cms.core.Content getThreadFromMessage(info.magnolia.cms.core.Content message)
                                                    throws javax.jcr.RepositoryException
Returns the thread associated to the given message.

Throws:
javax.jcr.RepositoryException

getMessages

PagedResult getMessages(info.magnolia.cms.core.Content thread,
                        long page)
                        throws javax.jcr.RepositoryException
Returns a given page of messages from the given thread. Will return the number of messages dictated by ForumConfiguration. Read permission is check when returning messages: messages which are not allowed to be read will not be returned, but will not be taken into account when calculating the range of messages to return either. Page count starts at 1.

Throws:
javax.jcr.RepositoryException

getForumMessages

Collection<info.magnolia.cms.core.Content> getForumMessages(String forumName)
                                                            throws javax.jcr.RepositoryException
Gets all messages for given forum ordered by publication date.

Throws:
javax.jcr.RepositoryException

deleteForum

void deleteForum(String forumID)
                 throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

deleteThread

void deleteThread(String threadID)
                  throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

deleteMessage

void deleteMessage(String messageID)
                   throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

lockForum

void lockForum(String forumID)
               throws javax.jcr.RepositoryException
A locked forum can not have threads created in it by users.

Throws:
javax.jcr.RepositoryException

unlockForum

void unlockForum(String forumID)
                 throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

lockThread

void lockThread(String threadID)
                throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

unlockThread

void unlockThread(String threadID)
                  throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

validate

void validate(String messageID)
              throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

invalidate

void invalidate(String messageID)
                throws javax.jcr.RepositoryException
Marks a message as explicitly invalid.

Throws:
javax.jcr.RepositoryException

isAllowedToPostOnForum

boolean isAllowedToPostOnForum(info.magnolia.cms.core.Content forum)
Checks if current user is allowed to post on the given forum.


isAllowedToPostOnThread

boolean isAllowedToPostOnThread(info.magnolia.cms.core.Content thread)
Checks if current user is allowed to post on the given thread.


isModerator

void isModerator()
                 throws info.magnolia.cms.security.AccessDeniedException
Checks whether the current logged-in user is moderator.

Throws:
info.magnolia.cms.security.AccessDeniedException


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.