|
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.rss.RSSActionSupport
public class RSSActionSupport
A base class for developers to help with RSS actions. This class factors out common things like
creating the AuthToken
, collecting the number of items
to show and
creating a default date formatter.
There are also some useful static utility methods:
getDefaultBaseURL()
- returns the base URL for the installation. Useful when
making links to the RSS feed.rssFeedsEnabled()
- returns true if RSS feeds are enabled.This class implements the execute()
method so it can short circut action execution
in the case where rss feeds are diabled. If RSS feeds are enabled then execution is passed to
executeRSS()
. Developers should put their core action logic in this method.
View authors need to handle 3 views for the typical RSS action: disabled, error
and success (there can always be more but that's up to the subclass).
disabled
applies when RSS feeds are off, error applies when there is
a problem executing the RSS action and success indicates normal execution.
Field Summary | |
---|---|
static java.lang.String |
DATE_FORMAT
The date format used for dates - this is the RFC 822 date format. |
static int |
DEFAULT_NUM_ITEMS
The default number of items to return. |
static java.lang.String |
DISABLED
Valid return code for the execute() method - indicates that RSS feeds are disabled. |
protected javax.servlet.http.HttpServletRequest |
request
|
protected javax.servlet.http.HttpServletResponse |
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 | |
---|---|
RSSActionSupport()
|
Method Summary | |
---|---|
java.lang.String |
execute()
Checks to see if RSS feeds are disabled. |
java.lang.String |
executeRSS()
Main action execution method - returns Action.SUCCESS by default. |
AuthToken |
getAuthToken()
|
java.text.DateFormat |
getDateFormat()
Returns the default date formatter. |
static java.lang.String |
getDefaultBaseURL()
Returns the base URL of this Jive installation - usually: http://[yoursite]/[webapp-path] This uses the Jive property of jiveURL which is settable through the config file or admin console. |
java.lang.String |
getFeedTitle()
Returns a suggested title for the RSS feed -- subclasses should override this method and provide a title that is unique. |
int |
getNumItems()
Returns the number of items to show in the view. |
User |
getPageUser()
Returns null always -- subclasses should override this is they wish to provide access to the page user. |
java.lang.String |
getPassword()
Returns the password to authenticate with. |
java.lang.String |
getUsername()
Returns the username to authenticate with. |
static boolean |
rssFeedsEnabled()
Returns true if RSS feeds are enabled, false otherwise. |
void |
setAuthToken(AuthToken authToken)
|
void |
setNumItems(int numItems)
Sets the number of items to show in the view. |
void |
setPassword(java.lang.String password)
Sets the password to authenticate with. |
void |
setServletRequest(javax.servlet.http.HttpServletRequest request)
|
void |
setServletResponse(javax.servlet.http.HttpServletResponse response)
|
void |
setUsername(java.lang.String username)
Sets the username to authenticate with. |
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, 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 DISABLED
execute()
method - indicates that RSS feeds are disabled.
public static final int DEFAULT_NUM_ITEMS
public static final java.lang.String DATE_FORMAT
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
Constructor Detail |
---|
public RSSActionSupport()
Method Detail |
---|
public java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- the username to authenticate with.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- the password to authenticate with.public int getNumItems()
DEFAULT_NUM_ITEMS
is used.
public void setNumItems(int numItems)
numItems
- the number of items to show in the view.public java.text.DateFormat getDateFormat()
DateFormat
class:
public User getPageUser()
public java.lang.String execute() throws java.lang.Exception
DISABLED
is returned. Otherwise, executeRSS()
is returned.
execute
in interface com.opensymphony.xwork.Action
execute
in class com.opensymphony.xwork.ActionSupport
java.lang.Exception
public java.lang.String executeRSS() throws java.lang.Exception
Action.SUCCESS
by default. Subclassers should
override this method for additional functionality.
java.lang.Exception
public java.lang.String getFeedTitle()
public static java.lang.String getDefaultBaseURL()
public static boolean rssFeedsEnabled()
public AuthToken getAuthToken()
public void setAuthToken(AuthToken authToken)
setAuthToken
in interface AuthTokenAware
public void setServletRequest(javax.servlet.http.HttpServletRequest request)
setServletRequest
in interface com.opensymphony.webwork.interceptor.ServletRequestAware
public void setServletResponse(javax.servlet.http.HttpServletResponse response)
setServletResponse
in interface com.opensymphony.webwork.interceptor.ServletResponseAware
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |