com.atlassian.confluence.core
Class ConfluenceActionSupport

java.lang.Object
  extended bycom.opensymphony.xwork.ActionSupport
      extended bycom.atlassian.confluence.core.ConfluenceActionSupport
All Implemented Interfaces:
com.opensymphony.xwork.Action, com.opensymphony.xwork.LocaleProvider, Serializable, com.opensymphony.xwork.TextProvider, com.opensymphony.xwork.Validateable, com.opensymphony.xwork.ValidationAware
Direct Known Subclasses:
AbstractBackupRestoreAction, AbstractEntityPaginationAction, AbstractGlobalPermissionsAction, AbstractGlobalPermissionsAction, AbstractGroupAction, AbstractLabelDisplayingAction, AbstractLabelsForEntityAction, AbstractLogoAction, AbstractPageAction, AbstractSetupAction, AbstractSetupEmailAction, AbstractSpaceAction, AbstractUserProfileAction, AbstractUsersAction, AddProfileToFavouritesAction, AdministrationConsoleAction, AdministratorsAction, AdvancedSearchTipsAction, AttachmentNotFoundAction, BrowseCommentsAction, BrowseJiraIssuesMacroIconMappingsAction, BrowseShortcutsAction, ClusterConfigurationAction, CoherenceCacheStatisticsAction, ColourPickerAction, ConfigureCaptchaAction, ConfigureLanguageAction, ConfigurePDFLanguageSupportAction, ConfigureRssFeedAction, CreateRssFeedAction, CustomHtmlAction, DailyBackupAdminAction, DashboardAction, EditLabelAction, EncodingTestAction, FlushCacheAction, FlushIndexQueueAction, ForgotUserNameAction, ForgotUserPasswordAction, GeneralConfigurationAction, GlobalRssBlogFeedAction, GlobalRssFeedAction, HomepageAction, ListNewOrUpdatedPagesAction, LoginAction, LogoutAction, LongRunningTaskMonitorAction, ManagePluginsAction, ManageReferrersAction, NotationHelpAction, NotFoundAction, PageNotFoundAction, PeopleDirectoryAction, PurgeReferrersAction, RebuildAncestorTableAction, RefreshLicensingAction, ReIndexAction, RemoveJiraIssuesMacroIconMappingsAction, RemoveProfileFromFavouritesAction, RemoveSmtpMailServerAction, SearchSiteAction, SendTestEmailAction, SetupDBOtherAction, SignupAction, StartClusterAction, StylesheetAction, SupportRequestAction, TinyUrlAction, UserMacroAction, ViewIndexQueueAction, ViewLicenseAction, ViewMailQueueAction, ViewMailServersAction, ViewSystemClasspathAction, ViewSystemInfoAction, ViewUserHistoryAction

public class ConfluenceActionSupport
extends com.opensymphony.xwork.ActionSupport
implements com.opensymphony.xwork.LocaleProvider

Base class for all Confluence webwork actions. Mainly takes care of managing permissions, and a few other tasks that are common across all actions in the app.

See Also:
Serialized Form

Field Summary
static String CANCEL
           
static String DEVMODE
           
protected  EventManager eventManager
           
protected  I18NBeanFactory i18NBeanFactory
           
protected  LabelManager labelManager
           
protected  LanguageManager languageManager
           
static String LICENSE_EXPIRED
           
static String LICENSE_USERS_EXCEEDED
           
protected  org.apache.log4j.Category log
           
protected  PermissionManager permissionManager
           
protected  boolean permitted
           
static String PREVIEW
           
protected  SettingsManager settingsManager
           
protected  SpacePermissionManager spacePermissionManager
           
protected  UserAccessor userAccessor
           
protected  WebInterfaceManager webInterfaceManager
           
 
Fields inherited from class com.opensymphony.xwork.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
ConfluenceActionSupport()
           
 
Method Summary
 void addActionError(String textKey, Object[] args)
          XML-escapes any String arguments to avoid cross-site scripting problems with user input.
protected  void addPermissionTypeTo(String permissionType, List permissionTypes)
           
protected  void addToHistory(ContentEntityObject content)
           
 String doDefault()
          Default webwork action execution method.
 String getActionName(String fullClassName)
           
 BootstrapManager getBootstrapManager()
           
 String getCancelResult()
           
 DateFormatter getDateFormatter()
           
 ResourceBundle getDefaultResourceBundle()
           
 String getEditorLanguage()
          Specifies the language string to use in tiny MCE.
 EventManager getEventManager()
           
 ThemeHelper getGlobalHelper()
          Deprecated. Support for legacy 1.4 themes that might have had $globalHelper in them (unlikely but nice).
 Settings getGlobalSettings()
           
 ThemeHelper getHelper()
           
 I18NBean getI18n()
           
 List getInstalledLanguages()
           
 LabelManager getLabelManager()
           
 LanguageManager getLanguageManager()
           
 String getLanguageUserFriendly(String locale)
           
 Locale getLocale()
           
 LocaleManager getLocaleManager()
           
 String getLocaleString()
           
 String getNiceContentType(ContentEntityObject entityObject)
           
