Class BaseAction

java.lang.Object
com.opensymphony.xwork2.ActionSupport
com.atlassian.crowd.console.action.BaseAction
All Implemented Interfaces:
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:
AbstractBrowser, AbstractViewDirectory, AddGroup, ApplicationBaseAction, BaseProgressStepAction, BaseSetupAction, BaseUserAction, BrowseAuditLog, BrowseDirectories, BrowseWithDirectoryId, ChangeExpiredPassword, Console, CreateDirectory, DefaultStartPage, EnableClustering, EndpointTestAction, ErrorAction, GroupAction, GroupLevelAdminGroupsAction, License, Panel, RemoveDirectory, RemoveGroup, RemovePrincipal, Restore, SAMLAuthAction, SystemInfo, TestkitStrutsInfoAction, UpdateConnectionPool, UpdateConnectorConfiguration, UpdateCustomAttributes, UpdateGeneral, UpdateInternalConfiguration, UpdateLicensing, UpdateLoggingProfiling, UpdateMailServer, UpdateMailTemplate, UpdateOptions, UpdatePermissions, UpdateRemoteCrowdConnection, UpdateSAMLConfiguration, UpdateSessionConfig, UpdateSpringLdapPoolConfiguration, UpdateTrustedProxies, ViewPicker, ViewPrincipal, ViewTrustedProxies

