Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.action
Class PollsViewAction

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.PollsViewAction
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 PollsViewAction
extends ForumActionSupport
implements Pageable, JiveObjectLoader

Class to support viewing multiple polls in a given area (system, category or forum).

See Also:
Serialized Form

Field Summary
static int NUM_POLLS_PER_PAGE
           
 
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
PollsViewAction()
           
 
Method Summary
 java.lang.String execute()
          Creates the iterator of active polls based on the forum or category passed in to this class as parameters.
 java.util.Iterator getActivePolls()
          Returns an Iterator of polls for the given object type and object ID.
 ForumCategory getCategory()
          Returns the category object loaded by the given category ID or null if no category was specified.
 long getCategoryID()
          The ID of the cateogry we're loading.
 EntityDescriptor getEntityDescriptor(java.util.Map parameters)
          Returns information (ID, type) about a specific type given a Map of parameters.
 Forum getForum()
          Returns the forum object loaded by the given forum ID or null if no forum was specified.
 long getForumID()
          The ID of the forum we're loading.
 PollManager getManager()
          Returns the poll manager as a convenience.
 long getObjectID()
          ID of the object to get polls from.
 int getObjectType()
          Type of object we're getting polls from.
 ResultFilter getResultFilter()
          Returns the result filter for the list of polls.
 int getStart()
          Returns the start index of the list of polls.
 int getTotalItemCount()
          Returns the total number of polls to be iterated over.
 boolean isCategoryPollList()
          Returns true if the this poll list is a list of category polls, false otherwise.
 boolean isForumPollList()
          Returns true if the this poll list is a list of forum polls, false otherwise.
 boolean isSystemPollList()
          Returns true if the this poll list is a list of system-level polls, false otherwise.
 java.lang.String loadObjects()
          Loads the category or forum objects if specified.
 void setCategoryID(long categoryID)
          Sets the ID of the category to load.
 void setForumID(long forumID)
          Sets the ID of the forum to load.
 void setObjectID(long objectID)
          Sets the ID of the object to get polls from.
 void setObjectType(int objectType)
          Sets the type of object we're getting polls from.
 void setStart(int start)
          Sets the start index of the list of polls.
 
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
 

Field Detail

NUM_POLLS_PER_PAGE

public static final int NUM_POLLS_PER_PAGE
See Also:
Constant Field Values
Constructor Detail

PollsViewAction

public PollsViewAction()
Method Detail

getObjectID

public long getObjectID()
ID of the object to get polls from.


setObjectID

public void setObjectID(long objectID)
Sets the ID of the object to get polls from.


getObjectType

public int getObjectType()
Type of object we're getting polls from.


setObjectType

public void setObjectType(int objectType)
Sets the type of object we're getting polls from.


getCategoryID

public long getCategoryID()
The ID of the cateogry we're loading.


setCategoryID

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


getForumID

public long getForumID()
The ID of the forum we're loading.


setForumID

public void setForumID(long forumID)
Sets the ID of the forum to load.


getStart

public int getStart()
Returns the start index of the list of polls.

Specified by:
getStart in interface Pageable
Returns:
the starting index in the item list.

setStart

public void setStart(int start)
Sets the start index of the list of polls.


getTotalItemCount

public int getTotalItemCount()
Returns the total number of polls to be iterated over.

Specified by:
getTotalItemCount in interface Pageable
Returns:
the total number of items we're looking at.

getResultFilter

public ResultFilter getResultFilter()
Returns the result filter for the list of polls.

Specified by:
getResultFilter in interface Pageable
Returns:
a Forums result filter.

isCategoryPollList

public boolean isCategoryPollList()
Returns true if the this poll list is a list of category polls, false otherwise.


isForumPollList

public boolean isForumPollList()
Returns true if the this poll list is a list of forum polls, false otherwise.


isSystemPollList

public boolean isSystemPollList()
Returns true if the this poll list is a list of system-level polls, false otherwise.


getForum

public Forum getForum()
Returns the forum object loaded by the given forum ID or null if no forum was specified.


getCategory

public ForumCategory getCategory()
Returns the category object loaded by the given category ID or null if no category was specified.


getManager

public PollManager getManager()
Returns the poll manager as a convenience.


getActivePolls

public java.util.Iterator getActivePolls()
Returns an Iterator of polls for the given object type and object ID.


execute

public java.lang.String execute()
Creates the iterator of active polls based on the forum or category passed in to this class as parameters. If no forum or category are specified then a list of active system-level polls is generated. Action.SUCCESS is returned if all goes well, ForumActionSupport.UNAUTHORIZED is returned if the user doesn't have permission to see the requested polls.

Specified by:
execute in interface com.opensymphony.xwork.Action
Overrides:
execute in class ForumActionSupport
Returns:
Action.SUCCESS

loadObjects

public java.lang.String loadObjects()
                             throws java.lang.Exception
Loads the category or forum objects if specified. Returns ForumActionSupport.NOTFOUND if not found or ForumActionSupport.UNAUTHORIZED if no permission to view the forum. Action.SUCCESS if loading is successful.

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.

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.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.