Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.action
Class ForumCategoryAction

java.lang.Object
  extended by com.opensymphony.xwork.ActionSupport
      extended by com.jivesoftware.base.action.JiveActionSupport
          extended by com.jivesoftware.forum.action.ForumActionSupport
              extended by com.jivesoftware.forum.action.ForumCategoryAction
All Implemented Interfaces:
AuthTokenAware, EntityAware, JiveObjectLoader, UserAware, ForumFactoryAware, Pageable, com.opensymphony.webwork.interceptor.ServletRequestAware, com.opensymphony.webwork.interceptor.ServletResponseAware, com.opensymphony.xwork.Action, com.opensymphony.xwork.LocaleProvider, com.opensymphony.xwork.TextProvider, com.opensymphony.xwork.Validateable, com.opensymphony.xwork.ValidationAware, com.uwyn.rife.continuations.ContinuableObject, java.io.Serializable, java.lang.Cloneable

public class ForumCategoryAction
extends ForumActionSupport
implements Pageable, JiveObjectLoader

This class is an Action which encapsulates all the logic of loading a category (or the root category if no category is specified) and its subcategories and forums.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jivesoftware.forum.action.ForumActionSupport
CANCEL, DISABLED, FATAL, NOTFOUND, SESSION_REFERRER_KEY, UNAUTHORIZED
 
Fields inherited from class com.jivesoftware.base.action.JiveActionSupport
pageUser, request, response
 
Fields inherited from class com.opensymphony.xwork.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
ForumCategoryAction()
           
 
Method Summary
 java.lang.String execute()
          Loads the specified category or loads the root category if no categoryID was specified.
 java.util.Iterator getAnnouncements()
          Returns an iterator of all announcements in the system.
 ForumCategory getCategory()
          Returns the requested ForumCategory.
 long getCategoryID()
          Returns the category ID.
 EntityDescriptor getEntityDescriptor(java.util.Map parameters)
          Returns information (ID, type) about a specific type given a Map of parameters.
 ResultFilter getMessageResultFilter()
          Returns a result filter for viewing lists of messages.
 ResultFilter getResultFilter()
          Returns the result filter used to create the list of threads in this category.
 int getStart()
          Returns the starting index for the list of threads in this category.
 java.lang.String getThreadMode()
           
 java.util.Iterator getThreads()
          Returns a list of threads on the current page in this category.
 int getTotalItemCount()
          Returns the total number of threads in the category.
 java.lang.String loadObjects()
          Loads objects in an action.
 void setCategoryID(long categoryID)
          Sets the category ID.
protected  void setResultFilter(ResultFilter resultFilter)
          Sets the ResultFilter used to create the list of threads in this category.
 void setStart(int start)
          Sets the starting index for the list of threads in this category.
 
Methods inherited from class com.jivesoftware.forum.action.ForumActionSupport
getCanAttach, getCanCreateMessage, getCanCreatePoll, getCanCreatePoll, getCanCreateThread, getCanCreateThread, getCanEdit, getCanEditAttach, getCanEditPoll, getCanEditPoll, getCanEditProfile, getCanEditTags, getCanPostAnnounce, getCanPostAnnounce, getCanRead, getCanRead, getForumFactory, getPageUser, getReadStatus, getSkinProperty, getThemeName, isAdmin, isAdmin, isAuthor, isAuthor, isMessageModerationOn, isModerator, isModerator, isResourceInTheme, isSystemAdmin, isThreadModerationOn, setForumFactory, setUser
 
Methods inherited from class com.jivesoftware.base.action.JiveActionSupport
getAuthToken, getGuestProperty, getJiveProperty, getLocales, getPageURL, getSession, getText, getText, getTimeZone, getTimeZones, isFailedLookup, isGuest, setAuthToken, setGuestProperty, setLoginAttributes, setPageUser, setServletRequest, setServletResponse
 
