Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.action.rss
Class RSSActionSupport

java.lang.Object
  extended by com.opensymphony.xwork.ActionSupport
      extended by com.jivesoftware.base.action.rss.RSSActionSupport
All Implemented Interfaces:
AuthTokenAware, com.opensymphony.webwork.interceptor.ServletRequestAware, com.opensymphony.webwork.interceptor.ServletResponseAware, 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:
RSSAnnouncements, RSSCommunityStats, RSSForums, RSSMainAction, RSSMessages, RSSPopularForums, RSSPopularThreads, RSSSearch, RSSThreads

public class RSSActionSupport
extends com.opensymphony.xwork.ActionSupport
implements AuthTokenAware, com.opensymphony.webwork.interceptor.ServletRequestAware, com.opensymphony.webwork.interceptor.ServletResponseAware

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:

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.

See Also:
Serialized Form

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

DISABLED

public static final java.lang.String DISABLED
Valid return code for the execute() method - indicates that RSS feeds are disabled.

See Also:
Constant Field Values

DEFAULT_NUM_ITEMS

public static final int DEFAULT_NUM_ITEMS
The default number of items to return. This can vary from subclass to subclass but is a good idea to return no more than this value by default.

See Also:
Constant Field Values

DATE_FORMAT

public static final java.lang.String DATE_FORMAT
The date format used for dates - this is the RFC 822 date format. Example output: Wed, 02 Oct 2002 08:00:00 -0800

See Also:
Constant Field Values

request

protected javax.servlet.http.HttpServletRequest request

response

protected javax.servlet.http.HttpServletResponse response
Constructor Detail

RSSActionSupport

public RSSActionSupport()
Method Detail

getUsername

public java.lang.String getUsername()
Returns the username to authenticate with.

Returns:
the username to authenticate with.

setUsername

public void setUsername(java.lang.String username)
Sets the username to authenticate with.

Parameters:
username - the username to authenticate with.

getPassword

public java.lang.String getPassword()
Returns the password to authenticate with.

Returns:
the password to authenticate with.

setPassword

public void setPassword(java.lang.String password)
Sets the password to authenticate with.

Parameters:
password - the password to authenticate with.

getNumItems

public int getNumItems()
Returns the number of items to show in the view. If this is not set, DEFAULT_NUM_ITEMS is used.

Returns:
the number of items to show in the view.

setNumItems

public void setNumItems(int numItems)
Sets the number of items to show in the view.

Parameters:
numItems - the number of items to show in the view.

getDateFormat

public java.text.DateFormat getDateFormat()
Returns the default date formatter. Override this method to provide different functionality. Default implementation uses the DateFormat class:s

Returns:
the default date formatter.

getPageUser

public User getPageUser()
Returns null always -- subclasses should override this is they wish to provide access to the page user.


execute

public java.lang.String execute()
                         throws java.lang.Exception
Checks to see if RSS feeds are disabled. If so, DISABLED is returned. Otherwise, executeRSS() is returned.

Specified by:
execute in interface com.opensymphony.xwork.Action
Overrides:
execute in class com.opensymphony.xwork.ActionSupport
Returns:
the return code for this action's execution.
Throws:
java.lang.Exception

executeRSS

public java.lang.String executeRSS()
                            throws java.lang.Exception
Main action execution method - returns Action.SUCCESS by default. Subclassers should override this method for additional functionality.

Returns:
a return code - see class description for more info.
Throws:
java.lang.Exception

getFeedTitle

public java.lang.String getFeedTitle()
Returns a suggested title for the RSS feed -- subclasses should override this method and provide a title that is unique. Most RSS readers need a unique title to properly show the feed to the user.


getDefaultBaseURL

public static java.lang.String getDefaultBaseURL()
Returns the base URL of this Jive installation - usually:

This uses the Jive property of jiveURL which is settable through the config file or admin console.

Returns:
the base URL of this Jive installation.

rssFeedsEnabled

public static boolean rssFeedsEnabled()
Returns true if RSS feeds are enabled, false otherwise. Uses the rssFeeds.enabled property which is settable through the config file or the admin console.

Returns:
true if RSS feeds are enabled, false otherwise.

getAuthToken

public AuthToken getAuthToken()

setAuthToken

public void setAuthToken(AuthToken authToken)
Specified by:
setAuthToken in interface AuthTokenAware

setServletRequest

public void setServletRequest(javax.servlet.http.HttpServletRequest request)
Specified by:
setServletRequest in interface com.opensymphony.webwork.interceptor.ServletRequestAware

setServletResponse

public void setServletResponse(javax.servlet.http.HttpServletResponse response)
Specified by:
setServletResponse in interface com.opensymphony.webwork.interceptor.ServletResponseAware

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.