Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community.action
Class JiveActionSupport

java.lang.Object
  extended by com.opensymphony.xwork.ActionSupport
      extended by com.jivesoftware.community.action.JiveActionSupport
All Implemented Interfaces:
com.jivesoftware.community.action.AuthTokenAware, com.jivesoftware.community.action.JiveContextAware, com.jivesoftware.community.action.UserAware, 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

public class JiveActionSupport
extends com.opensymphony.xwork.ActionSupport
implements com.jivesoftware.community.action.AuthTokenAware, com.jivesoftware.community.action.UserAware, com.jivesoftware.community.action.JiveContextAware, com.opensymphony.webwork.interceptor.SessionAware, com.opensymphony.webwork.interceptor.ServletRequestAware, com.opensymphony.webwork.interceptor.ServletResponseAware

A base action class that handles a set of common Jive code. This class extends the WebWork ActionSupport class which provides a lot of handy WebWork utilities.

See Also:
Serialized Form

Field Summary
static java.lang.String CANCEL
          An action return type that indicates the user wants to cancel the current process.
protected static java.util.Map<java.lang.String,java.lang.String> i18nEditionKeys
           
static java.lang.String NOTFOUND
          An action return type that indicates that the resource being requested doesn't exist.
protected  javax.servlet.http.HttpServletRequest request
           
protected  javax.servlet.http.HttpServletResponse response
           
protected  java.util.Map<java.lang.String,java.lang.Object> session
           
protected static java.lang.String SESSION_REFERRER_KEY
           
static java.lang.String UNAUTHORIZED
          An action return type that indicates the user is not authorized to what they requested.
protected  User user
           
 
Fields inherited from class com.opensymphony.xwork.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
JiveActionSupport()
           
 
Method Summary
 java.lang.String doCancel()
           
 java.lang.String doInput()
           
 java.lang.String execute()
          Default implementation of doExecute() method.
 com.jivesoftware.community.xmpp.IMService getAIMIMService()
           
 AuthToken getAuthToken()
           
static java.util.Map<java.lang.String,java.lang.String> getContainerKeys()
          Used in conjunction with the overridden getText(...) method below, this method loads up all the EN properties files and examines each one for the existence of a matching "...internal" and "...external" key.
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.

protected  java.lang.String getGuestProperty(java.lang.String name)
          Returns a guest property.
 JiveContext getJiveContext()
           
 java.util.List<java.util.Locale> getLocales()
          Returns a list of available locales as a sorted list of Locale objects.
 java.lang.String getPageURL()
          Returns the URL of the current page as a string.
 org.xmpp.packet.Presence getPresence(User user)
           
 javax.servlet.http.HttpServletRequest getRequest()
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 java.util.Map<java.lang.String,java.lang.Object> getSession()
           
 java.lang.String getText(java.lang.String key)
          Override the getText(..) in ActionSupport so that we can intercept keys that are specific to either the internal or external editions of Clearspace.
 java.lang.String getText(java.lang.String aTextName, java.util.List args)
           
 java.lang.String getText(java.lang.String aTextName, java.lang.String defaultValue)
           
 java.lang.String getText(java.lang.String key, java.lang.String[] args)
           
 java.lang.String getText(java.lang.String aTextName, java.lang.String defaultValue, java.util.List args)
           
 java.lang.String getText(java.lang.String key, java.lang.String defaultValue, java.util.List args, com.opensymphony.xwork.util.OgnlValueStack stack)
          Override the getText(..) in ActionSupport so that we can intercept keys that are specific to either the internal or external editions of Clearspace.
 java.lang.String getText(java.lang.String aTextName, java.lang.String defaultValue, java.lang.String obj)
           
 java.lang.String getText(java.lang.String key, java.lang.String defaultValue, java.lang.String[] args)
           
 java.lang.String getText(java.lang.String key, java.lang.String defaultValue, java.lang.String[] args, com.opensymphony.xwork.util.OgnlValueStack stack)
           
 java.util.ResourceBundle getTexts()
           
 java.util.ResourceBundle getTexts(java.lang.String aBundleName)
           
 java.util.TimeZone getTimeZone()
          Returns the page user's time zone.
 java.lang.String[][] getTimeZones()
          Returns a list of time zones as a double String array.
 User getUser()
           
 WidgetContext getWidgetContext()
           
 com.jivesoftware.community.xmpp.IMService getXMPPIMService()
           
protected  boolean isFailedLookup(java.lang.String name)
          Lookup cache - this should be used if you want to note and remember a lookup on a field.
 boolean isGuest()
          Returns true if the page user is a guest or false if they're logged in.
 boolean isNewAccountCreationEnabled()
           
 boolean isReadTrackingEnabled()
          Returns true if read tracking is enabled across the system.
 boolean isSystemAdmin()
          Returns true if the page user is the system admin, false otherwise.
 boolean isUserBannedFromPosting()
           
 java.util.List loadTagList(java.lang.String tags)
          Retuns a List of ContentTag objects from the given space or + delimited list of tags.
 void setAuthToken(AuthToken authToken)
           