protected  List getPermissionTypes()
           
protected  List getPermittedEntitiesOf(Iterator entities, int maxCount)
           
protected  List getPermittedEntitiesOf(Iterator entities, int maxCount, List criteria)
           
protected  List getPermittedEntitiesOf(List entities)
           
 Date getPreviousLoginDate()
           
 int getRandom()
           
 User getRemoteUser()
          Return the user from ServletActionContext.getRequest(), or if that is not found, the user returned from AuthenticatedUserThreadLocal.getUser().
 Map getSession()
           
 ThemeHelper getSpaceHelper()
          Deprecated. Support for legacy 1.4 themes that might have had $spaceHelper in them (unlikely but nice).
 String getText(String key)
           
 String getText(String key, List list)
           
 String getText(String key, Object[] args)
           
 String getText(String key, String defaultValue)
          This can be used for internationalisation where an uninternationalised default string exists.
static String getTextStatic(String key)
           
static String getTextStatic(String key, Object[] list)
           
 String getTextStrict(String key)
           
 TimeZone getTimeZone()
           
 User getUser(String username)
           
 UserAccessor getUserAccessor()
           
 String getUserFullName(String username)
           
protected  UserInterfaceState getUserInterfaceState()
           
 WebInterfaceManager getWebInterfaceManager()
           
protected  boolean hasPermissionForSpace(List permissionTypes, Space space)
           
 boolean isAnonymousUser()
           
 boolean isCanceled()
          Has this action been cancelled? Used by interceptors to determine if the action should be executed.
 boolean isDevMode()
          Returns true if the system property confluence.devmode is set and has the value "true".
 boolean isEmailVisible()
           
 boolean isExternalUserManagementEnabled()
           
 boolean isLabelable(Object object)
           
 boolean isPermissionCheck()
           
 boolean isPermitted()
           
 String isPermittedAsString()
           
 boolean isPrintableVersion()
           
 void setBootstrapManager(BootstrapManager bootstrapManager)
           
 void setCancel(String cancel)
          Set by the "cancel" button on forms.
 void setEventManager(EventManager eventManager)
           
 void setFormatSettingsManager(FormatSettingsManager formatSettingsManager)
           
 void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
           
 void setLabelManager(LabelManager labelManager)
          Provide a LabelManager to this action.
 void setLanguageManager(LanguageManager languageManager)
           
 void setLocaleManager(LocaleManager localeManager)
           
 void setPermissionCheck(boolean permissionCheck)
           
 void setPermissionManager(PermissionManager permissionManager)
           
 void setPreviousLoginDate(Date previousLoginDate)
           
 void setSettingsManager(SettingsManager settingsManager)
           
 void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
           
 void setUserAccessor(UserAccessor userAccessor)
           
 void setWebInterfaceManager(WebInterfaceManager webInterfaceManager)
           
 
Methods inherited from class com.opensymphony.xwork.ActionSupport
addActionError, addActionMessage, addFieldError, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.log4j.Category log

CANCEL

public static final String CANCEL
See Also:
Constant Field Values

PREVIEW

public static final String PREVIEW
See Also:
Constant Field Values

LICENSE_EXPIRED

public static final String LICENSE_EXPIRED
See Also:
Constant Field Values

LICENSE_USERS_EXCEEDED

public static final String LICENSE_USERS_EXCEEDED
See Also:
Constant Field Values

DEVMODE

public static final String DEVMODE
See Also:
Constant Field Values

userAccessor

protected UserAccessor userAccessor

eventManager

protected EventManager eventManager

spacePermissionManager

protected SpacePermissionManager spacePermissionManager

permissionManager

protected PermissionManager permissionManager

settingsManager

protected SettingsManager settingsManager

labelManager

protected LabelManager labelManager

languageManager

protected LanguageManager languageManager

i18NBeanFactory

protected I18NBeanFactory i18NBeanFactory

webInterfaceManager

protected WebInterfaceManager webInterfaceManager

permitted

protected boolean permitted
Constructor Detail

ConfluenceActionSupport

public ConfluenceActionSupport()
Method Detail

setCancel

public void setCancel(String cancel)
Set by the "cancel" button on forms. This tells the ConfluenceWorkflowInterceptor that an action should not be executed, and should just return its "CANCEL" result.

Parameters:
cancel - Any non-null, non-empty string value.

isCanceled

public boolean isCanceled()
Has this action been cancelled? Used by interceptors to determine if the action should be executed.

See Also:
setCancel(String)

getRandom

public int getRandom()

doDefault

public String doDefault()
                 throws Exception
Default webwork action execution method.

Returns:
the action result
Throws:
Exception - if something goes wrong

getText

public String getText(String key)
Specified by:
getText in interface com.opensymphony.xwork.TextProvider

getText

public String getText(String key,
                      String defaultValue)
This can be used for internationalisation where an uninternationalised default string exists. If the key is null or returns a null value, then the default will be used instead.

Specified by:
getText in interface com.opensymphony.xwork.TextProvider

getText

public String getText(String key,
                      Object[] args)

getText

public String getText(String key,
                      List list)
