Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.action
Class AttachAction

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.OldPostAction
                  extended by com.jivesoftware.forum.action.AttachAction
All Implemented Interfaces:
AuthTokenAware, EntityAware, UserAware, ForumFactoryAware, 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
Direct Known Subclasses:
EditAttachAction

public class AttachAction
extends OldPostAction

An action that encapsulates all the logic for posting message attachments as well as deleting them.

See Also:
Serialized Form

Field Summary
static java.lang.String ATTACHMENT_RENAME_INPUT
           
static java.lang.String ATTACHMENT_RENAME_SUCCESS
           
static java.lang.String SUCCESS_MESSAGE
           
static java.lang.String SUCCESS_TOPIC
           
 
Fields inherited from class com.jivesoftware.forum.action.OldPostAction
ATTACH, PREVIEW, REJECTED, SPELLCHECK
 
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
AttachAction()
           
 
Method Summary
protected  void addAttachments(ForumMessage message)
           
 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 doDelete()
           
 java.lang.String doRename()
          Webwork command to rename an attachment.
 java.lang.String execute()
          Loads specified Jive objects (the forum, parent message, etc) and checks that the user has posting permission in this forum.
 java.lang.Boolean getAnsQuestion()
           
 java.io.File[] getAttachFile()
           
 long getAttachID()
           
 Attachment getAttachment()
           
 AttachmentManager getAttachmentManager()
           
static java.lang.String getContentType(javax.servlet.http.HttpServletRequest request)
          A utility method to return the content type of the incoming request.
 int[] getDeleteAttachIDs()
           
 java.lang.String getDoAttachFiles()
           
 java.lang.String getEncBody()
           
 java.lang.String getEncSubject()
           
 java.lang.String getNewName()
           
 boolean isEdit()
          Returns false always.
static boolean isMultiPart(javax.servlet.http.HttpServletRequest request)
          A utility method to determine if the given request is of the multipart content-type.
 void setAnsQuestion(java.lang.Boolean ansQuestion)
           
 void setAttachFile(java.io.File[] attachFile)
           
 void setAttachID(long attachID)
           
 void setDeleteAttachIDs(int[] deleteAttachIDs)
           
 void setDoAttachFiles(java.lang.String doAttachFiles)
           
 void setEncBody(java.lang.String encBody)
           
 void setEncSubject(java.lang.String encSubject)
           
 void setNewName(java.lang.String newName)
           
 void validate()
          Validates all user input.
 
Methods inherited from class com.jivesoftware.forum.action.OldPostAction
cleanSession, createMessage, doPost, doRemoveAttach, doReply, getAssignPoints, getAttachmentCount, getAttachments, getBody, getDoAttach, getDoGoBack, getDoPost, getDoPreview, getDoQuoteOriq, getDoSpellCheck, getDraft, getEmail, getEntityDescriptor, getForum, getForumID, getFrom, getMessage, getMessageID, getName, getNewMessage, getNewMessageIsModerated, getPartialURL, getPreviewedMessage, getReplySubject, getResolution, getSessionSuffix, getSubject, getTempAttachmentID, getThread, getThreadID, getTid, getToHex, isCancel, isDraftEnabled, isDraftExists, isMarkAsQuestion, isQuote, isReply, isShortTermQueryCacheEnabled, loadJiveObjects, loadToSession, removeFromSession, retrieveFromSession, setAssignPoints, setBody, setCancel, setDoAttach, setDoGoBack, setDoPost, setDoPreview, setDoQuoteOriq, setDoSpellCheck, setDraft, setDraftEnabled, setDraftExists, setEmail, setForum, setForumID, setFrom, setMarkAsQuestion, setMessage, setMessageID, setName, setNewMessage, setQuote, setReply, setResolution, setServletRequest, setSession, setSubject, setTempAttachmentID, setThread, setThreadID, setTid, 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, 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

SUCCESS_TOPIC

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

SUCCESS_MESSAGE

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

ATTACHMENT_RENAME_INPUT

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

ATTACHMENT_RENAME_SUCCESS

public static final java.lang.String ATTACHMENT_RENAME_SUCCESS
See Also:
Constant Field Values
Constructor Detail

AttachAction

public AttachAction()
Method Detail

getDoAttachFiles

public java.lang.String getDoAttachFiles()

setDoAttachFiles

public void setDoAttachFiles(java.lang.String doAttachFiles)

getAttachFile

public java.io.File[] getAttachFile()

setAttachFile

public void setAttachFile(java.io.File[] attachFile)

getDeleteAttachIDs

public int[] getDeleteAttachIDs()

setDeleteAttachIDs

public void setDeleteAttachIDs(int[] deleteAttachIDs)

getAttachID

public long getAttachID()

setAttachID

public void setAttachID(long attachID)

getEncSubject

public java.lang.String getEncSubject()

setEncSubject

public void setEncSubject(java.lang.String encSubject)

getEncBody

public java.lang.String getEncBody()

setEncBody

public void setEncBody(java.lang.String encBody)

getNewName

public java.lang.String getNewName()

setNewName

public void setNewName(java.lang.String newName)

getAnsQuestion

public java.lang.Boolean getAnsQuestion()

setAnsQuestion

public void setAnsQuestion(java.lang.Boolean ansQuestion)

getAttachmentManager

public AttachmentManager getAttachmentManager()

isEdit

public boolean isEdit()
Description copied from class: OldPostAction
Returns false always. Subclasses should override this method to indicate an action that supports message editing using the post form.

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

getAttachment

public Attachment getAttachment()

validate

public void validate()
Description copied from class: OldPostAction
Validates all user input. This method is protected because it should only be called internally or by a subclass.

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

doDefault

public java.lang.String doDefault()
Description copied from class: OldPostAction
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 OldPostAction
Returns:
the view to redirect to.

doDelete

public java.lang.String doDelete()

doRename

public java.lang.String doRename()
Webwork command to rename an attachment.

Returns:
the Action.ERROR view if no message and attachment was specified, the Action.ERROR view if there were errors pertaining to renaming the attachment, the Action.LOGIN view if the user is not authorized or the SUCCESS_MESSAGE view if the attachment was successfully removed.

execute

public java.lang.String execute()
Description copied from class: OldPostAction
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, preview, 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 OldPostAction
Returns:
the view to redirect to.

addAttachments

protected void addAttachments(ForumMessage message)
                       throws UnauthorizedException
Throws:
UnauthorizedException

isMultiPart

public static boolean isMultiPart(javax.servlet.http.HttpServletRequest request)
A utility method to determine if the given request is of the multipart content-type.

TODO: This method should be moved to a utils class.

Parameters:
request - the HttpServletRequest to examine.
Returns:
true if the request is a multipart one, false otherwise.

getContentType

public static java.lang.String getContentType(javax.servlet.http.HttpServletRequest request)
A utility method to return the content type of the incoming request.

TODO: This method should be moved to a utils class.

Parameters:
request - the HttpServletRequest to examine.
Returns:
the content type or null if it was not found or not specified.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.