org.locomotive.module.discuss
Class DiscussionAdminHandler
java.lang.Object
|
+--org.locomotive.loco.handler.GenericHandler
|
+--org.locomotive.module.discuss.DiscussionAdminHandler
- public class DiscussionAdminHandler
- extends GenericHandler
This class handles the administration for the communities. It provides
screens which allow a user to modify discussion, topics, and posts,
as well as add them. It is desgined to allow quick and easy moderation
of discussions; at the possible expense of some performance. This
should be okay because only a few administrators should be seeing these
pages. Permission to view these pages is based on whether or
not the user has org.locomotive.module.discuss.DiscussionAdminHandler.COMM_ADMIN
permission, listed below.
Field Summary |
static java.lang.String |
COMM_ADMIN
Allows a user to administer user access control for discussions and
topics: |
static java.lang.String |
COMM_READ
Allows a user read access to a discussion or topic: |
static int |
TOPIC_TO_ACL_FILTER
Since categories and topics share the same ids since they both start at
1, we must make a distinction between category and topic ids for
the acls. |
Fields inherited from class org.locomotive.loco.handler.GenericHandler |
already_displayed_page,
conn,
DEBUG,
ERROR,
form_data,
handler_uri,
hd,
NORMAL,
session,
steam_vars,
url_tokens,
user,
WARNING |
Method Summary |
void |
handleAdminPosts()
Handles all post administration. |
void |
handleAdminTopics()
Handles all topic administration. |
void |
handleRequest(HandlerData hd_in)
This handles the administration for communities discussions, topics, and
posts. |
boolean |
init(Log log)
our templates are loaded by DiscussionHandler for now,
so we don't need to do anything |
void |
modifyDiscUsers(int catId)
|
boolean |
shutdown(Log log)
Nothing to do here either, presently. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
COMM_ADMIN
public static final java.lang.String COMM_ADMIN
- Allows a user to administer user access control for discussions and
topics:
COMM_READ
public static final java.lang.String COMM_READ
- Allows a user read access to a discussion or topic:
TOPIC_TO_ACL_FILTER
public static final int TOPIC_TO_ACL_FILTER
- Since categories and topics share the same ids since they both start at
1, we must make a distinction between category and topic ids for
the acls. Therefore acl ids for categories are the same as the
category ids, while acl ids for topics are the topic ids plus this
filter. Please note that we cannot have more than 1000000 categories!
DiscussionAdminHandler
public DiscussionAdminHandler()
handleRequest
public void handleRequest(HandlerData hd_in)
- This handles the administration for communities discussions, topics, and
posts. Shows an unknown handler error page if the user does not have
the correct admin permission to be here.
All templates for communities admin should be in the
'discuss/admin/commmgr' directory.
The tokens and their corresponding methods are:
Token Method Template
MOD modifyDiscussion comm_disc_filledtempl.tmpl
TOP handleAdminTopics() comm_topics_list.tmpl
TOP+MOD modifyTopic() comm_topics_filledtempl.tmpl
POST handleAdminPosts() comm_posts_list.tmpl
POST+MOD modifyPost() comm_posts_filledtempl.tmpl
(default) handleAdminDefault() comm_disc_list.tmpl
USER modifyDiscUsers comm_disc_users.tmpl
TOP+USER modifyTopicUsers comm_topic_users.tmpl
- Overrides:
- handleRequest in class GenericHandler
modifyDiscUsers
public void modifyDiscUsers(int catId)
handleAdminTopics
public void handleAdminTopics()
- Handles all topic administration. This includes: 1. display the page
2. handle a delete topics post 3. handle an add topic post
4. handle a modify topic and now 5. handle user access control for a
topic
handleAdminPosts
public void handleAdminPosts()
- Handles all post administration. This inlcudes:
1. display the post summary page
2. handle a delete post 3. handle an add post
4. handle modifying a post
init
public boolean init(Log log)
- our templates are loaded by DiscussionHandler for now,
so we don't need to do anything
- Overrides:
- init in class GenericHandler
shutdown
public boolean shutdown(Log log)
- Nothing to do here either, presently.
- Overrides:
- shutdown in class GenericHandler
- See Also:
org.locomotive.loco.Handler#shutdown