Specified by:
getText in interface com.opensymphony.xwork.TextProvider

getActionName

public String getActionName(String fullClassName)

getTextStrict

public String getTextStrict(String key)

isPrintableVersion

public boolean isPrintableVersion()

isPermittedAsString

public String isPermittedAsString()

isPermitted

public boolean isPermitted()

isPermissionCheck

public boolean isPermissionCheck()

setPermissionCheck

public void setPermissionCheck(boolean permissionCheck)

getRemoteUser

public User getRemoteUser()
Return the user from ServletActionContext.getRequest(), or if that is not found, the user returned from AuthenticatedUserThreadLocal.getUser().

Returns:
the remote user

getUser

public User getUser(String username)

getUserFullName

public String getUserFullName(String username)

getPermissionTypes

protected List getPermissionTypes()

addPermissionTypeTo

protected void addPermissionTypeTo(String permissionType,
                                   List permissionTypes)

getPermittedEntitiesOf

protected List getPermittedEntitiesOf(List entities)

getPermittedEntitiesOf

protected List getPermittedEntitiesOf(Iterator entities,
                                      int maxCount,
                                      List criteria)

getPermittedEntitiesOf

protected List getPermittedEntitiesOf(Iterator entities,
                                      int maxCount)

setPreviousLoginDate

public void setPreviousLoginDate(Date previousLoginDate)

getPreviousLoginDate

public Date getPreviousLoginDate()

isExternalUserManagementEnabled

public boolean isExternalUserManagementEnabled()

addToHistory

protected void addToHistory(ContentEntityObject content)

getSession

public Map getSession()

getUserInterfaceState

protected UserInterfaceState getUserInterfaceState()

isAnonymousUser

public boolean isAnonymousUser()

isDevMode

public boolean isDevMode()
Returns true if the system property confluence.devmode is set and has the value "true".

Returns:
boolean

getCancelResult

public String getCancelResult()

getNiceContentType

public String getNiceContentType(ContentEntityObject entityObject)

getDefaultResourceBundle

public ResourceBundle getDefaultResourceBundle()

getGlobalSettings

public Settings getGlobalSettings()

isEmailVisible

public boolean isEmailVisible()

isLabelable

public boolean isLabelable(Object object)

setSettingsManager

public void setSettingsManager(SettingsManager settingsManager)

hasPermissionForSpace

protected boolean hasPermissionForSpace(List permissionTypes,
                                        Space space)

getEventManager

public EventManager getEventManager()

setEventManager

public void setEventManager(EventManager eventManager)

setBootstrapManager

public void setBootstrapManager(BootstrapManager bootstrapManager)

getBootstrapManager

public BootstrapManager getBootstrapManager()

setSpacePermissionManager

public void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)

setPermissionManager

public void setPermissionManager(PermissionManager permissionManager)

getWebInterfaceManager

public WebInterfaceManager getWebInterfaceManager()

setWebInterfaceManager

public void setWebInterfaceManager(WebInterfaceManager webInterfaceManager)

setLabelManager

public void setLabelManager(LabelManager labelManager)
Provide a LabelManager to this action.

Parameters:
labelManager -

getLabelManager

public LabelManager getLabelManager()

setLanguageManager

public void setLanguageManager(LanguageManager languageManager)

getLanguageManager

public LanguageManager getLanguageManager()

getHelper

public ThemeHelper getHelper()

getUserAccessor

public UserAccessor getUserAccessor()

setUserAccessor

public void setUserAccessor(UserAccessor userAccessor)

getGlobalHelper

public ThemeHelper getGlobalHelper()
Deprecated. Support for legacy 1.4 themes that might have had $globalHelper in them (unlikely but nice).


getSpaceHelper

public ThemeHelper getSpaceHelper()
Deprecated. Support for legacy 1.4 themes that might have had $spaceHelper in them (unlikely but nice).


getTextStatic

public static String getTextStatic(String key)

getTextStatic

public static String getTextStatic(String key,
                                   Object[] list)

getLocale

public Locale getLocale()
Specified by:
getLocale in interface com.opensymphony.xwork.LocaleProvider

getLocaleString

public String getLocaleString()

getLanguageUserFriendly

public String getLanguageUserFriendly(String locale)

getEditorLanguage

public String getEditorLanguage()
Specifies the language string to use in tiny MCE. This method may be better off moved down the hierarchy.


getInstalledLanguages

public List getInstalledLanguages()

addActionError

public void addActionError(String textKey,
                           Object[] args)
XML-escapes any String arguments to avoid cross-site scripting problems with user input.

Parameters:
textKey - key to internationalised text

getI18n

public I18NBean getI18n()

setLocaleManager

public void setLocaleManager(LocaleManager localeManager)

getLocaleManager

public LocaleManager getLocaleManager()

setI18NBeanFactory

public void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)

getTimeZone

public TimeZone getTimeZone()

getDateFormatter

public DateFormatter getDateFormatter()

setFormatSettingsManager

public void setFormatSettingsManager(FormatSettingsManager formatSettingsManager)


Confluence is developed by Atlassian.