Class ConfluenceActionSupport

    • Constructor Detail

      • ConfluenceActionSupport

        public ConfluenceActionSupport()
    • Method Detail

      • setCancel

        public void setCancel​(String cancel)
        Set by the "cancel" button on forms. This tells the CancellingInterceptor that an action should not be executed, and should just return its getCancelResult() result.
        Parameters:
        cancel - Any non-null, non-empty string value.
      • 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
      • getActionName

        public String getActionName()
        Returns the internationalised name of the current action.
        Since:
        3.1
      • isPrintableVersion

        public boolean isPrintableVersion()
      • isPermitted

        public boolean isPermitted()
      • getPermissionTypes

        protected List<String> getPermissionTypes()
      • useSkipAccessCheck

        public final void useSkipAccessCheck​(boolean skipAccessCheck)
        For use by ConfluenceAccessInterceptor to indicate that access checking has already been performed.

        Do NOT under any circumstance use setter notation for this public method as doing so will make it parameter injectable.

      • isSkipAccessCheck

        public boolean isSkipAccessCheck()
      • getRemoteUser

        @Deprecated(forRemoval=true)
        public com.atlassian.user.User getRemoteUser()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 5.2. Use getAuthenticatedUser() instead.
      • getUserByName

        public ConfluenceUser getUserByName​(String username)
        Returns user by name. Lookups are cached.
        Returns:
        user by name
        Since:
        5.2
      • getUserFullName

        public String getUserFullName​(String username)
      • 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 by SitemeshContextItemProvider
        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​(List<TYPE> entities)
      • 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(forRemoval=true)
        public void setServletRequestSupplier​(com.google.common.base.Supplier<javax.servlet.http.HttpServletRequest> servletRequestSupplier)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • withServletRequestSupplier

        @Deprecated(forRemoval=true)
        public void withServletRequestSupplier​(Supplier<javax.servlet.http.HttpServletRequest> servletRequestSupplier)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.9.0. Use ActionContext.bind() for testing.
        Since:
        7.0.1
      • getCurrentRequest

        protected javax.servlet.http.HttpServletRequest getCurrentRequest()
      • getCurrentSession

        protected javax.servlet.http.HttpSession getCurrentSession()
      • getSession

        @Deprecated(forRemoval=true)
        public Map getSession()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 5.9. This method is too tightly couple to the XWork API. No replacement
      • 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(forRemoval=true)
        public String getNiceContentType​(ContentEntityObject entityObject)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 4.2 - use ContentUiSupport directly
      • getDefaultResourceBundle

        public ResourceBundle getDefaultResourceBundle()
      • getGlobalSettings

        public Settings getGlobalSettings()
      • isEmailVisible

        public boolean isEmailVisible()
      • isLabelable

        @Deprecated(forRemoval=true)
        public boolean isLabelable​(Object object)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.9.0, no replacement.
      • 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)
      • hasPermissionForSpace

        protected boolean hasPermissionForSpace​(List permissionTypes,
                                                Space space)
      • getEventManager

        @Deprecated(forRemoval=true)
        public com.atlassian.event.EventManager getEventManager()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.9
      • setEventPublisher

        public void setEventPublisher​(com.atlassian.event.api.EventPublisher eventPublisher)
        Since:
        8.9
      • setBootstrapStatusProvider

        public void setBootstrapStatusProvider​(BootstrapStatusProvider bootstrapStatusProvider)
        Since:
        8.7
      • setSpacePermissionManager

        public void setSpacePermissionManager​(SpacePermissionManager spacePermissionManager)
      • setPermissionManager

        public void setPermissionManager​(PermissionManager permissionManager)
      • getWebInterfaceManager

        @Deprecated(forRemoval=true)
        public com.atlassian.plugin.web.api.DynamicWebInterfaceManager getWebInterfaceManager()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.5.5, use the webInterfaceManager protected field directly when extending this class.
        Do not provide public getters for beans that allow mutation. Such beans can be accessed from Velocity templates.
      • setWebInterfaceManager

        public void setWebInterfaceManager​(com.atlassian.plugin.web.api.DynamicWebInterfaceManager webInterfaceManager)
      • setLabelManager

        public void setLabelManager​(LabelManager labelManager)
      • setLanguageManager

        public void setLanguageManager​(LanguageManager languageManager)
      • getUserAccessor

        @Deprecated(forRemoval=true)
        protected UserAccessor getUserAccessor()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.8.0, use the userAccessor protected field directly when extending this class.
        Do not provide public getters for beans that allow mutation. Such beans can be accessed from Velocity templates.
      • setUserAccessor

        public void setUserAccessor​(UserAccessor userAccessor)
      • setLoginManager

        public void setLoginManager​(LoginManager loginManager)
      • getLocale

        public Locale getLocale()
        Specified by:
        getLocale in interface com.opensymphony.xwork2.LocaleProvider
        Overrides:
        getLocale in class com.opensymphony.xwork2.ActionSupport
      • getLocaleString

        public String getLocaleString()
      • getLanguageUserFriendly

        public String getLanguageUserFriendly​(String locale)
      • 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 to
        textKey - key to internationalised text
        args - 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 text
        args - 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 text
        args - args to be merged with text via standard MessageFormat rules
      • getDocLink

        @Deprecated(forRemoval=true)
        public String getDocLink​(String page)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.9.0, use $docBean.getLink(String) in Velocity or implement directly in necessary actions.
        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

        @Deprecated(forRemoval=true)
        protected SystemInformationService getSystemInformationService()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.5.5, use the systemInformationService protected field directly when extending this class.
        Do not provide public getters for beans that allow mutation. Such beans can be accessed from Velocity templates.
      • setSystemInformationService

        public void setSystemInformationService​(SystemInformationService systemInformationService)
      • setLocaleManager

        public void setLocaleManager​(LocaleManager localeManager)
      • setI18NBeanFactory

        public void setI18NBeanFactory​(I18NBeanFactory i18NBeanFactory)
      • getTimeZone

        public TimeZone getTimeZone()
      • getDefaultTimeZone

        public TimeZone getDefaultTimeZone()
      • getDateFormatSetting

        public String getDateFormatSetting()
      • formatFriendlyDate

        @Deprecated(forRemoval=true)
        public String formatFriendlyDate​(Date date)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.9.0, implement directly in necessary actions.
      • 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: WebInterface
        Returns 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:
        getWebInterfaceContext in interface WebInterface
      • 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)
      • setAccessModeService

        public void setAccessModeService​(AccessModeService accessModeService)
      • getPersonService

        @Deprecated(forRemoval=true)
        protected PersonService getPersonService()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.8.0, implement directly in necessary actions.
        Do not provide public getters for beans that allow mutation. Such beans can be accessed from Velocity templates.
      • setApiPersonService

        @Deprecated(forRemoval=true)
        public void setApiPersonService​(PersonService personService)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.9.0, implement directly in necessary actions.
      • getContentUiSupport

        @Deprecated(forRemoval=true)
        public ContentUiSupport getContentUiSupport()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.9.0, already available on global Velocity context.
      • getDocBean

        @Deprecated(forRemoval=true)
        public DocumentationBean getDocBean()
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 8.9.0, already available on global Velocity context.