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
      • getText

        public String getText​(String key)
        Specified by:
        getText in interface com.opensymphony.xwork2.TextProvider
        Overrides:
        getText in class com.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:
        getText in interface com.opensymphony.xwork2.TextProvider
        Overrides:
        getText in class com.opensymphony.xwork2.ActionSupport
      • getText

        public String getText​(String key,
                              String defaultValue,
                              String obj)
        Specified by:
        getText in interface com.opensymphony.xwork2.TextProvider
        Overrides:
        getText in class com.opensymphony.xwork2.ActionSupport
      • getText

        public String getText​(String key,
                              List list)
        Specified by:
        getText in interface com.opensymphony.xwork2.TextProvider
        Overrides:
        getText in class com.opensymphony.xwork2.ActionSupport
      • getText

        public String getText​(String key,
                              String defaultValue,
                              List list)
        Specified by:
        getText in interface com.opensymphony.xwork2.TextProvider
        Overrides:
        getText in class com.opensymphony.xwork2.ActionSupport
      • getText

        public String getText​(String key,
                              String[] args)
        Specified by:
        getText in interface com.opensymphony.xwork2.TextProvider
        Overrides:
        getText in class com.opensymphony.xwork2.ActionSupport
      • getText

        public String getText​(String key,
                              String defaultValue,
                              String[] args)
        Specified by:
        getText in interface com.opensymphony.xwork2.TextProvider
        Overrides:
        getText in class com.opensymphony.xwork2.ActionSupport
      • getActionName

        public String getActionName​(String fullClassName)
      • getActionName

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

        public String getTextStrict​(String key)
      • isPrintableVersion

        public boolean isPrintableVersion()
      • isPermitted

        public boolean isPermitted()
      • getPermissionTypes

        protected List<String> getPermissionTypes()
      • setSkipAccessCheck

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

        public boolean isSkipAccessCheck()
      • 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

        public String getUserProfilePicUrl()
        Deprecated.
        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()
      • 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()
      • getSession

        @Deprecated
        public Map getSession()
        Deprecated.
        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()
      • 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)
      • hasPermissionForSpace

        protected boolean hasPermissionForSpace​(List permissionTypes,
                                                Space space)
      • 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()
      • setSpacePermissionManager

        public void setSpacePermissionManager​(SpacePermissionManager spacePermissionManager)
      • 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)
      • setLanguageManager

        public void setLanguageManager​(LanguageManager languageManager)
      • 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

        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.
      • 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

        public String formatFriendlyDate​(Date date)
      • 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)
      • setApiContentUiSupport

        public void setApiContentUiSupport​(ApiContentUiSupport apiContentUiSupport)
      • setTimeZoneManager

        public void setTimeZoneManager​(com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager)
      • setConfluenceAccessManager

        public void setConfluenceAccessManager​(ConfluenceAccessManager confluenceAccessManager)
      • setAccessModeService

        public void setAccessModeService​(AccessModeService accessModeService)
      • setApiPersonService

        public void setApiPersonService​(PersonService personService)