Methods inherited from class com.opensymphony.xwork.ActionSupport
addActionError, addActionMessage, addFieldError, clearErrorsAndMessages, clone, doDefault, doInput, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getLocale, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, pause, setActionErrors, setActionMessages, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForumCategoryAction

public ForumCategoryAction()
Method Detail

getCategoryID

public long getCategoryID()
Returns the category ID.

Returns:
the category ID.

setCategoryID

public void setCategoryID(long categoryID)
Sets the category ID.

Parameters:
categoryID - the category ID to set.

getStart

public int getStart()
Returns the starting index for the list of threads in this category. The index is 0 based and by default is 0. This method will never return a value less than zero as well.

This method implements part of the Pageable interface - this allows this action to be used for the creation of a Pagniator object.

Specified by:
getStart in interface Pageable
Returns:
the starting index for the list of threads in this category.

setStart

public void setStart(int start)
Sets the starting index for the list of threads in this category.

Parameters:
start - the starting index of the list of threads in this category.

getCategory

public ForumCategory getCategory()
Returns the requested ForumCategory.

Returns:
the requested ForumCategory.

getTotalItemCount

public int getTotalItemCount()
Returns the total number of threads in the category. This method implements part of the Pageable interface.

Specified by:
getTotalItemCount in interface Pageable
Returns:
the total number of threads in the category.

getResultFilter

public ResultFilter getResultFilter()
Returns the result filter used to create the list of threads in this category. From a ResultFilter you can get the starting index in the list, the number of results per page, moderation values, etc. See the JavaDoc for the ResultFilter class for the full list of properties.

Note, this method implements part of the Pageable interface.

Specified by:
getResultFilter in interface Pageable
Returns:
the ResultFilter used to create the list of threads in this category.

setResultFilter

protected void setResultFilter(ResultFilter resultFilter)
Sets the ResultFilter used to create the list of threads in this category.

Parameters:
resultFilter - the ResultFilter used to create the list of threads in this category.

getMessageResultFilter

public ResultFilter getMessageResultFilter()
Returns a result filter for viewing lists of messages. This is typically used for thread paginators.

Returns:
a result filter for viewing lists of messages.

getThreadMode

public java.lang.String getThreadMode()

getThreads

public java.util.Iterator getThreads()
Returns a list of threads on the current page in this category. Note, this will not likely be a full list of threads in the category because the number of threads will be limited by the result filter.

Returns:
a list of threads on the current page in this forum.

getAnnouncements

public java.util.Iterator getAnnouncements()
Returns an iterator of all announcements in the system.


getEntityDescriptor

public EntityDescriptor getEntityDescriptor(java.util.Map parameters)
Description copied from interface: EntityAware
Returns information (ID, type) about a specific type given a Map of parameters. The parameters are expected to be String keys with Long values. If the parameter is not found, null is returned.

Specified by:
getEntityDescriptor in interface EntityAware
Overrides:
getEntityDescriptor in class ForumActionSupport
Parameters:
parameters - a Map of parameters with String keys and Long values.
Returns:
a descriptor of the object (ID and type) or null if the entity was not found.

execute

public java.lang.String execute()
                         throws java.lang.Exception
Loads the specified category or loads the root category if no categoryID was specified. Return codes:

Specified by:
execute in interface com.opensymphony.xwork.Action
Overrides:
execute in class ForumActionSupport
Returns:
Action.SUCCESS if the category was loaded successfully, ForumActionSupport.UNAUTHORIZED or Action.ERROR otherwise.
Throws:
java.lang.Exception

loadObjects

public java.lang.String loadObjects()
                             throws java.lang.Exception
Description copied from interface: JiveObjectLoader
Loads objects in an action. This method should return Action.SUCCESS if object loading occurred normally. If another type of code is returned then a WebWork interceptor can pick up on that and return a different view page.

Specified by:
loadObjects in interface JiveObjectLoader
Returns:
Action.SUCCESS if object loading occurred normally, anything else to indicate that object loading failed.
Throws:
java.lang.Exception - if an unexpected error occurs when loading the objects.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.