public class BaseAction extends com.opensymphony.xwork2.ActionSupport
See Also:
  • Field Details

  • Constructor Details

    • BaseAction

      public BaseAction()
  • Method Details

    • execute

      public String execute() throws Exception
      Specified by:
      execute in interface com.opensymphony.xwork2.Action
      Overrides:
      execute in class com.opensymphony.xwork2.ActionSupport
      Throws:
      Exception
    • applyFieldError

      public void applyFieldError(ValidationError error)
    • applyValidationErrors

      public void applyValidationErrors(Collection<ValidationError> errors)
    • isAuthenticated

      public boolean isAuthenticated()
    • isSysAdmin

      public boolean isSysAdmin()
    • isGroupAdmin

      public boolean isGroupAdmin()
    • getSitemeshPageProperties

      public Map<String,String> getSitemeshPageProperties()
    • getUserName

      public String getUserName() throws InvalidUserException
      Returns:
      username of the current logged in user, or null if the user is not authenticated
      Throws:
      InvalidUserException
    • getRemoteUser

      public User getRemoteUser()
    • getSession

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

      protected javax.servlet.http.HttpServletRequest getHttpRequest()
    • getTab

      public Integer getTab()
    • setTab

      public void setTab(Integer tab)
    • isInitialLoad

      public boolean isInitialLoad()
    • getLicense

      public com.atlassian.extras.api.crowd.CrowdLicense getLicense()
    • isEvaluation

      public boolean isEvaluation()
    • isLicenseForged

      public boolean isLicenseForged()
    • isRestartRequiredToEnableClustering

      public boolean isRestartRequiredToEnableClustering()
    • isSubscription

      public boolean isSubscription()
      Returns:
      true if the license is a subscription license, false otherwise.
    • isWithinGracePeriod

      public boolean isWithinGracePeriod()
      Returns:
      true if the license
    • isLicenseExpired

      public boolean isLicenseExpired()
    • getActionMessageAlertColor

      public String getActionMessageAlertColor()
      Gets the action message color dressing to use with the decorator.
      Returns:
      The window dressing color to use.
    • addActionMessage

      public void addActionMessage(String color, String message)
      Sets a UI message and the color type for the user.
      Parameters:
      color - The color to use.
      message - The message to display.
    • getWebItemsForSection

      public List<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor> getWebItemsForSection(String sectionName)
    • getWebSectionsForLocation

      public List<com.atlassian.plugin.web.descriptors.WebSectionModuleDescriptor> getWebSectionsForLocation(String location)
    • renderFreemarkerTemplate

      public String renderFreemarkerTemplate(String templateString)
    • getWebFragmentsContextMap

      public Map<String,Object> getWebFragmentsContextMap()
    • getDisplayableLink

      public String getDisplayableLink(com.atlassian.plugin.web.model.WebLink link)
    • getLink

      public String getLink(com.atlassian.plugin.web.model.WebLink link)
    • getLabel

      public String getLabel(com.atlassian.plugin.web.model.WebLabel label)
    • directory

      public Directory directory(long directoryID)
    • addActionError

      protected void addActionError(Throwable t)
    • containsErrorMessages

      public boolean containsErrorMessages()
    • containsActionMessages

      public boolean containsActionMessages()
    • setPropertyManager

      public void setPropertyManager(PropertyManager propertyManager)
    • setDirectoryManager

      public void setDirectoryManager(DirectoryManager directoryManager)
    • setCrowdLicenseManager

      public void setCrowdLicenseManager(CrowdLicenseManager crowdLicenseManager)
    • setApplicationManager

      public void setApplicationManager(ApplicationManager applicationManager)
    • setWebInterfaceManager

      public void setWebInterfaceManager(com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager)
    • getWebInterfaceManager

      public com.atlassian.plugin.web.WebInterfaceManager getWebInterfaceManager()
    • getWebResourceManager

      public com.atlassian.webresource.api.WebResourceManager getWebResourceManager()
    • setWebResourceManager

      public void setWebResourceManager(com.atlassian.webresource.api.WebResourceManager webResourceManager)
    • getBootstrapManager

      protected CrowdBootstrapManager getBootstrapManager()
    • isAtResourceLimit

      public boolean isAtResourceLimit()
    • getCurrentLicenseResourceTotal

      public Integer getCurrentLicenseResourceTotal()
    • getImageTitle

      public String getImageTitle(boolean active, ApplicationType applicationType)
    • getImageLocation

      public String getImageLocation(boolean active, ApplicationType applicationType)
    • authorisedToAccessCrowdConsole

      protected boolean authorisedToAccessCrowdConsole(Long directoryId, String name) throws DirectoryNotFoundException, UserNotFoundException
      Throws:
      DirectoryNotFoundException
      UserNotFoundException
    • authorisedToAccessCrowdAdminConsole

      public boolean authorisedToAccessCrowdAdminConsole(DirectoryMapping directoryMapping, Long directoryId, String username) throws DirectoryNotFoundException, UserNotFoundException
      Throws:
      DirectoryNotFoundException
      UserNotFoundException
    • getText

      public String getText(String i18nKey, List args, boolean encode)
    • getXsrfTokenName

      public String getXsrfTokenName()
    • getXsrfToken

      public String getXsrfToken()
    • getText

      public String getText(String i18nKey, List args)
      Specified by:
      getText in interface com.opensymphony.xwork2.TextProvider
      Overrides:
      getText in class com.opensymphony.xwork2.ActionSupport
    • setApplicationService

      public void setApplicationService(ApplicationService applicationService)
    • setTokenAuthenticationManager

      public void setTokenAuthenticationManager(TokenAuthenticationManager tokenAuthenticationManager)
    • setRememberMeService

      public void setRememberMeService(CrowdRememberMeService rememberMeService)
    • setClientProperties

      public void setClientProperties(ClientProperties clientProperties)
    • setXsrfTokenGenerator

      public void setXsrfTokenGenerator(XsrfTokenGenerator xsrfTokenGenerator)
    • getPasswordComplexityMessage

      @Nullable protected String getPasswordComplexityMessage(long directoryId)
      Returns:
      the password complexity message for the specified directory, or null if there is none
    • getCrowdApplication

      protected Application getCrowdApplication() throws ApplicationNotFoundException
      Throws:
      ApplicationNotFoundException
    • setCrowdApplication

      public void setCrowdApplication(Application crowdApplication)
    • setActionHelper

      public void setActionHelper(ActionHelper actionHelper)
    • resolveAvatarUri

      protected String resolveAvatarUri(URI uri)
      Resolve a URI against a base of Crowd's context path to get a suitable URI for placing into a page. For example, "path/avatar" would become "/crowd/path/avatar", and any absolute URL would be returned as-is.
    • findAvatarUrl

      @Nonnull protected Optional<String> findAvatarUrl(User user, int sizeHint)
    • getSmallAvatarUrl

      public String getSmallAvatarUrl()
    • applyFieldErrors

      public void applyFieldErrors(Collection<FieldError> errors)
    • setClusterService

      public void setClusterService(ClusterService clusterService)
    • getTextProvider

      protected com.opensymphony.xwork2.TextProvider getTextProvider()
      Overrides:
      getTextProvider in class com.opensymphony.xwork2.ActionSupport
    • getLocaleProvider

      protected com.opensymphony.xwork2.LocaleProvider getLocaleProvider()
      Overrides:
      getLocaleProvider in class com.opensymphony.xwork2.ActionSupport
    • isDataCenterLicense

      public boolean isDataCenterLicense()
    • bindInformationAboutLicense

      protected void bindInformationAboutLicense()