Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.action
Class EditAction

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.PostAction
                  extended by com.jivesoftware.forum.action.EditAction
All Implemented Interfaces:
AuthTokenAware, EntityAware, UserAware, ForumAware, ForumCategoryAware, ForumFactoryAware, ForumMessageAware, ForumThreadAware, com.opensymphony.webwork.interceptor.ServletRequestAware, com.opensymphony.webwork.interceptor.ServletResponseAware, com.opensymphony.webwork.interceptor.SessionAware, 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 EditAction
extends PostAction

Action for handling logic of editing forum content.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jivesoftware.forum.action.PostAction
ATTACH, REJECTED, REQUEST_TOO_LARGE, SESSION_MESSAGE_KEY, SUCCESS_MODERATED, SUCCESS_NEW_MESSAGE, SUCCESS_NEW_MESSAGE_STQC, SUCCESS_NEW_TOPIC
 
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
EditAction()
           
 
Method Summary
 java.lang.String doDefault()
          Loads specified Jive objects (the forum, parent message, etc) and checks that the user has posting permission in this forum.
 java.lang.String execute()
          Loads specified Jive objects (the forum, parent message, etc) and checks that the user has posting permission in this forum.
 int getAttachmentCount()
          Returns a count of attachments associated with the new message.
 java.util.Iterator getAttachments()
          Returns an iterator of attachments associated with the new message.
 java.lang.String getComment()
           
 java.lang.String getParentQuotedText(boolean returnAsHtml)
          A convenience method to quote the parent's message body.
 boolean isAddComment()
           
 boolean isEdit()
          Returns true always to indicate that this action is for message editing.
 boolean isEditStampRequired()
          Returns true if the user is a system admin or moderator, and edit stamps must accompany changes by a moderator.
 boolean isReply()
          Returns true if the message being edited is a reply, false otherwise
 void setAddComment(boolean addComment)
           
 void setComment(java.lang.String comment)
           
 void validate()
          Validates all user input.
 
Methods inherited from class com.jivesoftware.forum.action.PostAction
addAttachments, cleanSession, createMessage, doPost, doReply, getAssignPoints, getAttachFile, getAttachFileContentType, getAttachFileFileName, getAttachmentList, getBody, getDraft, getEmail, getEntityDescriptor, getForum, getFrom, getMessage, getName, getNewMessage, getNewMessageIsModerated, getPartialURL, getPopularTags, getRemoveAttachID, getReplySubject, getResolution, getServletRequest, getSession, getShowPopularTags, getSubject, getTag, getTags, getThread, hasDraft, hasPostPermission, isCancel, isDraftEnabled, isDraftExists, isJiveForumUploadSizeLimitExceeded, isMarkAsQuestion, isPostedFromGUIEditor, isShortTermQueryCacheEnabled, loadJiveObjects, loadToSession, newMessageModerated, removeAttachments, removeFromSession, retrieveFromSession, setAssignPoints, setAttachFile, setAttachFileContentType, setAttachFileFileName, setBody, setCancel, setDraft, setDraftEnabled, setDraftExists, setEmail, setForum, setForumCategory, setFrom, setJiveForumUploadSizeLimitExceeded, setMarkAsQuestion, setMessage, setName, setNewMessage, setPostedFromGUIEditor, setRemoveAttachID, setReply, setResolution, setServletRequest, setSession, setSubject, setTags, setThread, setUseDraft, useDraft
 
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, 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
 

Constructor Detail

EditAction

public EditAction()
Method Detail

isAddComment

public boolean isAddComment()

setAddComment

public void setAddComment(boolean addComment)

getComment

public java.lang.String getComment()

setComment

public void setComment(java.lang.String comment)

isEdit

public boolean isEdit()
Returns true always to indicate that this action is for message editing.

Overrides:
isEdit in class PostAction
Returns:
false always. Subclasses should override this.

isReply

public boolean isReply()
Returns true if the message being edited is a reply, false otherwise

Overrides:
isReply in class PostAction
Returns:
true if this message is a reply to another message, false if it's a new thread.

isEditStampRequired

public boolean isEditStampRequired()
Returns true if the user is a system admin or moderator, and edit stamps must accompany changes by a moderator.

Overrides:
isEditStampRequired in class PostAction
Returns:
true if the edit stamp is required, otherwise false.

doDefault

public java.lang.String doDefault()
Description copied from class: PostAction
Loads specified Jive objects (the forum, parent message, etc) and checks that the user has posting permission in this forum. If there are errors loading the objects, Action.ERROR is returned and if the user doesn't have permission to post, Action.LOGIN is returned.

This method will also add info messages - views can display them by getting Iterators from the ActionSupport.getActionMessages() method.

Overrides:
doDefault in class PostAction
Returns:
Action.ERROR if an error occurs, Action.INPUT otherwise.

execute

public java.lang.String execute()
Description copied from class: PostAction
Loads specified Jive objects (the forum, parent message, etc) and checks that the user has posting permission in this forum. If there are errors loading the objects, Action.ERROR is returned and if the user doesn't have permission to post, Action.LOGIN is returned.

This method also validates all message fields and, depending on what the user wants to do (post, etc), executes the appropriate course of action.

If the user wants to post the message and all fields validate, this method will post the message and return Action.SUCCESS;

Specified by:
execute in interface com.opensymphony.xwork.Action
Overrides:
execute in class PostAction
Returns:
Action.ERROR if an error occurs, action.INPUT if there is an error with the input or Action.SUCCESS if the edit was successful.

getAttachmentCount

public int getAttachmentCount()
Description copied from class: PostAction
Returns a count of attachments associated with the new message. Normally this will return 0 as attachments are not added to the message prior to posting, however if an error or validation failure occurs the count of uploaded attachments can be retrieved using this method. The success page may also find this method useful to display any uploaded attachments.

Overrides:
getAttachmentCount in class PostAction
Returns:
the number of attachments associated with the new message.

getAttachments

public java.util.Iterator getAttachments()
Description copied from class: PostAction
Returns an iterator of attachments associated with the new message. Normally this will return an empty list as attachments are not added to the message prior to posting, however if an error or validation failure occurs the uploaded attachments can be retrieved using this method. The success page may also find this method useful to display any uploaded attachments.

Overrides:
getAttachments in class PostAction
Returns:
an Iterator of temporary attachments associated with the new message.

getParentQuotedText

public java.lang.String getParentQuotedText(boolean returnAsHtml)
A convenience method to quote the parent's message body.

Overrides:
getParentQuotedText in class PostAction
Parameters:
returnAsHtml - true to return the quoted message as html, false to return as text
Returns:
the parent's message body quoted appropriately to the specified return mode

validate

public void validate()
Description copied from class: PostAction
Validates all user input.

Specified by:
validate in interface com.opensymphony.xwork.Validateable
Overrides:
validate in class PostAction

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.