Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.util
Class AdminUtils

java.lang.Object
  extended by com.jivesoftware.forum.util.AdminUtils

public final class AdminUtils
extends java.lang.Object

A class to hold constants and static methods for the admin console. This class is not part of the core Jive APIs but is meant mostly to remove common Java code from the Admin console.

Since:
4.0

Field Summary
static int ADMIN_PERM_GROUP
          Indicates the admin permission mode - ie, perms for moderators, admins, etc.
static int ALL_MESSAGES_MODERATED
          Constant to indicate that moderation of new threads and new messages is on.
static int CAT_PERM_MODE
          Indicates the category permission mode.
static int CONTENT_PERM_GROUP
          Indicates the content permission mode - ie, perms for forums, categories, etc.
static java.lang.String FORUM_ADMIN_ROLE
           
static int FORUM_PERM_MODE
          Indicates the forum permission mode.
static java.lang.String GROUP_ADMIN_ROLE
           
static int MODERATION_OFF
          Constant to indicate that moderation is off.
static java.lang.String MODERATOR_ROLE
           
static int NEW_THREADS_MODERATED
          Constant to indicate that moderation of new threads is on.
static java.lang.String PAGE_BREADCRUMBS
          Constant for the breadcrumb attribute of JSP pages.
static java.lang.String PAGE_ID
          Constant for the page ID of JSP pages.
static java.lang.String PAGE_TITLE
          Constant for the title attribute of JSP pages.
static java.lang.String SUB_PAGE_ID
          Constant for the sub page of JSP pages (used for sub-menus).
static java.lang.String SUB_PAGE_PARAMS
          Constant for the sub page extra parameters (query string).
static java.lang.String SYSTEM_ADMIN_ROLE
           
static java.lang.String USER_ADMIN_ROLE
           
 
Method Summary
static java.util.Iterator categoriesWithGroupRead(ForumFactory forumFactory, Group group)
          Returns an Iterator of categories this group has read access to.
static java.lang.String generateDescriptorHTML(java.lang.Object object, java.beans.PropertyDescriptor descriptor)
           
static int getModerationStatus(Forum forum)
          Returns a code to indicate the state of moderation the given forum is in.
static java.lang.String getOneTimeMessage(javax.servlet.http.HttpSession session, java.lang.String name)
          Gets a message from the session.
static boolean parentCatHasReadPerm(ForumCategory rootCat, ForumCategory cat, Group group)
          Returns true if any parent category of the specified category has read access to the group.
static java.lang.String printParentCategories(ForumCategory category, java.lang.String delim)
          Prints the list of parent categories in top-down order delimited by the given delimiter.
static java.lang.String printParentCategories(Forum forum, java.lang.String delim)
          Prints the list of parent categories in top-down order delimited by the given delimiter.
static void setOneTimeMessage(javax.servlet.http.HttpSession session, java.lang.String name, java.lang.String value)
          Sets a message in the session.
static java.util.Iterator sortedIterator(java.util.Iterator iter)
          Reads an Iterator into a List, sorts it, then returns it as an Iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAT_PERM_MODE

public static final int CAT_PERM_MODE
Indicates the category permission mode.

See Also:
Constant Field Values

FORUM_PERM_MODE

public static final int FORUM_PERM_MODE
Indicates the forum permission mode.

See Also:
Constant Field Values

CONTENT_PERM_GROUP

public static final int CONTENT_PERM_GROUP
Indicates the content permission mode - ie, perms for forums, categories, etc.

See Also:
Constant Field Values

ADMIN_PERM_GROUP

public static final int ADMIN_PERM_GROUP
Indicates the admin permission mode - ie, perms for moderators, admins, etc.

See Also:
Constant Field Values

PAGE_TITLE

public static final java.lang.String PAGE_TITLE
Constant for the title attribute of JSP pages.

See Also:
Constant Field Values

PAGE_BREADCRUMBS

public static final java.lang.String PAGE_BREADCRUMBS
Constant for the breadcrumb attribute of JSP pages.

See Also:
Constant Field Values

PAGE_ID

public static final java.lang.String PAGE_ID
Constant for the page ID of JSP pages.

See Also:
Constant Field Values

SUB_PAGE_ID

public static final java.lang.String SUB_PAGE_ID
Constant for the sub page of JSP pages (used for sub-menus).

See Also:
Constant Field Values

