|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork.ActionSupport
com.jivesoftware.base.action.JiveActionSupport
com.jivesoftware.forum.action.ForumActionSupport
com.jivesoftware.forum.action.PostAction
public class PostAction
An Action to encapsulate all the logic for posting messages using the new style single post page (as opposed to additional pages for spell checking, adding attachments, previewing, etc).
Field Summary | |
---|---|
static java.lang.String |
ATTACH
|
static java.lang.String |
REJECTED
|
static java.lang.String |
REQUEST_TOO_LARGE
|
static java.lang.String |
SESSION_MESSAGE_KEY
|
static java.lang.String |
SUCCESS_MODERATED
|
static java.lang.String |
SUCCESS_NEW_MESSAGE
|
static java.lang.String |
SUCCESS_NEW_MESSAGE_STQC
|
static java.lang.String |
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 | |
---|---|
PostAction()
|
Method Summary | |
---|---|
protected void |
addAttachments(ForumMessage message)
Adds attachments to a message |
protected void |
cleanSession()
Cleans the session of all relevant data |
protected void |
createMessage()
Convenience method for creating a new 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 |
doPost()
This command allows users to post directly from another page. |
java.lang.String |
doReply()
This command is for designating that this message should be treated as reply. |
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.String |
getAssignPoints()
Returns the number of points assigned for answering the question. |
java.io.File[] |
getAttachFile()
Returns an array of File objects corresponding to uploaded files |
java.lang.String[] |
getAttachFileContentType()
Returns an srray of content types corresponding to the array of uploaded files |
java.lang.String[] |
getAttachFileFileName()
Returns an array of file names corresponding to the array of uploaded files |
int |
getAttachmentCount()
Returns a count of attachments associated with the new message. |
protected java.util.List |
getAttachmentList()
Returns a list of attachments from the temporary message |
java.util.Iterator |
getAttachments()
Returns an iterator of attachments associated with the new message. |
java.lang.String |
getBody()
Returns the message body. |
Draft |
getDraft()
Get the draft associated with the message. |
java.lang.String |
getEmail()
Returns the email address of the guest posting the message. |
EntityDescriptor |
getEntityDescriptor(java.util.Map parameters)
Returns information (ID, type) about a specific type given a Map of parameters. |
Forum |
getForum()
Returns the forum we're posting in. |
java.lang.String |
getFrom()
Returns the name of the action we're redirecting from. |
ForumMessage |
getMessage()
Returns the message we're replying to. |
java.lang.String |
getName()
Returns the name of the guest posting the message. |
ForumMessage |
getNewMessage()
Returns the new posted message. |
boolean |
getNewMessageIsModerated()
Returns true if the newly posted message is moderated. |
java.lang.String |
getParentQuotedText(boolean returnAsHtml)
A convenience method to quote the parent's message body. |
java.lang.String |
getPartialURL()
Convenience method for building a partial URL with forumID, threadID, messageID and reply specified. |
java.util.Iterator |
getPopularTags()
Returns an iterable collection of popular tags based on the current community and tag set. |
long[] |
getRemoveAttachID()
Returns the id's of attachments that are to be removed from the message. |
java.lang.String |
getReplySubject()
A convenience method to return the reply message subject. |
java.lang.String |
getResolution()
Returns the resolution being set for the question. |
javax.servlet.http.HttpServletRequest |
getServletRequest()
|
java.util.Map |
getSession()
Convenience method to gain access to the session object |
boolean |
getShowPopularTags()
Method to determine if popular tags should be shown. |
java.lang.String |
getSubject()
Returns the message subject. |
protected ContentTag |
getTag(java.lang.String tagname)
|
java.lang.String |
getTags()
Gets the current tags for this thread |
ForumThread |
getThread()
Returns the thread we're replying in (or making a reply to). |
protected boolean |
hasDraft()
Returns true if the user has one or more drafts that match this forum / thread / message combination. |
protected boolean |
hasPostPermission()
Returns true if the user has permission to post in this forum, false otherwise. |
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. |
boolean |
isEdit()
Returns false always. |
boolean |
isEditStampRequired()
Returns false always. |
boolean |
isJiveForumUploadSizeLimitExceeded()
Returns true if the request size limit was exceeded. |
boolean |
isMarkAsQuestion()
Indicates whether or not the user wants to mark this posting as a question. |
boolean |
isPostedFromGUIEditor()
Returns true if the content being posted was posted from the GUI editor. |
boolean |
isReply()
Returns true if this message is a reply to another message. |
boolean |
isShortTermQueryCacheEnabled()
Returns true if short term query cache is enabled, false otherwise. |
protected boolean |
loadJiveObjects()
Loads Jive objects used in this actions (ie, forum, thread, message objects). |
protected void |
loadToSession(ForumMessage message)
Puts relevant message data in the session. |
protected boolean |
newMessageModerated(ForumMessage msg)
Determines whether the new message is moderated and sets the isNewMessageModerated variable. |
protected void |
removeAttachments(ForumMessage message)
Remove attachments from a message |
protected void |
removeFromSession()
Retrieves relevant message data from the session. |
protected ForumMessage |
retrieveFromSession()
Retrieves relevant message data from the session. |
void |
setAssignPoints(java.lang.String assignPoints)
Sets the number of points to assign for answering the question. |
void |
setAttachFile(java.io.File[] attachFile)
Sets an array of File objects corresponding to uploaded files |
void |
setAttachFileContentType(java.lang.String[] attachFileContentType)
Sets an srray of content types corresponding to the array of uploaded files |
void |
setAttachFileFileName(java.lang.String[] attachFileFileName)
Sets an array of file names corresponding to the array of uploaded files |
void |
setBody(java.lang.String body)
Sets the message body. |
void |
setCancel(java.lang.String cancel)
Sets whether or not the user wants to cancel. |
void |
setDraft(Draft draft)
Set the draft associated with the message. |
void |
setDraftEnabled(boolean draftEnabled)
Sets whether or not drafts are enabled |
void |
setDraftExists(boolean draftExists)
Sets whether or not the user has a draft for this forum/thread/message combo. |
void |
setEmail(java.lang.String email)
Sets the email address of the guest posting the message. |
void |
setForum(Forum forum)
Provides the action an instance of Forum |
void |
setForumCategory(ForumCategory category)
|
void |
setFrom(java.lang.String from)
Sets the name of the action we're redirecting from. |
void |
setJiveForumUploadSizeLimitExceeded(boolean jiveForumUploadSizeLimitExceeded)
Set to true if the request size limit was exceeded. |
void |
setMarkAsQuestion(boolean markAsQuestion)
Sets whether or not the user wants to mark this post as a question. |
void |
setMessage(ForumMessage message)
Provides the action an instance of ForumMessage |
void |
setName(java.lang.String name)
Sets the name of the guest posting the message. |
protected void |
setNewMessage(ForumMessage newMessage)
Sets the new posted message. |
void |
setPostedFromGUIEditor(boolean postedFromGUIEditor)
Set to true if the content being posted was posted from the GUI editor, false otherwise. |
void |
setRemoveAttachID(long[] removeAttachID)
Sets the id's of attachments that are to be removed from the message. |
void |
setReply(boolean reply)
Sets reply to true if this is a reply to a message or thread, false otherwise. |
void |
setResolution(java.lang.String resolution)
Sets the resolution for this question. |
void |
setServletRequest(javax.servlet.http.HttpServletRequest request)
|
void |
setSession(java.util.Map session)
|
void |
setSubject(java.lang.String subject)
Sets the message subject. |
void |
setTags(java.lang.String tags)
Sets the current tags for this thread |
void |
setThread(ForumThread thread)
Provides the action an instance of ForumThread |
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 a forum post rather than showing the user a message that says 'would you like to use the existing draft?' |
void |
validate()
Validates all user input. |
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 |
Field Detail |
---|
public static final java.lang.String ATTACH
public static final java.lang.String REJECTED
public static final java.lang.String REQUEST_TOO_LARGE
public static final java.lang.String SUCCESS_MODERATED
public static final java.lang.String SUCCESS_NEW_TOPIC
public static final java.lang.String SUCCESS_NEW_MESSAGE_STQC
public static final java.lang.String SUCCESS_NEW_MESSAGE
public static final java.lang.String SESSION_MESSAGE_KEY
Constructor Detail |
---|
public PostAction()
Method Detail |
---|
public java.util.Map getSession()
JiveActionSupport
getSession
in class JiveActionSupport
public void setSession(java.util.Map session)
setSession
in interface com.opensymphony.webwork.interceptor.SessionAware
public javax.servlet.http.HttpServletRequest getServletRequest()
public void setServletRequest(javax.servlet.http.HttpServletRequest request)
setServletRequest
in interface com.opensymphony.webwork.interceptor.ServletRequestAware
setServletRequest
in class JiveActionSupport
public Forum getForum()
public void setForum(Forum forum)
ForumAware
Forum
setForum
in interface ForumAware
forum
- an instance of Forum
public ForumThread getThread()
public void setThread(ForumThread thread)
ForumThreadAware
ForumThread
setThread
in interface ForumThreadAware
thread
- an instance of ForumThread
public ForumMessage getMessage()
public void setMessage(ForumMessage message)
ForumMessageAware
ForumMessage
setMessage
in interface ForumMessageAware
message
- an instance of ForumMessage
public java.lang.String getName()
public void setName(java.lang.String name)
name
- the name of the guest posting the message.public java.lang.String getEmail()
public void setEmail(java.lang.String email)
email
- the email address of the guest posting the message.public java.lang.String getSubject()
public void setSubject(java.lang.String subject)
subject
- sets the message subject.public java.lang.String getBody()
public void setBody(java.lang.String body)
body
- the body of a message.public boolean isPostedFromGUIEditor()
public void setPostedFromGUIEditor(boolean postedFromGUIEditor)
postedFromGUIEditor
- true if the content being posted was posted from the GUI editor, false otherwise.public java.io.File[] getAttachFile()
public void setAttachFile(java.io.File[] attachFile)
attachFile
- an array of File objects corresponding to uploaded filespublic java.lang.String[] getAttachFileContentType()
getAttachFile()
public void setAttachFileContentType(java.lang.String[] attachFileContentType)
attachFileContentType
- an srray of content types corresponding to the array of uploaded filespublic java.lang.String[] getAttachFileFileName()
getAttachFile()
public void setAttachFileFileName(java.lang.String[] attachFileFileName)
attachFileFileName
- an array of file names corresponding to the array of uploaded filespublic long[] getRemoveAttachID()
public void setRemoveAttachID(long[] removeAttachID)
removeAttachID
- the id's of attachments that are to be removed from the message.public java.lang.String getFrom()
public void setFrom(java.lang.String from)
from
- the name of the action we're redirecting from.public java.lang.String isCancel()
public void setCancel(java.lang.String cancel)
cancel
- the cancel stringpublic boolean isMarkAsQuestion()
public void setMarkAsQuestion(boolean markAsQuestion)
markAsQuestion
- "true" if the user wants to mark this post as a question.public java.lang.String getTags()
public void setTags(java.lang.String tags)
tags
- the current tags for this threadpublic boolean useDraft()
public void setUseDraft(boolean useDraft)
useDraft
- true to use and existing draft, false otherwise.public boolean isDraftExists()
public void setDraftExists(boolean draftExists)
draftExists
- "true" if the user has a draftpublic boolean isDraftEnabled()
public void setDraftEnabled(boolean draftEnabled)
draftEnabled
- "true" if drafts are enabledpublic Draft getDraft()
public void setDraft(Draft draft)
draft
- the draft associated with the messagepublic java.lang.String getResolution()
public void setResolution(java.lang.String resolution)
resolution
- the resolution to set.public boolean getShowPopularTags()
public java.lang.String getAssignPoints()
public void setAssignPoints(java.lang.String assignPoints)
assignPoints
- the number of points to assign for answering the question.public boolean isJiveForumUploadSizeLimitExceeded()
public void setJiveForumUploadSizeLimitExceeded(boolean jiveForumUploadSizeLimitExceeded)
jiveForumUploadSizeLimitExceeded
- true if the request size limit was exceeded.public boolean isReply()
public void setReply(boolean reply)
reply
- true if this is a reply to a message or thread, false otherwise.public boolean isEdit()
public boolean isEditStampRequired()
public ForumMessage getNewMessage()
protected void setNewMessage(ForumMessage newMessage)
createMessage()
method.
newMessage
- the new posted message or null if the message hasn't been posted yet.public boolean getNewMessageIsModerated()
public java.util.Iterator getAttachments()
public int getAttachmentCount()
public java.lang.String getReplySubject()
public java.lang.String getParentQuotedText(boolean returnAsHtml)
returnAsHtml
- true to return the quoted message as html, false to return as text
public boolean isShortTermQueryCacheEnabled()
public java.lang.String getPartialURL()
public java.lang.String doPost()
execute()
public java.lang.String doReply()
doDefault()
public void validate()
validate
in interface com.opensymphony.xwork.Validateable
validate
in class com.opensymphony.xwork.ActionSupport
public java.lang.String doDefault()
ActionSupport.getActionMessages()
method.
doDefault
in class com.opensymphony.xwork.ActionSupport
public java.lang.String execute()
execute
in interface com.opensymphony.xwork.Action
execute
in class ForumActionSupport
protected boolean newMessageModerated(ForumMessage msg)
isNewMessageModerated
variable.
msg
- the message to determine moderation upon
protected void addAttachments(ForumMessage message)
message
- the message to add attachments toprotected void removeAttachments(ForumMessage message)
message
- the message to remove attachments fromprotected void createMessage() throws UnauthorizedException, MessageRejectedException
UnauthorizedException
- if the user does not have permission to create the message.
MessageRejectedException
- if the user is prevented from posting this message.protected boolean loadJiveObjects() throws UnauthorizedException
UnauthorizedException
- if not authorized to load a jive objectprotected boolean hasPostPermission()
protected boolean hasDraft()
protected void loadToSession(ForumMessage message)
message
- the message to load to the sessionprotected ForumMessage retrieveFromSession()
protected void removeFromSession()
protected void cleanSession()
protected java.util.List getAttachmentList()
public EntityDescriptor getEntityDescriptor(java.util.Map parameters)
EntityAware
getEntityDescriptor
in interface EntityAware
getEntityDescriptor
in class ForumActionSupport
parameters
- a Map of parameters with String keys and Long values.
public java.util.Iterator getPopularTags()
protected ContentTag getTag(java.lang.String tagname)
public void setForumCategory(ForumCategory category)
setForumCategory
in interface ForumCategoryAware
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |