Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.action
Class PostAnnounceAction

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.PostAnnounceAction
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:
AnnounceEditAction

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

Logic for creating an announcement.

See Also:
Serialized Form

Field Summary
static java.lang.String ACTIVE_LATER
           
static java.lang.String ACTIVE_NOW
           
static java.lang.String EXPIRES_LATER
           
static java.lang.String EXPIRES_NEVER
           
static java.lang.String EXPIRES_RELATIVE
           
 
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
PostAnnounceAction()
           
 
Method Summary
 java.lang.String doDefault()
          Loads environment to create a announcement.
 java.lang.String execute()
          Creates a new announcement.
 java.lang.String getActiveDate()
           
 java.lang.String getActiveMode()
           
 Announcement getAnnouncement()
          Returns the newly created announcement.
 AnnouncementManager getAnnouncementManager()
          Returns access to the announcement manager.
 java.lang.String getBody()
           
 ForumCategory getCategory()
          Returns the category we're posting the announcement in or null if this is not a category specific announcement.
 long getCategoryID()
           
 Draft getDraft()
          Get the draft associated with this message.
 EntityDescriptor getEntityDescriptor(java.util.Map parameters)
          Returns information (ID, type) about a specific type given a Map of parameters.
 java.lang.String getExpiresDate()
           
 int getExpiresDays()
           
 java.lang.String getExpiresMode()
           
 Forum getForum()
          Returns the forum we're posting the announcement in or null if this is not a forum specific announcement.
 long getForumID()
           
 java.lang.String getSubject()
           
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.
protected  Announcement loadAnnouncement()
           
 java.lang.String loadObjects()
          Loads objects in an action.
protected  void saveAnnouncement()
           
 void setActiveDate(java.lang.String activeDate)
           
 void setActiveMode(java.lang.String activeMode)
           
 void setBody(java.lang.String body)
           
 void setCancel(java.lang.String cancel)
          Sets whether or not the user wants to cancel.
 void setCategoryID(long categoryID)
           
 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 setExpiresDate(java.lang.String expiresDate)
           
 void setExpiresDays(int expiresDays)
           
 void setExpiresMode(java.lang.String expiresMode)
           
 void setForumID(long forumID)
           
 void setServletRequest(javax.servlet.http.HttpServletRequest request)
           
 void setSubject(java.lang.String subject)
           
 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

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

PostAnnounceAction

public PostAnnounceAction()
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()

setCategoryID

public void setCategoryID(long categoryID)

getForumID

public long getForumID()

setForumID

public void setForumID(long forumID)

getSubject

public java.lang.String getSubject()

setSubject

public void setSubject(java.lang.String subject)

getBody

public java.lang.String getBody()

setBody

public void setBody(java.lang.String body)

getActiveMode

public java.lang.String getActiveMode()

setActiveMode

public void setActiveMode(java.lang.String activeMode)

getExpiresMode

public java.lang.String getExpiresMode()

setExpiresMode

public void setExpiresMode(java.lang.String expiresMode)

getExpiresDays

public int getExpiresDays()

setExpiresDays

public void setExpiresDays(int expiresDays)

getActiveDate

public java.lang.String getActiveDate()

setActiveDate

public void setActiveDate(java.lang.String activeDate)

getExpiresDate

public java.lang.String getExpiresDate()

setExpiresDate

public void setExpiresDate(java.lang.String expiresDate)

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 -

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 announcement in or null if this is not a category specific announcement.

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

getForum

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

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

getAnnouncement

public Announcement getAnnouncement()
Returns the newly created announcement.

Returns:
the new announcement.

getAnnouncementManager

public AnnouncementManager getAnnouncementManager()
Returns access to the announcement manager.

Returns:
the announcement manager.

doDefault

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

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

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()
Creates a new announcement. Return codes:

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

loadAnnouncement

protected Announcement loadAnnouncement()
                                 throws UnauthorizedException
Throws:
UnauthorizedException

saveAnnouncement

protected void saveAnnouncement()
                         throws UnauthorizedException
Throws:
UnauthorizedException

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()
                             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.

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.