Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.action
Class PollPostAction

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.PollPostAction
All Implemented Interfaces:
AuthTokenAware, EntityAware, JiveObjectLoader, UserAware, ForumFactoryAware, 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
Direct Known Subclasses:
PollEditAction

public class PollPostAction
extends ForumActionSupport
implements com.opensymphony.xwork.Validateable, JiveObjectLoader, com.opensymphony.webwork.interceptor.ServletRequestAware

Logic for creating a poll.

See Also:
Serialized Form

Field Summary
static java.lang.String ACTIVE_LATER
           
static java.lang.String ACTIVE_NOW
           
static java.lang.String ENDS_LATER
           
static java.lang.String ENDS_NEVER
           
static java.lang.String ENDS_RELATIVE
           
static java.lang.String EXPIRES_LATER
           
static java.lang.String EXPIRES_NEVER
           
static java.lang.String EXPIRES_RELATIVE
           
protected  java.util.Date validatedActiveDate
           
protected  java.util.Date validatedEndDate
           
protected  java.util.Date validatedExpireDate
           
 
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, 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
PollPostAction()
           
 
Method Summary
 java.lang.String doDefault()
          Loads environment to create a poll.
 java.lang.String execute()
          Creates a new poll.
 java.lang.String getActiveDate()
          Returns the the date as a parseable String format of when the poll should become active.
 java.lang.String getActiveMode()
          Gets the active mode - will be either ACTIVE_NOW or ACTIVE_LATER.
 ForumCategory getCategory()
          Returns the category we're posting the poll in or null if this is not a category specific poll.
 long getCategoryID()
          Returns the ID of the category we're posting the poll in.
 java.lang.String getDescription()
          Returns the description of the poll.
 Draft getDraft()
          Get the draft associated with this message.
 java.lang.String getEndsDate()
          Returns the the date as a parseable String format of when the poll should become inactive (can't be voted in).
 int getEndsDays()
          Returns the number of days the poll will end after becoming active.
 java.lang.String getEndsMode()
          Returns the end mode - will be either ENDS_NEVER, ENDS_RELATIVE or ENDS_LATER.
 EntityDescriptor getEntityDescriptor(java.util.Map parameters)
          Returns information (ID, type) about a specific type given a Map of parameters.
 java.lang.String getExpiresDate()
          Returns the the date as a parseable String format of when the poll should die (become invisible).
 int getExpiresDays()
          Returns the number of days the poll will expire after becoming active.
 java.lang.String getExpiresMode()
          Returns the expiration mode - will be either EXPIRES_NEVER, EXPIRES_RELATIVE or EXPIRES_LATER.
 Forum getForum()
          Returns the forum we're posting the poll in or null if this is not a forum specific poll.
 long getForumID()
          Returns the ID of the forum we're posting the poll in.
 java.lang.String getName()
          Returns the name of the poll.
 long getObjectID()
          The ID of the object to load.
 int getObjectType()
          The type of object to load.
 java.util.List getOptions()
          Returns the list of options for this poll - option is a String.
 Poll getPoll()
          Returns the newly created poll.
protected  boolean hasDraft()
          Returns true if the user has one or more drafts that match this forum / thread / message combination.
 java.lang.String isCancel()
          Indicates the user wants to cancel.
 boolean isDraftEnabled()
          Indicates whether or not drafts are enabled.
 boolean isDraftExists()
          Indicates whether or not the user has a draft.
 java.lang.String loadObjects()
          Optionally loads the category or forum specified.
 void setActiveDate(java.lang.String activeDate)
          Sets the date as a parseable String format of when the poll should become active.
 void setActiveMode(java.lang.String activeMode)
          Sets the active mode - can be either ACTIVE_NOW or ACTIVE_LATER.
 void setCancel(java.lang.String cancel)
          Sets whether or not the user wants to cancel.
 void setCategory(ForumCategory category)
          Sets the category to work with.
 void setCategoryID(long categoryID)
          Sets the ID of the category we're posting the poll in.
 void setDescription(java.lang.String description)
          Sets the description of the poll.
 void setDraft(Draft draft)
          Set the draft associated with this object.
 void setDraftExists(boolean draftExists)
          Sets whether or not the user has a draft for this forum/thread/message combo.
 void setEndsDate(java.lang.String endsDate)
          Sets the date as a parseable String format of when the poll should become inactivt (can't be voted in).
 void setEndsDays(int endsDays)
          Sets the number of days the poll is active.
 void setEndsMode(java.lang.String endsMode)
          Sets the end mode - can be either ENDS_NEVER, ENDS_RELATIVE or ENDS_LATER.
 void setExpiresDate(java.lang.String expiresDate)
          Sets the date as a parseable String format of when the poll should die (become invisible).
 void setExpiresDays(int expiresDays)
          Sets the number of days the poll is viewable.
 void setExpiresMode(java.lang.String expiresMode)
          Sets the expiration mode - can be either EXPIRES_NEVER, EXPIRES_RELATIVE or EXPIRES_LATER.
protected  void setForum(Forum forum)
          Sets the forum to work with.
 void setForumID(long forumID)
          Sets the ID of the forum we're posting the poll in.
 void setName(java.lang.String name)
          Sets the name of the poll.
 void setObjectID(long objectID)
          Sets the ID of the object to load.
 void setObjectType(int objectType)
          Sets the type of object to load.
 void setOptions(java.util.List options)
          Sets the list of options as a list of Strings.
 void setServletRequest(javax.servlet.http.HttpServletRequest request)
           
 void setUseDraft(boolean useDraft)
          Sets whether or not the user wants to use an existing draft.
 boolean useDraft()
          Returns true if the user wants to use an existing draft, used by the 'Your Drafts' area of the site to autopopulate an announcement rather than showing the user a message that says 'would you like to use the existing draft?'
 void validate()
           
 
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, setServletResponse
 
Methods inherited from class com.opensymphony.xwork.ActionSupport
addActionError, addActionMessage, addFieldError, clearErrorsAndMessages, clone, 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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIVE_NOW

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

ACTIVE_LATER

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

ENDS_NEVER

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

ENDS_RELATIVE

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

ENDS_LATER

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

EXPIRES_NEVER

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

EXPIRES_RELATIVE

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

EXPIRES_LATER

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

validatedActiveDate

protected java.util.Date validatedActiveDate

validatedEndDate

protected java.util.Date validatedEndDate

validatedExpireDate

protected java.util.Date validatedExpireDate
Constructor Detail

PollPostAction

public PollPostAction()
Method Detail

setServletRequest

public void setServletRequest(javax.servlet.http.HttpServletRequest request)
Specified by:
setServletRequest in interface com.opensymphony.webwork.interceptor.ServletRequestAware
Overrides:
setServletRequest in class JiveActionSupport

getCategoryID

public long getCategoryID()
Returns the ID of the category we're posting the poll in.


setCategoryID

public void setCategoryID(long categoryID)
Sets the ID of the category we're posting the poll in.


getForumID

public long getForumID()
Returns the ID of the forum we're posting the poll in.


setForumID

public void setForumID(long forumID)
Sets the ID of the forum we're posting the poll in.


getObjectType

public int getObjectType()
The type of object to load.


setObjectType

public void setObjectType(int objectType)
Sets the type of object to load.


getObjectID

public long getObjectID()
The ID of the object to load.


setObjectID

public void setObjectID(long objectID)
Sets the ID of the object to load.


getName

public java.lang.String getName()
Returns the name of the poll.


setName

public void setName(java.lang.String name)
Sets the name of the poll.


getDescription

public java.lang.String getDescription()
Returns the description of the poll.


setDescription

public void setDescription(java.lang.String description)
Sets the description of the poll.


getActiveMode

public java.lang.String getActiveMode()
Gets the active mode - will be either ACTIVE_NOW or ACTIVE_LATER.


setActiveMode

public void setActiveMode(java.lang.String activeMode)
Sets the active mode - can be either ACTIVE_NOW or ACTIVE_LATER.


getEndsMode

public java.lang.String getEndsMode()
Returns the end mode - will be either ENDS_NEVER, ENDS_RELATIVE or ENDS_LATER.


setEndsMode

public void setEndsMode(java.lang.String endsMode)
Sets the end mode - can be either ENDS_NEVER, ENDS_RELATIVE or ENDS_LATER.


getExpiresMode

public java.lang.String getExpiresMode()
Returns the expiration mode - will be either EXPIRES_NEVER, EXPIRES_RELATIVE or EXPIRES_LATER.


setExpiresMode

public void setExpiresMode(java.lang.String expiresMode)
Sets the expiration mode - can be either EXPIRES_NEVER, EXPIRES_RELATIVE or EXPIRES_LATER.


getEndsDays

public int getEndsDays()
Returns the number of days the poll will end after becoming active.


setEndsDays

public void setEndsDays(int endsDays)
Sets the number of days the poll is active.


getExpiresDays

public int getExpiresDays()
Returns the number of days the poll will expire after becoming active.


setExpiresDays

public void setExpiresDays(int expiresDays)
Sets the number of days the poll is viewable.


getActiveDate

public java.lang.String getActiveDate()
Returns the the date as a parseable String format of when the poll should become active. Returns null if the poll is active immediately.


setActiveDate

public void setActiveDate(java.lang.String activeDate)
Sets the date as a parseable String format of when the poll should become active. Set to null if the poll is to be active immediately.


getEndsDate

public java.lang.String getEndsDate()
Returns the the date as a parseable String format of when the poll should become inactive (can't be voted in). Returns null if the poll is never ends.


setEndsDate

public void setEndsDate(java.lang.String endsDate)
Sets the date as a parseable String format of when the poll should become inactivt (can't be voted in). Set to null if the poll should never end.


getExpiresDate

public java.lang.String getExpiresDate()
Returns the the date as a parseable String format of when the poll should die (become invisible). Returns null if the poll never expires.


setExpiresDate

public void setExpiresDate(java.lang.String expiresDate)
Sets the date as a parseable String format of when the poll should die (become invisible). Set to null if the poll should live forever.


getOptions

public java.util.List getOptions()
Returns the list of options for this poll - option is a String.


setOptions

public void setOptions(java.util.List options)
Sets the list of options as a list of Strings.


isCancel

public java.lang.String isCancel()
Indicates the user wants to cancel.


setCancel

public void setCancel(java.lang.String cancel)
Sets whether or not the user wants to cancel.


getCategory

public ForumCategory getCategory()
Returns the category we're posting the poll in or null if this is not a category specific poll.

Returns:
the category we're posting the poll in or null if this is not a category specific poll.

setCategory

public void setCategory(ForumCategory category)
Sets the category to work with.


getForum

public Forum getForum()
Returns the forum we're posting the poll in or null if this is not a forum specific poll.

Returns:
the forum we're posting the poll in or null if this is not a forum specific poll.

setForum

protected void setForum(Forum forum)
Sets the forum to work with.


getPoll

public Poll getPoll()
Returns the newly created poll.


useDraft

public boolean useDraft()
Returns true if the user wants to use an existing draft, used by the 'Your Drafts' area of the site to autopopulate an announcement rather than showing the user a message that says 'would you like to use the existing draft?'

Returns:
"true" if the URL contains a useDraft variable

setUseDraft

public void setUseDraft(boolean useDraft)
Sets whether or not the user wants to use an existing draft.

Parameters:
useDraft -

isDraftExists

public boolean isDraftExists()
Indicates whether or not the user has a draft.

Returns:
"true" if the user has a draft, false if not.

setDraftExists

public void setDraftExists(boolean draftExists)
Sets whether or not the user has a draft for this forum/thread/message combo.

Parameters:
draftExists - "true" if the user has a draft

isDraftEnabled

public boolean isDraftEnabled()
Indicates whether or not drafts are enabled.

Returns:
"true" if drafts are enabled, false if not

getDraft

public Draft getDraft()
Get the draft associated with this message.

Returns:
draft

setDraft

public void setDraft(Draft draft)
Set the draft associated with this object.

Parameters:
draft -

doDefault

public java.lang.String doDefault()
                           throws java.lang.Exception
Loads environment to create a poll. Return codes:

Overrides:
doDefault in class com.opensymphony.xwork.ActionSupport
Returns:
Action.INPUT if the poll environment is setup, ForumActionSupport.UNAUTHORIZED if the user has no permission to create a poll.
Throws:
java.lang.Exception

validate

public void validate()
Specified by:
validate in interface com.opensymphony.xwork.Validateable
Overrides:
validate in class com.opensymphony.xwork.ActionSupport

execute

public java.lang.String execute()
                         throws java.lang.Exception
Creates a new poll. Return codes:

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

hasDraft

protected boolean hasDraft()
Returns true if the user has one or more drafts that match this forum / thread / message combination.


loadObjects

public java.lang.String loadObjects()
Optionally loads the category or forum specified. If either fails then ForumActionSupport.NOTFOUND is returned or Action.SUCCESS otherwise. If the user doesn't have read permission to the forum then ForumActionSupport.UNAUTHORIZED is returned.

Specified by:
loadObjects in interface JiveObjectLoader
Returns:
Action.SUCCESS if object loading occurred normally, anything else to indicate that object loading failed.

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.