Package com.atlassian.confluence.core
Class ConfluenceActionSupport
- java.lang.Object
-
- com.opensymphony.xwork2.ActionSupport
-
- com.atlassian.confluence.core.ConfluenceActionSupport
-
- All Implemented Interfaces:
WebInterface,MessageHolderAware,com.opensymphony.xwork2.Action,com.opensymphony.xwork2.interceptor.ValidationAware,com.opensymphony.xwork2.LocaleProvider,com.opensymphony.xwork2.TextProvider,com.opensymphony.xwork2.Validateable,Serializable
- Direct Known Subclasses:
AboutPageAction,AbstractBackupRestoreAction,AbstractCommandAction,AbstractEntityPaginationAction,AbstractFlushIndexQueueAction,AbstractGroupAction,AbstractLogoAction,AbstractPageAwareAction,AbstractPermissionsAction,AbstractSetupAction,AbstractSetupEmailAction,AbstractSpaceAction,AbstractTrustedApplicationAction,AbstractUpdateLicenseAction,AbstractUserProfileAction,AbstractUserProfileAction,AbstractUsersAction,AbstractViewAction,AbstractViewAttachmentsAction,AbstractViewIndexQueueAction,AddFavouriteAction,AddLabelAction,AddLabelAjaxAction,AddSpaceToFavouriteAjaxAction,AdministrationConsoleAction,AdvancedSearchTipsAction,AjaxLoginCompleteAction,AllowAllAnnotationAction,AttachedImagesAction,AttachFileAction,AttachmentNotFoundAction,AttachmentStorageSetupAction,AuthenticateAction,AutocompleteLabelsAction,BreadcrumbAction,BrowseCommentsAction,BrowseMacrosAction,BrowseShortcutsAction,BrowseUnsyncedUsersAction,ChangeCronJobScheduleAction,ChangeSimpleJobScheduleAction,ColorsStylesheetAction,ColourPickerAction,ConfigureCaptchaAction,ConfigureLanguageAction,ConfigureLoggingAction,ConfigureMobileAppsAction,ConfigureMonitoringAction,ConfigureRssFeedAction,ConfirmEmailAction,ContentNameSearchAction,ContentRemigrationAction,CreateRssFeedAction,CustomHtmlAction,CustomStylesheetAction,DailyBackupAdminAction,DashboardAction,DraftAttachmentSearchAction,DropAuthenticationAction,EditSiteLogoAction,EditStylesheetAction,EncodingTestAction,FindRestrictableEntitiesAction,FlushCacheAction,FlushIndexQueueAction,FollowUserAction,ForceUpgradeAction,ForgotUserPasswordAction,FourOhFourAction,GeneralConfigurationAction,GetFutureSchedulesAction,GlobalRssFeedAction,HeartbeatAction,HelpLinkAction,HistoryAction,HomepageAction,IndexAction,JobAction,LikeAction,ListNewOrUpdatedPagesAction,ListWatchersAction,LoadConsoleAction,LogoutAction,LongRunningTaskMonitorAction,MacroDetailsAction,MailServerTestConnectionAction,MaintenanceConfigurationAction,ManageAdminTaskAction,MarkAllLogsAction,NetworkFeedAction,NoRequireAnnotationAction,NotificationsAction,OpenSearchDescriptorAction,PageDestinationSearchAction,PageNotFoundAction,PageNotificationAction,PageNotPermittedAction,PeopleDirectoryAction,PluginOsgiExportsAction,PulpRenderAction,ReadOnlyAccessAction,RebuildAncestorTableAction,RefreshLicensingAction,ReindexTaskProgressAction,RemoveFavouriteAction,RemoveLabelAction,RemoveLabelAjaxAction,RemoveMailServerAction,RemoveSpaceFromFavouriteAjaxAction,RequireGetMethodAction,RequirePostMethodAction,ResetUserPasswordAction,ResumeDraftAction,SearchIndexesAction,SearchSiteAction,SecurityConfigurationAction,SendTestEmailAction,ServerInfoAction,SiteDarkFeaturesAction,SiteSupportAction,SpacesConfigurationAction,StaticRenderingAction,ThemeColorsStylesheetAction,TinyUrlAction,UnFollowUserAction,UploadAction,UserMacroAction,UserPopupAction,ValidateLabelAjaxAction,VelocityResultAction,ViewIndexQueueAction,ViewMailQueueAction,ViewMailServersAction,ViewSourceAction,ViewSpaceDirectoryAction,ViewSystemClasspathAction,ViewSystemInfoAction,ViewUserHistoryAction,WarmInstanceAction,WysiwygConverterAction,XsrfTokenExpiredAction
public class ConfluenceActionSupport extends com.opensymphony.xwork2.ActionSupport implements com.opensymphony.xwork2.LocaleProvider, WebInterface, MessageHolderAware
Base class for all Confluence Struts 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
Fields Modifier and Type Field Description protected AccessModeServiceaccessModeServicestatic StringCANCELstatic StringDEVMODEprotected com.atlassian.event.EventManagereventManagerprotected I18NBeanFactoryi18NBeanFactoryprotected LabelManagerlabelManagerprotected LanguageManagerlanguageManagerstatic StringLICENSE_EXPIREDstatic StringLICENSE_USERS_EXCEEDEDprotected MessageHoldermessageHolderprotected PermissionManagerpermissionManagerprotected booleanpermittedprotected PersonServicepersonServiceprotected com.atlassian.plugin.PluginAccessorpluginAccessorstatic StringPREVIEWprotected SettingsManagersettingsManagerprotected SpacePermissionManagerspacePermissionManagerprotected UserAccessoruserAccessorprotected com.atlassian.plugin.web.WebInterfaceManagerwebInterfaceManager
-
Constructor Summary
Constructors Constructor Description ConfluenceActionSupport()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddActionError(String textKey, Object... args)Adds an error to the current action which will be displayed to the user.voidaddActionMessage(String textKey, Object... args)Adds a message to the current action which will be displayed to the user.voidaddFieldError(String fieldName, String textKey, Object[] args)Adds an error to the current action which will be displayed next to the specified field.protected voidaddPermissionTypeTo(String permissionType, List<String> permissionTypes)protected voidaddToHistory(ContentEntityObject content)StringdoDefault()Convenient Action execution method which defaults to returning INPUTStringformatFriendlyDate(Date date)StringgetAccessMode()Used by velocity to add to page meta data, indicating the current access modeStringgetActionName()Returns the internationalised name of the current action.StringgetActionName(String fullClassName)ConfluenceUsergetAuthenticatedUser()Return the user fromAuthenticatedUserThreadLocal.get().protected BootstrapManagergetBootstrapManager()Deprecated.since 7.20 and will be removed from 8.0.BootstrapStatusProvidergetBootstrapStatusProvider()protected StringgetCancel()get the value of the cancel parameterStringgetCancelResult()ConfluenceAccessManagergetConfluenceAccessManager()Map<String,Object>getContext()protected javax.servlet.http.HttpServletRequestgetCurrentRequest()protected javax.servlet.http.HttpSessiongetCurrentSession()StringgetDateFormatSetting()DateFormattergetDateFormatter()ResourceBundlegetDefaultResourceBundle()TimeZonegetDefaultTimeZone()StringgetDocLink(String page)Creates a version specific documentation link for the provided page.com.atlassian.event.EventManagergetEventManager()FriendlyDateFormattergetFriendlyDateFormatter()StringgetFrontendServiceURL()Returns the URL of the Confluence Frontend microservice.SettingsgetGlobalSettings()ThemeHelpergetHelper()I18NBeangetI18n()List<Language>getInstalledLanguages()We MUST use the accessor here, otherwise languageManager may be nullLabelManagergetLabelManager()StringgetLanguageJs()LanguageManagergetLanguageManager()StringgetLanguageUserFriendly(String locale)LocalegetLocale()LocaleManagergetLocaleManager()StringgetLocaleString()MessageHoldergetMessageHolder()StringgetNiceContentType(ContentEntityObject entityObject)Deprecated.since 4.2 - use ContentUiSupport directlyprotected PermissionManagergetPermissionManager()protected List<String>getPermissionTypes()protected <TYPE> List<TYPE>getPermittedEntitiesOf(Iterator<TYPE> entities, int maxCount)protected <TYPE> List<TYPE>getPermittedEntitiesOf(Iterator<TYPE> entities, int maxCount, List<? extends PermissionManager.Criterion> criteria)protected <TYPE> List<TYPE>getPermittedEntitiesOf(List<TYPE> entities)PersonServicegetPersonService()DategetPreviousLoginDate()com.atlassian.user.UsergetRemoteUser()Deprecated.since 5.2.MapgetSession()Deprecated.since 5.9.SystemInformationServicegetSystemInformationService()StringgetText(String key)StringgetText(String key, Object[] args)StringgetText(String key, String defaultValue)This can be used for internationalisation where a non-internationalised default string exists.StringgetText(String key, String[] args)StringgetText(String key, String defaultValue, String obj)StringgetText(String key, String defaultValue, String[] args)StringgetText(String key, String defaultValue, List list)StringgetText(String key, List list)static StringgetTextStatic(String key)Deprecated.since 8.0 no replacementstatic StringgetTextStatic(String key, Object[] list)Deprecated.since 8.0 no replacementStringgetTextStrict(String key)TimeZonegetTimeZone()UserAccessorgetUserAccessor()ConfluenceUsergetUserByName(String username)Returns user by name.StringgetUserFullName(String username)booleangetUserHasBrowseUsersPermission()Used by velocity to add to page meta data, indicating if the current user has browse users permission.booleangetUserHasLicensedAccess()Used by velocity to add to page meta data, indicating if the current user has licensed access to Confluence.protected UserInterfaceStategetUserInterfaceState()StringgetUserLocaleDefaultDatePattern()StringgetUserProfilePicUrl()Deprecated, for removal: This API element is subject to removal in a future version.since 5.10.WebInterfaceContextgetWebInterfaceContext()Returns a context which can be passed to web items when rendering them.com.atlassian.plugin.web.WebInterfaceManagergetWebInterfaceManager()protected booleanhasPermissionForSpace(List permissionTypes, Space space)booleanisAnonymousUser()booleanisCanceled()Has this action been cancelled? Used byCancellingInterceptorto determine if the action should be executed.booleanisDevMode()Returns true if the system property confluence.devmode is set and has the value "true".booleanisEmailVisible()booleanisExternalUserManagementEnabled()booleanisLabelable(Object object)booleanisPermitted()booleanisPrintableVersion()booleanisSkipAccessCheck()booleanisUserStatusPluginEnabled()Temporary method until we have plugin points to require i18n keys.booleanisUsingH2()Placing this method in ConfluenceActionSupport is a bit of a hack, but it is surprisingly difficult to have a generic piece of logic that can be used in decorators.booleanisUsingHSQL()Placing this method in ConfluenceActionSupport is a bit of a hack, but it is surprisingly difficult to have a generic piece of logic that can be used in decorators.voidsetAccessModeService(AccessModeService accessModeService)voidsetApiDateFormatService(DateFormatService dateFormatService)voidsetApiPersonService(PersonService personService)voidsetBootstrapManager(BootstrapManager bootstrapManager)voidsetCancel(String cancel)Set by the "cancel" button on forms.voidsetConfluenceAccessManager(ConfluenceAccessManager confluenceAccessManager)voidsetContentUiSupport(ContentUiSupport contentUiSupport)voidsetEventManager(com.atlassian.event.EventManager eventManager)voidsetFormatSettingsManager(FormatSettingsManager formatSettingsManager)voidsetI18NBean(I18NBean i18NBean)voidsetI18NBeanFactory(I18NBeanFactory i18NBeanFactory)voidsetLabelManager(LabelManager labelManager)voidsetLanguageManager(LanguageManager languageManager)voidsetLocaleManager(LocaleManager localeManager)voidsetLoginManager(LoginManager loginManager)voidsetMessageHolder(MessageHolder messageHolder)voidsetPermissionManager(PermissionManager permissionManager)voidsetPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)voidsetPreviousLoginDate(Date previousLoginDate)voidsetServletRequestSupplier(com.google.common.base.Supplier<javax.servlet.http.HttpServletRequest> servletRequestSupplier)Deprecated.since 7.0.1.voidsetSettingsManager(SettingsManager settingsManager)voidsetSkipAccessCheck(boolean skipAccessCheck)For use byConfluenceAccessInterceptorto indicate that access checking has already been performedvoidsetSpacePermissionManager(SpacePermissionManager spacePermissionManager)voidsetSystemInformationService(SystemInformationService systemInformationService)voidsetTimeZoneManager(com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager)voidsetUserAccessor(UserAccessor userAccessor)voidsetWebInterfaceManager(com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager)voidwithServletRequestSupplier(Supplier<javax.servlet.http.HttpServletRequest> servletRequestSupplier)-
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, execute, getActionErrors, getActionMessages, getContainer, getFieldErrors, getFormatted, getLocaleProvider, getText, getText, getTextProvider, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, validate
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.opensymphony.xwork2.LocaleProvider
isValidLocale, isValidLocaleString
-
Methods inherited from interface com.atlassian.confluence.validation.MessageHolderAware
validate
-
-
-
-
Field Detail
-
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 com.atlassian.event.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
-
messageHolder
protected MessageHolder messageHolder
-
webInterfaceManager
protected com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager
-
permitted
protected boolean permitted
-
accessModeService
protected AccessModeService accessModeService
-
personService
protected PersonService personService
-
pluginAccessor
protected com.atlassian.plugin.PluginAccessor pluginAccessor
-
-
Method Detail
-
setCancel
public void setCancel(String cancel)
Set by the "cancel" button on forms. This tells theCancellingInterceptorthat an action should not be executed, and should just return itsgetCancelResult()result.- Parameters:
cancel- Any non-null, non-empty string value.
-
isCanceled
public boolean isCanceled()
Has this action been cancelled? Used byCancellingInterceptorto determine if the action should be executed.- See Also:
setCancel(String)
-
getCancel
protected String getCancel()
get the value of the cancel parameter- Returns:
- the value of the cancel parameter if the action has been cancelled
-
doDefault
public String doDefault() throws Exception
Convenient Action execution method which defaults to returning INPUT- Throws:
Exception
-
getText
public String getText(String key)
- Specified by:
getTextin interfacecom.opensymphony.xwork2.TextProvider- Overrides:
getTextin classcom.opensymphony.xwork2.ActionSupport
-
getText
public String getText(String key, String defaultValue)
This can be used for internationalisation where a non-internationalised default string exists. If the key is null or returns a null value, then the default will be used instead.
Note the HtmlSafe annotation on this method. Ensure that you handle the defaultValue appropriately for display.
- Specified by:
getTextin interfacecom.opensymphony.xwork2.TextProvider- Overrides:
getTextin classcom.opensymphony.xwork2.ActionSupport
-
getText
public String getText(String key, String defaultValue, String obj)
- Specified by:
getTextin interfacecom.opensymphony.xwork2.TextProvider- Overrides:
getTextin classcom.opensymphony.xwork2.ActionSupport
-
getText
public String getText(String key, List list)
- Specified by:
getTextin interfacecom.opensymphony.xwork2.TextProvider- Overrides:
getTextin classcom.opensymphony.xwork2.ActionSupport
-
getText
public String getText(String key, String defaultValue, List list)
- Specified by:
getTextin interfacecom.opensymphony.xwork2.TextProvider- Overrides:
getTextin classcom.opensymphony.xwork2.ActionSupport
-
getText
public String getText(String key, String[] args)
- Specified by:
getTextin interfacecom.opensymphony.xwork2.TextProvider- Overrides:
getTextin classcom.opensymphony.xwork2.ActionSupport
-
getText
public String getText(String key, String defaultValue, String[] args)
- Specified by:
getTextin interfacecom.opensymphony.xwork2.TextProvider- Overrides:
getTextin classcom.opensymphony.xwork2.ActionSupport
-
getActionName
public String getActionName()
Returns the internationalised name of the current action.- Since:
- 3.1
-
isPrintableVersion
public boolean isPrintableVersion()
-
isPermitted
public boolean isPermitted()
-
setSkipAccessCheck
public final void setSkipAccessCheck(boolean skipAccessCheck)
For use byConfluenceAccessInterceptorto indicate that access checking has already been performed
-
isSkipAccessCheck
public boolean isSkipAccessCheck()
-
getRemoteUser
@Deprecated public com.atlassian.user.User getRemoteUser()
Deprecated.since 5.2. UsegetAuthenticatedUser()instead.
-
getAuthenticatedUser
public ConfluenceUser getAuthenticatedUser()
Return the user fromAuthenticatedUserThreadLocal.get(). This user is usually set byUserThreadLocalFilterfor request threads.- Returns:
- the remote user
- Since:
- 5.2
-
getUserByName
public ConfluenceUser getUserByName(String username)
Returns user by name. Lookups are cached.- Returns:
- user by name
- Since:
- 5.2
-
getUserProfilePicUrl
@Deprecated(since="5.10", forRemoval=true) public String getUserProfilePicUrl()
Deprecated, for removal: This API element is subject to removal in a future version.since 5.10. Use $userAvatarUriReference, which is provided in the velocity context bySitemeshContextItemProvider- Returns:
- the download path to the profile picture of the current user
-
addPermissionTypeTo
protected void addPermissionTypeTo(String permissionType, List<String> permissionTypes)
-
getPermittedEntitiesOf
protected <TYPE> List<TYPE> getPermittedEntitiesOf(Iterator<TYPE> entities, int maxCount, List<? extends PermissionManager.Criterion> criteria)
-
getPermittedEntitiesOf
protected <TYPE> List<TYPE> getPermittedEntitiesOf(Iterator<TYPE> entities, int maxCount)
-
setPreviousLoginDate
public void setPreviousLoginDate(Date previousLoginDate)
-
getPreviousLoginDate
public Date getPreviousLoginDate()
-
isExternalUserManagementEnabled
public boolean isExternalUserManagementEnabled()
-
setServletRequestSupplier
@Deprecated public void setServletRequestSupplier(com.google.common.base.Supplier<javax.servlet.http.HttpServletRequest> servletRequestSupplier)
Deprecated.since 7.0.1. UsewithServletRequestSupplier(java.util.function.Supplier)
-
withServletRequestSupplier
public void withServletRequestSupplier(Supplier<javax.servlet.http.HttpServletRequest> servletRequestSupplier)
- Since:
- 7.0.1
-
getCurrentRequest
protected javax.servlet.http.HttpServletRequest getCurrentRequest()
-
getCurrentSession
protected javax.servlet.http.HttpSession getCurrentSession()
-
addToHistory
protected void addToHistory(ContentEntityObject content)
-
getSession
@Deprecated public Map getSession()
Deprecated.since 5.9. This method is too tightly couple to the XWork API. No replacement
-
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
-
getFrontendServiceURL
public String getFrontendServiceURL()
Returns the URL of the Confluence Frontend microservice.- Returns:
- String
- Since:
- 5.10
-
getCancelResult
public String getCancelResult()
-
getNiceContentType
@Deprecated public String getNiceContentType(ContentEntityObject entityObject)
Deprecated.since 4.2 - use ContentUiSupport directly
-
getDefaultResourceBundle
public ResourceBundle getDefaultResourceBundle()
-
getGlobalSettings
public Settings getGlobalSettings()
-
isEmailVisible
public boolean isEmailVisible()
-
isLabelable
public boolean isLabelable(Object object)
-
getUserHasLicensedAccess
public final boolean getUserHasLicensedAccess()
Used by velocity to add to page meta data, indicating if the current user has licensed access to Confluence.
-
getUserHasBrowseUsersPermission
public final boolean getUserHasBrowseUsersPermission()
Used by velocity to add to page meta data, indicating if the current user has browse users permission.- Since:
- 6.13.0
-
getAccessMode
public final String getAccessMode()
Used by velocity to add to page meta data, indicating the current access mode
-
setSettingsManager
public void setSettingsManager(SettingsManager settingsManager)
-
getEventManager
public com.atlassian.event.EventManager getEventManager()
-
setEventManager
public void setEventManager(com.atlassian.event.EventManager eventManager)
-
setBootstrapManager
public void setBootstrapManager(BootstrapManager bootstrapManager)
-
getBootstrapManager
@Deprecated protected BootstrapManager getBootstrapManager()
Deprecated.since 7.20 and will be removed from 8.0. Use getBootstrapStatusProvider() instead of getBootstrapManager()
-
getBootstrapStatusProvider
public BootstrapStatusProvider getBootstrapStatusProvider()
-
setSpacePermissionManager
public void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
-
getPermissionManager
protected PermissionManager getPermissionManager()
-
setPermissionManager
public void setPermissionManager(PermissionManager permissionManager)
-
getWebInterfaceManager
public com.atlassian.plugin.web.WebInterfaceManager getWebInterfaceManager()
-
setWebInterfaceManager
public void setWebInterfaceManager(com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager)
-
setLabelManager
public void setLabelManager(LabelManager 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)
-
setLoginManager
public void setLoginManager(LoginManager loginManager)
-
getTextStatic
@Deprecated(since="8.0") public static String getTextStatic(String key)
Deprecated.since 8.0 no replacement
-
getTextStatic
@Deprecated(since="8.0") public static String getTextStatic(String key, Object[] list)
Deprecated.since 8.0 no replacement
-
getLocale
public Locale getLocale()
- Specified by:
getLocalein interfacecom.opensymphony.xwork2.LocaleProvider- Overrides:
getLocalein classcom.opensymphony.xwork2.ActionSupport
-
getLocaleString
public String getLocaleString()
-
getLanguageJs
public String getLanguageJs()
-
getUserLocaleDefaultDatePattern
public String getUserLocaleDefaultDatePattern()
-
setApiDateFormatService
public void setApiDateFormatService(DateFormatService dateFormatService)
-
getInstalledLanguages
public List<Language> getInstalledLanguages()
We MUST use the accessor here, otherwise languageManager may be null- See Also:
AbstractSetupAction
-
addFieldError
public void addFieldError(String fieldName, String textKey, Object[] args)
Adds an error to the current action which will be displayed next to the specified field. HTML-escapes any String arguments to avoid cross-site scripting problems with user input.- Parameters:
fieldName- field to apply error totextKey- key to internationalised textargs- args to be merged with text via standard MessageFormat rules
-
addActionError
public void addActionError(String textKey, Object... args)
Adds an error to the current action which will be displayed to the user. HTML-escapes any String arguments to avoid cross-site scripting problems with user input.- Parameters:
textKey- key to internationalised textargs- args to be merged with text via standard MessageFormat rules
-
addActionMessage
public void addActionMessage(String textKey, Object... args)
Adds a message to the current action which will be displayed to the user. HTML-escapes any String arguments to avoid cross-site scripting problems with user input.- Parameters:
textKey- key to internationalised textargs- args to be merged with text via standard MessageFormat rules
-
getI18n
public I18NBean getI18n()
-
getDocLink
public String getDocLink(String page)
Creates a version specific documentation link for the provided page. This method exists because some error messages include links. Otherwise use $docBean which is available on the velocity context.- Parameters:
page- the page to link to (just the title)- Returns:
- version specific documentation link.
-
getSystemInformationService
public SystemInformationService getSystemInformationService()
-
setSystemInformationService
public void setSystemInformationService(SystemInformationService systemInformationService)
-
setLocaleManager
public void setLocaleManager(LocaleManager localeManager)
-
getLocaleManager
public LocaleManager getLocaleManager()
-
setI18NBeanFactory
public void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
-
setMessageHolder
public void setMessageHolder(MessageHolder messageHolder)
- Specified by:
setMessageHolderin interfaceMessageHolderAware
-
getMessageHolder
public MessageHolder getMessageHolder()
- Specified by:
getMessageHolderin interfaceMessageHolderAware
-
getTimeZone
public TimeZone getTimeZone()
-
getDefaultTimeZone
public TimeZone getDefaultTimeZone()
-
getDateFormatter
public DateFormatter getDateFormatter()
-
getFriendlyDateFormatter
public FriendlyDateFormatter getFriendlyDateFormatter()
-
getDateFormatSetting
public String getDateFormatSetting()
-
setFormatSettingsManager
public void setFormatSettingsManager(FormatSettingsManager formatSettingsManager)
-
isUsingHSQL
public boolean isUsingHSQL()
Placing this method in ConfluenceActionSupport is a bit of a hack, but it is surprisingly difficult to have a generic piece of logic that can be used in decorators.- Returns:
- true if Confluence is currently using a Hypersonic database
-
isUsingH2
public boolean isUsingH2()
Placing this method in ConfluenceActionSupport is a bit of a hack, but it is surprisingly difficult to have a generic piece of logic that can be used in decorators.- Returns:
- true if Confluence is currently using an H2 database
-
setI18NBean
public void setI18NBean(I18NBean i18NBean)
-
getWebInterfaceContext
public WebInterfaceContext getWebInterfaceContext()
Description copied from interface:WebInterfaceReturns a context which can be passed to web items when rendering them.Typically, Struts actions will implement this to provide extra details in the context such as content objects, and so on.
- Specified by:
getWebInterfaceContextin interfaceWebInterface
-
isUserStatusPluginEnabled
public boolean isUserStatusPluginEnabled()
Temporary method until we have plugin points to require i18n keys. CONF-15428- Returns:
- true if "user status" is enabled.
-
setPluginAccessor
public void setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)
-
setContentUiSupport
public void setContentUiSupport(ContentUiSupport contentUiSupport)
-
setTimeZoneManager
public void setTimeZoneManager(com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager)
-
setConfluenceAccessManager
public void setConfluenceAccessManager(ConfluenceAccessManager confluenceAccessManager)
-
getConfluenceAccessManager
public ConfluenceAccessManager getConfluenceAccessManager()
-
setAccessModeService
public void setAccessModeService(AccessModeService accessModeService)
-
getPersonService
public PersonService getPersonService()
-
setApiPersonService
public void setApiPersonService(PersonService personService)
-
-