SUB_PAGE_PARAMS

public static final java.lang.String SUB_PAGE_PARAMS
Constant for the sub page extra parameters (query string).

See Also:
Constant Field Values

MODERATION_OFF

public static final int MODERATION_OFF
Constant to indicate that moderation is off.

See Also:
Constant Field Values

NEW_THREADS_MODERATED

public static final int NEW_THREADS_MODERATED
Constant to indicate that moderation of new threads is on.

See Also:
Constant Field Values

ALL_MESSAGES_MODERATED

public static final int ALL_MESSAGES_MODERATED
Constant to indicate that moderation of new threads and new messages is on.

See Also:
Constant Field Values

SYSTEM_ADMIN_ROLE

public static final java.lang.String SYSTEM_ADMIN_ROLE
See Also:
Constant Field Values

GROUP_ADMIN_ROLE

public static final java.lang.String GROUP_ADMIN_ROLE
See Also:
Constant Field Values

FORUM_ADMIN_ROLE

public static final java.lang.String FORUM_ADMIN_ROLE
See Also:
Constant Field Values

MODERATOR_ROLE

public static final java.lang.String MODERATOR_ROLE
See Also:
Constant Field Values

USER_ADMIN_ROLE

public static final java.lang.String USER_ADMIN_ROLE
See Also:
Constant Field Values
Method Detail

getOneTimeMessage

public static java.lang.String getOneTimeMessage(javax.servlet.http.HttpSession session,
                                                 java.lang.String name)
Gets a message from the session. The message is removed from the session after we get it.

TODO - phase out use of this


setOneTimeMessage

public static void setOneTimeMessage(javax.servlet.http.HttpSession session,
                                     java.lang.String name,
                                     java.lang.String value)
Sets a message in the session. The message is removed from the session after it is accessed (via getOneTimeMessage(...)) once.

TODO - phase out use of this


categoriesWithGroupRead

public static java.util.Iterator categoriesWithGroupRead(ForumFactory forumFactory,
                                                         Group group)
                                                  throws UnauthorizedException
Returns an Iterator of categories this group has read access to. The iterator is in depth-first order of the hierarchy of categories.

Parameters:
forumFactory -
group - the group we are examining.
Returns:
an iterator of categories where this group has read permission.
Throws:
UnauthorizedException

parentCatHasReadPerm

public static boolean parentCatHasReadPerm(ForumCategory rootCat,
                                           ForumCategory cat,
                                           Group group)
                                    throws UnauthorizedException
Returns true if any parent category of the specified category has read access to the group.

Throws:
UnauthorizedException

getModerationStatus

public static int getModerationStatus(Forum forum)
Returns a code to indicate the state of moderation the given forum is in. Forums can either be unmoderated (MODERATION_OFF), only moderate new threads (NEW_THREADS_MODERATED), or moderate all messages (ALL_MESSAGES_MODERATED).

Parameters:
forum - the forum to check.
Returns:
the status of moderation for the given forum.

printParentCategories

public static java.lang.String printParentCategories(ForumCategory category,
                                                     java.lang.String delim)
Prints the list of parent categories in top-down order delimited by the given delimiter. This might result in the printing of "Foo > Bar > MyCategory" if the category you pass in is MyCategory and has two parent categories and you pass in a delimiter of " > ".

Parameters:
category - the category to show the parent categories.
delim - the spacer between forum names.
Returns:
a String of the parent category names and the given category name delimited by the given delimiter.

printParentCategories

public static java.lang.String printParentCategories(Forum forum,
                                                     java.lang.String delim)
Prints the list of parent categories in top-down order delimited by the given delimiter. This might result in the printing of "Foo > Bar > My Forum" if the forum you pass in is MyForum and has two parent categories and you pass in a delimiter of " > ".

Parameters:
forum - the forum to show the parent categories.
delim - the spacer between forum names.
Returns:
a String of the parent category names and the forum name delimited by the given delimiter.

sortedIterator

public static java.util.Iterator sortedIterator(java.util.Iterator iter)
Reads an Iterator into a List, sorts it, then returns it as an Iterator.

Parameters:
iter - the iterator to sort.
Returns:
a sorted Iterator.

generateDescriptorHTML

public static java.lang.String generateDescriptorHTML(java.lang.Object object,
                                                      java.beans.PropertyDescriptor descriptor)

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.