org.locomotive.module.discuss
Class DiscussionAdminServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--org.locomotive.loco.servlet.LocoServlet
                    |
                    +--org.locomotive.module.discuss.DiscussionAdminServlet

public class DiscussionAdminServlet
extends LocoServlet

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.

See Also:
Serialized Form

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:
protected  DiscussionLib lib
           
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.servlet.LocoServlet
conn, DEBUG, ERROR, form_data, NORMAL, req, resp, session, steam_vars, url_tokens, user, WARNING
 
Constructor Summary
DiscussionAdminServlet()
           
 
Method Summary
 void handleAdminPosts()
          Handles all post administration.
 void handleAdminTopics()
          Handles all topic administration.
 void init(javax.servlet.ServletConfig config)
          intializes the DiscussionLib this Servlet will use
 void modifyDiscUsers(int catId)
           
 void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          This handles the administration for communities discussions, topics, and posts.
 
Methods inherited from class org.locomotive.loco.servlet.LocoServlet
displayPage, displayString, handleException, log, logEvent, sayBadURL, setup
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lib

protected DiscussionLib lib

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!
Constructor Detail

DiscussionAdminServlet

public DiscussionAdminServlet()
Method Detail

service

public void service(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse resp)
             throws javax.servlet.ServletException,
                    java.io.IOException
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:
service in class LocoServlet
Tags copied from class: LocoServlet
See Also:
LocoServlet.setup(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), javax.servlet.http.HttpServlet.html#service

modifyDiscUsers

public void modifyDiscUsers(int catId)
                     throws java.io.IOException

handleAdminTopics

public void handleAdminTopics()
                       throws java.io.IOException
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()
                      throws java.io.IOException
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 void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
intializes the DiscussionLib this Servlet will use
Overrides:
init in class javax.servlet.GenericServlet