protected  void setGuestProperty(java.lang.String name, java.lang.String value)
          Sets a guest cookie.
 void setJiveContext(JiveContext jiveContext)
           
 void setServletRequest(javax.servlet.http.HttpServletRequest request)
           
 void setServletResponse(javax.servlet.http.HttpServletResponse response)
           
 void setSession(java.util.Map session)
           
 void setUser(User user)
           
 
Methods inherited from class com.opensymphony.xwork.ActionSupport
addActionError, addActionMessage, addFieldError, clearErrorsAndMessages, clone, doDefault, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getLocale, 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

CANCEL

public static final java.lang.String CANCEL
An action return type that indicates the user wants to cancel the current process.

See Also:
Constant Field Values

NOTFOUND

public static final java.lang.String NOTFOUND
An action return type that indicates that the resource being requested doesn't exist.

See Also:
Constant Field Values

UNAUTHORIZED

public static final java.lang.String UNAUTHORIZED
An action return type that indicates the user is not authorized to what they requested. This is finer-grained than Action.LOGIN since the workflow in this case can be more specific to the error (ie, the user is presented with "Sorry, you don't have access to ..." instead of just pushing them to the login screen.

See Also:
Constant Field Values

SESSION_REFERRER_KEY

protected static final java.lang.String SESSION_REFERRER_KEY
See Also:
Constant Field Values

i18nEditionKeys

protected static java.util.Map<java.lang.String,java.lang.String> i18nEditionKeys

user

protected User user

session

protected java.util.Map<java.lang.String,java.lang.Object> session

request

protected javax.servlet.http.HttpServletRequest request

response

protected javax.servlet.http.HttpServletResponse response
Constructor Detail

JiveActionSupport

public JiveActionSupport()
Method Detail

setAuthToken

public void setAuthToken(AuthToken authToken)
Specified by:
setAuthToken in interface com.jivesoftware.community.action.AuthTokenAware

setUser

public void setUser(User user)
Specified by:
setUser in interface com.jivesoftware.community.action.UserAware

setJiveContext

public void setJiveContext(JiveContext jiveContext)
Specified by:
setJiveContext in interface com.jivesoftware.community.action.JiveContextAware

setSession

public void setSession(java.util.Map session)
Specified by:
setSession in interface com.opensymphony.webwork.interceptor.SessionAware

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

getAuthToken

public AuthToken getAuthToken()

getUser

public User getUser()

getJiveContext

public JiveContext getJiveContext()

getSession

public java.util.Map<java.lang.String,java.lang.Object> getSession()

getRequest

public javax.servlet.http.HttpServletRequest getRequest()

getResponse

public javax.servlet.http.HttpServletResponse getResponse()

doCancel

public java.lang.String doCancel()

doInput

public java.lang.String doInput()
Overrides:
doInput in class com.opensymphony.xwork.ActionSupport

execute

public java.lang.String execute()
Default implementation of doExecute() method. This class is intended to be a base class for other actions but can be used as an action itself if the skin author simply wants to get access to the context & methods provided by this class.

Specified by:
execute in interface com.opensymphony.xwork.Action
Overrides:
execute in class com.opensymphony.xwork.ActionSupport
Returns:
Action.SUCCESS

isGuest

public boolean isGuest()
Returns true if the page user is a guest or false if they're logged in.

Returns:
true if the page user is a guest, false otherwise.

isSystemAdmin

public boolean isSystemAdmin()
Returns true if the page user is the system admin, false otherwise.

Returns:
true if the page user is the system admin, false otherwise.

getLocales

public java.util.List<java.util.Locale> getLocales()
Returns a list of available locales as a sorted list of Locale objects. The sorting is based upon the locales' display name.

Returns:
a list of available locales.

getTimeZone

public java.util.TimeZone getTimeZone()
Returns the page user's time zone.

Returns:
the page user's time zone.
See Also:
LocaleUtils.getTimeZone(javax.servlet.http.HttpServletRequest, User)

getTimeZones

public java.lang.String[][] getTimeZones()
Returns a list of time zones as a double String array. The first element is a unique time zone ID and the second is a human-readable version of the time zone.

Returns:
a list of available time zones.

isFailedLookup

protected boolean isFailedLookup(java.lang.String name)
Lookup cache - this should be used if you want to note and remember a lookup on a field. For example, say you have a field "username" which is initially null. The getter method, getUsername() will check if the username is null and if so, look it up (possibly expensive) and then if it's found save it to the username variable. If the lookup fails username will still be null. Because we check for null each time the lookup will fail each time - noting the failed lookup in this cache helps you remember a failed lookup.

Parameters:
name - The name to check for in the failed lookup cache
Returns:
true if the lookup for "name" failed, false otherwise.

getGuestProperty

protected java.lang.String getGuestProperty(java.lang.String name)
Returns a guest property. This abstracts all the code of getting cookies, retrieving values, etc.

Parameters:
name - the name of the property to retieve.
Returns:
the property value or null if the property is not found.

setGuestProperty

protected void setGuestProperty(java.lang.String name,
                                java.lang.String value)
Sets a guest cookie. This handles all the logic of setting a cookie.

Parameters:
name - the name of the property to set.
value - the property value.

getPresence

public org.xmpp.packet.Presence getPresence(User user)

getPageURL

public java.lang.String getPageURL()
Returns the URL of the current page as a string. This only returns the url and it's get parameters, not all the parameters of the action.

Returns:
the URL of the current page

isReadTrackingEnabled

public boolean isReadTrackingEnabled()
Returns true if read tracking is enabled across the system.

Returns:
true if read tracking is enabled across the system.

getContainerKeys

public static java.util.Map<java.lang.String,java.lang.String> getContainerKeys()
Used in conjunction with the overridden getText(...) method below, this method loads up all the EN properties files and examines each one for the existence of a matching "...internal" and "...external" key. If matching internal and external keys exist, the key (minus the '.internal') is added to a map which the getText(...) method uses to magically provide an edition specific value ('Space' for the internal edition, 'Community' for the external edition).

Returns:
a map of strings that need to be special cased by getText(...)

getText

public java.lang.String getText(java.lang.String key)
Override the getText(..) in ActionSupport so that we can intercept keys that are specific to either the internal or external editions of Clearspace. See ActionSupport.getText(String).

Specified by:
getText in interface com.opensymphony.xwork.TextProvider
Overrides:
getText in class com.opensymphony.xwork.ActionSupport

getText

public java.lang.String getText(java.lang.String key,
                                java.lang.String defaultValue,
                                java.util.List args,
                                com.opensymphony.xwork.util.OgnlValueStack stack)
Override the getText(..) in ActionSupport so that we can intercept keys that are specific to either the internal or external editions of Clearspace. See ActionSupport.getText(String, String, java.util.List, com.opensymphony.xwork.util.OgnlValueStack).

Specified by:
getText in interface com.opensymphony.xwork.TextProvider
Overrides:
getText in class com.opensymphony.xwork.ActionSupport

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.
See Also:
JiveGlobals.getDefaultBaseURL()

loadTagList

public java.util.List loadTagList(java.lang.String tags)
Retuns a List of ContentTag objects from the given space or + delimited list of tags.

Parameters:
tags - a space or plus (+) delimited list of tags to filter by
Returns:
a list of ContentTag objects from the given space or + delimited list of tags

getXMPPIMService

public com.jivesoftware.community.xmpp.IMService getXMPPIMService()

getAIMIMService

public com.jivesoftware.community.xmpp.IMService getAIMIMService()

isUserBannedFromPosting

public boolean isUserBannedFromPosting()

isNewAccountCreationEnabled

public boolean isNewAccountCreationEnabled()

getWidgetContext

public WidgetContext getWidgetContext()

getText

public java.lang.String getText(java.lang.String aTextName,
                                java.lang.String defaultValue)
Specified by:
getText in interface com.opensymphony.xwork.TextProvider
Overrides:
getText in class com.opensymphony.xwork.ActionSupport

getText

public java.lang.String getText(java.lang.String aTextName,
                                java.lang.String defaultValue,
                                java.lang.String obj)
Specified by:
getText in interface com.opensymphony.xwork.TextProvider
Overrides:
getText in class com.opensymphony.xwork.ActionSupport

getText

public java.lang.String getText(java.lang.String aTextName,
                                java.util.List args)
Specified by:
getText in interface com.opensymphony.xwork.TextProvider
Overrides:
getText in class com.opensymphony.xwork.ActionSupport

getText

public java.lang.String getText(java.lang.String key,
                                java.lang.String[] args)
Specified by:
getText in interface com.opensymphony.xwork.TextProvider
Overrides:
getText in class com.opensymphony.xwork.ActionSupport

getText

public java.lang.String getText(java.lang.String aTextName,
                                java.lang.String defaultValue,
                                java.util.List args)
Specified by:
getText in interface com.opensymphony.xwork.TextProvider
Overrides:
getText in class com.opensymphony.xwork.ActionSupport

getText

public java.lang.String getText(java.lang.String key,
                                java.lang.String defaultValue,
                                java.lang.String[] args)
Specified by:
getText in interface com.opensymphony.xwork.TextProvider
Overrides:
getText in class com.opensymphony.xwork.ActionSupport

getText

public java.lang.String getText(java.lang.String key,
                                java.lang.String defaultValue,
                                java.lang.String[] args,
                                com.opensymphony.xwork.util.OgnlValueStack stack)
Specified by:
getText in interface com.opensymphony.xwork.TextProvider
Overrides:
getText in class com.opensymphony.xwork.ActionSupport

getTexts

public java.util.ResourceBundle getTexts()
Specified by:
getTexts in interface com.opensymphony.xwork.TextProvider
Overrides:
getTexts in class com.opensymphony.xwork.ActionSupport

getTexts

public java.util.ResourceBundle getTexts(java.lang.String aBundleName)
Specified by:
getTexts in interface com.opensymphony.xwork.TextProvider
Overrides:
getTexts in class com.opensymphony.xwork.ActionSupport

Clearspace Project Page

Copyright © 1999-2007 Jive Software.