Class ConfluenceActionSupport

java.lang.Object
com.opensymphony.xwork2.ActionSupport
com.atlassian.confluence.core.AbstractI18nActionSupport
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, 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, AuthenticateAction, AutocompleteLabelsAction, BreadcrumbAction, BrowseCommentsAction, BrowseMacrosAction, BrowseShortcutsAction, BrowseUnsyncedUsersAction, ChangeCronJobScheduleAction, ChangeSimpleJobScheduleAction, ColorsStylesheetAction, ConfigureCaptchaAction, ConfigureLanguageAction, ConfigureLoggingAction, ConfigureMobileAppsAction, ConfigureMonitoringAction, ConfigureRssFeedAction, ConfirmEmailAction, ContentNameSearchAction, ContentRemigrationAction, CreateRssFeedAction, CustomHtmlAction, CustomStylesheetAction, DashboardAction, DecoratorAction, DraftAttachmentSearchAction, DropAuthenticationAction, EditSiteLogoAction, EditStylesheetAction, EncodingTestAction, FindRestrictableEntitiesAction, FlushCacheAction, FlushIndexQueueAction, FollowUserAction, ForceUpgradeAction, ForgotUserPasswordAction, FourOhFiveAction, FourOhFourAction, GeneralConfigurationAction, GetFutureSchedulesAction, GlobalRssFeedAction, HeartbeatAction, HelpLinkAction, HistoryAction, HomepageAction, IndexAction, LikeAction, ListNewOrUpdatedPagesAction, ListWatchersAction, LogoutAction, LongRunningTaskMonitorAction, MacroDetailsAction, MailServerTestConnectionAction, MaintenanceConfigurationAction, ManageAdminTaskAction, MarkAllLogsAction, NetworkFeedAction, NoRequireAnnotationAction, NotificationsAction, OpenSearchDescriptorAction, PageDestinationSearchAction, PageNotFoundAction, PageNotificationAction, PageNotPermittedAction, PeopleDirectoryAction, PluginOsgiExportsAction, ReadOnlyAccessAction, RebuildAncestorTableAction, RefreshLicensingAction, ReindexTaskProgressAction, RemoveFavouriteAction, RemoveLabelAction, RemoveLabelAjaxAction, RemoveMailServerAction, RemoveSpaceFromFavouriteAjaxAction, RequireGetMethodAction, RequirePostMethodAction, ResetUserPasswordAction, ResumeDraftAction, SearchIndexesAction, SearchSiteAction, SecurityConfigurationAction, SendTestEmailAction, SiteDarkFeaturesAction, SiteSupportAction, SpacesConfigurationAction, StaticRenderingAction, ThemeColorsStylesheetAction, TinyUrlAction, UnFollowUserAction, UserMacroAction, UserPopupAction, ValidateLabelAjaxAction, VelocityResultAction, ViewIndexQueueAction, ViewMailQueueAction, ViewMailServersAction, ViewSourceAction, ViewSpaceDirectoryAction, ViewSystemClasspathAction, ViewSystemInfoAction, ViewUserHistoryAction, WysiwygConverterAction, XsrfTokenExpiredAction

public class ConfluenceActionSupport extends AbstractI18nActionSupport implements com.opensymphony.xwork2.LocaleProvider, WebInterface, MessageHolderAware
Base class for all Confluence Struts actions.
See Also:
  • Field Details

  • Constructor Details

    • ConfluenceActionSupport

      public ConfluenceActionSupport()
  • Method Details

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

      public boolean isPermitted()
    • getPermissionTypes

      protected List<String> getPermissionTypes()
      See Also:
    • setSkipIsPermitted

      @Deprecated(since="9.0", forRemoval=true) public final void setSkipIsPermitted(boolean shouldSkipIsPermitted)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 9.0. Use Atlassian annotations instead. See: Preparing for secure endpoints for details.
      Invoked by ConfluenceAccessInterceptor to indicate that access checking has already been performed to PermissionCheckInterceptor.
    • shouldSkipIsPermitted

      @Deprecated(since="9.0", forRemoval=true) public boolean shouldSkipIsPermitted()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 9.0. Use Atlassian annotations instead. See: Preparing for secure endpoints for details.
    • getAuthenticatedUser

      protected ConfluenceUser getAuthenticatedUser()
      Return the user from AuthenticatedUserThreadLocal.get(). This user is usually set by UserThreadLocalFilter for 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
    • 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, 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()
    • getCurrentRequest

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

      protected javax.servlet.http.HttpServletResponse getCurrentResponse()
    • addToHistory

      protected void addToHistory(ContentEntityObject content)
    • getUserInterfaceState

      protected UserInterfaceState getUserInterfaceState()
    • isAnonymousUser

      public boolean isAnonymousUser()
    • getCancelResult

      public String getCancelResult()
    • getGlobalSettings

      protected Settings getGlobalSettings()
    • isEmailVisible

      public boolean isEmailVisible()
    • setSettingsManager

      public void setSettingsManager(GlobalSettingsManager settingsManager)
    • setEventPublisher

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

      public void setBootstrapStatusProvider(BootstrapStatusProvider bootstrapStatusProvider)
      Since:
      8.7
    • getBootstrapStatusProvider

      protected BootstrapStatusProvider getBootstrapStatusProvider()
    • setSpacePermissionManager

      public void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
    • setPermissionManager

      public void setPermissionManager(PermissionManager permissionManager)
    • setWebInterfaceManager

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

      public void setLabelManager(LabelManager labelManager)
    • setLanguageManager

      public void setLanguageManager(LanguageManager languageManager)
    • getHelper

      public ThemeHelper getHelper()
    • 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
    • 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
    • getI18n

      public I18NBean getI18n()
    • setSystemInformationService

      public void setSystemInformationService(SystemInformationService systemInformationService)
    • setLocaleManager

      public void setLocaleManager(LocaleManager localeManager)
    • setI18NBeanFactory

      public void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
    • setMessageHolder

      public void setMessageHolder(MessageHolder messageHolder)
      Specified by:
      setMessageHolder in interface MessageHolderAware
    • getMessageHolder

      public MessageHolder getMessageHolder()
      Specified by:
      getMessageHolder in interface MessageHolderAware
    • getActionErrors

      public Collection<String> getActionErrors()
      Specified by:
      getActionErrors in interface com.opensymphony.xwork2.interceptor.ValidationAware
      Overrides:
      getActionErrors in class com.opensymphony.xwork2.ActionSupport
    • getActionMessages

      public Collection<String> getActionMessages()
      Specified by:
      getActionMessages in interface com.opensymphony.xwork2.interceptor.ValidationAware
      Overrides:
      getActionMessages in class com.opensymphony.xwork2.ActionSupport
    • getFieldErrors

      public Map<String,List<String>> getFieldErrors()
      Specified by:
      getFieldErrors in interface com.opensymphony.xwork2.interceptor.ValidationAware
      Overrides:
      getFieldErrors in class com.opensymphony.xwork2.ActionSupport
    • getTimeZone

      public TimeZone getTimeZone()
    • getDefaultTimeZone

      protected TimeZone getDefaultTimeZone()
    • getDateFormatter

      public DateFormatter getDateFormatter()
    • setFormatSettingsManager

      public void setFormatSettingsManager(FormatSettingsManager formatSettingsManager)
    • 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
    • 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)
      Since:
      6.8.0