| java.lang.Object net.jforum.view.forum.common.TopicsCommon
TopicsCommon | public class TopicsCommon (Code) | | General utilities methods for topic manipulation.
author: Rafael Steil version: $Id: TopicsCommon.java,v 1.47 2007/09/10 23:07:00 rafaelsteil Exp $ |
Method Summary | |
public static synchronized void | deleteTopic(int topicId, int forumId, boolean fromModeration) Deletes a topic. | public static boolean | isTopicAccessible(int forumId) Checks if the user is allowed to view the topic. | public static void | notifyUsers(Topic t, Post p) Sends a "new post" notification message to all users watching the topic. | public static List | prepareTopics(List topics) Prepare the topics for listing. | public static void | topicListingBase() | public static List | topicsByForum(int forumId, int start) List all first 'n' topics of a given forum.
This method returns no more than ConfigKeys.TOPICS_PER_PAGE
topics for the forum. | public static synchronized void | updateBoardStatus(Topic topic, int lastPostId, boolean firstPost, TopicDAO topicDao, ForumDAO forumDao) Updates the board status after a new post is inserted.
This method is used in conjunct with moderation manipulation. |
deleteTopic | public static synchronized void deleteTopic(int topicId, int forumId, boolean fromModeration)(Code) | | Deletes a topic.
This method will remove the topic from the database,
clear the entry frm the cache and update the last
post info for the associated forum.
Parameters: topicId - The topic id to remove Parameters: fromModeration - boolean Parameters: forumId - int |
isTopicAccessible | public static boolean isTopicAccessible(int forumId)(Code) | | Checks if the user is allowed to view the topic.
If there currently logged user does not have access
to the forum, the template context will be set to show
an error message to the user, by calling
new ModerationHelper().denied(I18n.getMessage("PostShow.denied"))
Parameters: forumId - The forum id to which the topics belongs to true if the topic is accessible, false otherwise |
notifyUsers | public static void notifyUsers(Topic t, Post p)(Code) | | Sends a "new post" notification message to all users watching the topic.
Parameters: t - The changed topic Parameters: p - The new message |
prepareTopics | public static List prepareTopics(List topics)(Code) | | Prepare the topics for listing.
This method does some preparation for a set ot net.jforum.entities.Topic
instances for the current user, like verification if the user already
read the topic, if pagination is a need and so on.
Parameters: topics - The topics to process The post-processed topics. |
topicListingBase | public static void topicListingBase()(Code) | | Common properties to be used when showing topic data
|
topicsByForum | public static List topicsByForum(int forumId, int start)(Code) | | List all first 'n' topics of a given forum.
This method returns no more than ConfigKeys.TOPICS_PER_PAGE
topics for the forum.
Parameters: forumId - The forum id to which the topics belongs to Parameters: start - The start fetching index java.util.List containing the topics found. |
updateBoardStatus | public static synchronized void updateBoardStatus(Topic topic, int lastPostId, boolean firstPost, TopicDAO topicDao, ForumDAO forumDao)(Code) | | Updates the board status after a new post is inserted.
This method is used in conjunct with moderation manipulation.
It will increase by 1 the number of replies of the tpoic, set the
last post id for the topic and the forum and refresh the cache.
Parameters: topic - Topic The topic to update Parameters: lastPostId - int The id of the last post Parameters: topicDao - TopicDAO A TopicModel instance Parameters: forumDao - ForumDAO A ForumModel instance Parameters: firstPost - boolean |
|
|