|
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
public class ForumActionSupport
A base action class that handles a set of common Jive Forums code. This class extends the WebWork ActionSupport class which provides a lot of handy WebWork utilities. This class is also request and response aware so all actions will have a handle on the HttpServletRequest and HttpServletResponse objects.
Action writers may wish to define this class in the actions xml file - there is an
execute()
method implemented in this class which will always return
Action.SUCCESS
.
Field Summary | |
---|---|
static java.lang.String |
CANCEL
|
static java.lang.String |
DISABLED
|
static java.lang.String |
FATAL
|
static java.lang.String |
NOTFOUND
|
protected static java.lang.String |
SESSION_REFERRER_KEY
|
static java.lang.String |
UNAUTHORIZED
|
Fields inherited from class com.jivesoftware.base.action.JiveActionSupport |
---|
pageUser, request, 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 | |
---|---|
ForumActionSupport()
|
Method Summary | |
---|---|
java.lang.String |
execute()
Default implementation of doExecute() method. |
boolean |
getCanAttach(Forum forum)
Returns true if the page user can create message attachments in the given forum, false otherwise.. |
boolean |
getCanCreateMessage(ForumThread thread)
Returns true if the page user is authorized to create messages in the given thread, false otherwise. |
boolean |
getCanCreatePoll(Forum forum)
Returns true if the page user is authorized to create polls in the given forum, false otherwise. |
boolean |
getCanCreatePoll(ForumCategory category)
Returns true if the page user is authorized to create polls in the given category, false otherwise. |
boolean |
getCanCreateThread(Forum forum)
Returns true if the page user is authorized to create threads in the given forum, false otherwise. |
boolean |
getCanCreateThread(ForumCategory category)
Returns true if the page user is authorized to create threads in the given category, false otherwise. |
boolean |
getCanEdit(ForumMessage message)
Returns true if the page user has permission to edit the specified message, false otherwise. |
boolean |
getCanEditAttach(ForumMessage message)
Returns true if the page usre can create message attachments in the given forum, false otherwise. |
boolean |
getCanEditPoll(ForumCategory category,
Poll poll)
|
boolean |
getCanEditPoll(Forum forum,
Poll poll)
|
boolean |
getCanEditProfile()
Returns true if the user can edit their profile, false otherwise |
boolean |
getCanEditTags(ForumMessage message)
|
boolean |
getCanPostAnnounce(Forum forum)
Returns true if the page user is authorized to post announcements in the given forum, false otherwise. |
boolean |
getCanPostAnnounce(ForumCategory category)
Returns true if the page user is authorized to post announcements in the given category, false otherwise. |
boolean |
getCanRead(Forum forum)
Returns true if the page user is authorized to view content given forum, false otherwise. |
boolean |
getCanRead(ForumCategory category)
Returns true if the page user is authorized to view content given category, false otherwise. |
EntityDescriptor |
getEntityDescriptor(java.util.Map parameters)
Returns information (ID, type) about a specific type given a Map of parameters. |
ForumFactory |
getForumFactory()
Returns a reference to the ForumFactory object. |
User |
getPageUser()
Returns the current page user's User object, or null if the user is a guest. |
boolean |
getReadStatus(java.lang.Object obj,
int type)
Returns true if the user has the specified read status on the object, false otherwise. |
java.lang.String |
getSkinProperty(Forum forum,
java.lang.String name)
Returns a skin property. |
java.lang.String |
getThemeName()
Returns the theme name associated with the current request. |
boolean |
isAdmin(Forum forum)
Returns true if the page user is an administrator of the specified forum, false otherwise. |
boolean |
isAdmin(ForumCategory category)
Returns true if the page user is an administrator of the specified category, false otherwise. |
boolean |
isAuthor(ForumMessage message)
Returns true if the page user is the author of the specified message, false otherwise. |
boolean |
isAuthor(ForumThread thread)
Returns true if the page user is the author of the specified thread, false otherwise. |
boolean |
isMessageModerationOn(Forum forum)
Returs true if message-level moderation is enabled for this forum, false otherwise. |
boolean |
isModerator(Forum forum)
Returns true if the page user is a moderator of the specified forum. |
boolean |
isModerator(ForumCategory category)
Returns true if the page user is a moderator of the specified category. |
boolean |
isResourceInTheme(java.lang.String resourceName)
Checks if a file is available for the current theme. |
boolean |
isSystemAdmin()
Returns true if the page user is the system admin, false otherwise. |
boolean |
isThreadModerationOn(Forum forum)
Returns true if thread-level moderation is enabled for this forum, false otherwise. |
void |
setForumFactory(ForumFactory forumFactory)
Sets the forum factory -- useful for developers who subclass this class. |
void |
setUser(User user)
|
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, setServletRequest, setServletResponse |
Methods inherited from class com.opensymphony.xwork.ActionSupport |
---|
addActionError, addActionMessage, addFieldError, clearErrorsAndMessages, clone, doDefault, 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, validate |
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 NOTFOUND
public static final java.lang.String UNAUTHORIZED
public static final java.lang.String DISABLED
public static final java.lang.String CANCEL
public static final java.lang.String FATAL
protected static final java.lang.String SESSION_REFERRER_KEY
Constructor Detail |
---|
public ForumActionSupport()
Method Detail |
---|
public ForumFactory getForumFactory()
ForumFactory
public void setForumFactory(ForumFactory forumFactory)
setForumFactory
in interface ForumFactoryAware
forumFactory
- an instance of ForumFactory
public User getPageUser()
The best way to test for guest status is to call
JiveActionSupport.isGuest()
.
getPageUser
in class JiveActionSupport
User
public void setUser(User user)
setUser
in interface UserAware
setUser
in class JiveActionSupport
public boolean isSystemAdmin()
public boolean isAdmin(ForumCategory category)
category
- the category to check.
public boolean isAdmin(Forum forum)
forum
- the forum to check.
public boolean isModerator(ForumCategory category)
category
- the category to check.
public boolean isModerator(Forum forum)
forum
- the category to check.
public boolean isAuthor(ForumThread thread)
thread
- the thread to check.
public boolean isAuthor(ForumMessage message)
message
- the message to check.
public boolean getCanEdit(ForumMessage message)
Additionally, this method will obey the editing policy which is set via the admin console. A message can always be edited, never be edited, edited as long as there are no replies or edited in a given time frame. This method checks to make sure the given message is not null. It may be necessary to modify code that calls this method to add a null check around it.
message
- the message to test.
public boolean getCanEditTags(ForumMessage message)
public boolean getCanAttach(Forum forum)
forum
- the forum to check for permissions.
public boolean getCanEditAttach(ForumMessage message)
message
- the message to check.
public boolean getCanPostAnnounce(ForumCategory category)
ForumPermissions.ANNOUNCEMENT_ADMIN
.
category
- the category to check.
public boolean getCanPostAnnounce(Forum forum)
ForumPermissions.ANNOUNCEMENT_ADMIN
.
forum
- the forum to check.
public boolean getCanCreatePoll(ForumCategory category)
ForumPermissions.CREATE_POLL
.
category
- the forum to check.
public boolean getCanCreateMessage(ForumThread thread)
ForumPermissions.CREATE_MESSAGE
.
thread
- the thread to check.
public boolean getCanCreateThread(Forum forum)
ForumPermissions.CREATE_THREAD
.
forum
- the forum to check.
public boolean getCanCreateThread(ForumCategory category)
ForumPermissions.CREATE_THREAD
.
category
- the forum to check.
public boolean getCanCreatePoll(Forum forum)
ForumPermissions.CREATE_POLL
.
forum
- the forum to check.
public boolean getCanEditPoll(Forum forum, Poll poll)
public boolean getCanEditPoll(ForumCategory category, Poll poll)
public boolean getCanRead(ForumCategory category)
ForumPermissions.READ_FORUM
.
category
- the forum to check.
public boolean getCanRead(Forum forum)
ForumPermissions.READ_FORUM
.
forum
- the forum to check.
public java.lang.String getSkinProperty(Forum forum, java.lang.String name)
forum
- the forum to search in. See the SkinUtils method description for more details.name
- the name of the property we're looking for.
SkinUtils.getSkinProperty(Forum,String)
public boolean getReadStatus(java.lang.Object obj, int type)
Note, if the user is a guest then false will be returned always. This is because read tracking is not supported for guests.
obj
- the object to test - must be a ForumThread or ForumMessagetype
- the read status to check.
public boolean isThreadModerationOn(Forum forum)
forum
- the Forum to test.
public boolean isMessageModerationOn(Forum forum)
forum
- the Forum to test.
public boolean getCanEditProfile()
public java.lang.String execute() throws java.lang.Exception
execute
in interface com.opensymphony.xwork.Action
execute
in class JiveActionSupport
java.lang.Exception
public EntityDescriptor getEntityDescriptor(java.util.Map parameters)
EntityAware
getEntityDescriptor
in interface EntityAware
parameters
- a Map of parameters with String keys and Long values.
public boolean isResourceInTheme(java.lang.String resourceName)
resourceName
- the resource to check for the current theme.
public java.lang.String getThemeName()
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |