Class BaseAction
java.lang.Object
org.apache.struts2.ActionSupport
com.atlassian.crowd.console.action.BaseAction
- All Implemented Interfaces:
Serializable,org.apache.struts2.action.Action,org.apache.struts2.interceptor.ValidationAware,org.apache.struts2.locale.LocaleProvider,org.apache.struts2.text.TextProvider,org.apache.struts2.Validateable
- Direct Known Subclasses:
AbstractBrowser,AbstractLoginDataConsumingAction,AbstractViewDirectory,AddGroup,ApplicationBaseAction,BaseProgressStepAction,BaseSetupAction,BaseUserAction,BrowseAuditLog,BrowseDirectories,BrowseWithDirectoryId,ChangeExpiredPassword,Console,CreateDirectory,DefaultStartPage,EnableClustering,EndpointTestAction,ErrorAction,GroupAction,GroupLevelAdminGroupsAction,License,LogoutPage,Panel,RemoveDirectory,RemoveGroup,RemovePrincipal,Restore,SAMLAuthAction,SystemInfo,TestkitStrutsInfoAction,UpdateConnectionPool,UpdateConnectorConfiguration,UpdateCustomAttributes,UpdateGeneral,UpdateInternalConfiguration,UpdateLicensing,UpdateLoggingProfiling,UpdateMailServer,UpdateMailTemplate,UpdateOptions,UpdatePermissions,UpdateRemoteCrowdConnection,UpdateSAMLConfiguration,UpdateSessionConfig,UpdateSpringLdapPoolConfiguration,UpdateTrustedProxies,ViewAbout,ViewPicker,ViewPrincipal,ViewTrustedProxies
public class BaseAction
extends org.apache.struts2.ActionSupport
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActionHelperprotected StringWebwork action messages color settings.static final Stringstatic final Stringstatic final Stringstatic final Stringprotected ApplicationManagerprotected ApplicationServicestatic final StringProperty key for the authentication plugin configurationsstatic final StringProperty derived from the Authentication Plugin to determine if basic auth has been enabled or not.protected ClientPropertiesprotected ClusterServiceprotected CrowdLicenseManagerprotected DirectoryManagerprotected booleanprotected static final org.slf4j.Loggerprotected PluginPropertyManagerprotected PropertyManagerprotected CrowdRememberMeServiceprotected static final intprotected Integerprotected TokenAuthenticationManagerFields inherited from class org.apache.struts2.ActionSupport
containerFields inherited from interface org.apache.struts2.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidaddActionMessage(String color, String message) Sets a UI message and the color type for the user.voidapplyFieldError(ValidationError error) voidapplyFieldErrors(Collection<FieldError> errors) voidbooleanauthorisedToAccessCrowdAdminConsole(DirectoryMapping directoryMapping, Long directoryId, String username) protected booleanauthorisedToAccessCrowdConsole(Long directoryId, String name) protected voidbooleanbooleandirectory(long directoryID) execute()findAvatarUrl(User user, int sizeHint) Gets the action message color dressing to use with the decorator.protected CrowdBootstrapManagerprotected ApplicationgetDisplayableLink(com.atlassian.plugin.web.model.WebLink link) protected jakarta.servlet.http.HttpServletRequestgetImageLocation(boolean active, ApplicationType applicationType) getImageTitle(boolean active, ApplicationType applicationType) getLabel(com.atlassian.plugin.web.model.WebLabel label) com.atlassian.extras.api.crowd.CrowdLicensegetLink(com.atlassian.plugin.web.model.WebLink link) protected org.apache.struts2.locale.LocaleProviderprotected StringgetPasswordComplexityMessage(long directoryId) protected jakarta.servlet.http.HttpSessiongetTab()protected org.apache.struts2.text.TextProvidercom.atlassian.plugin.web.WebInterfaceManagerList<com.atlassian.plugin.web.descriptors.WebItemModuleDescriptor> getWebItemsForSection(String sectionName) com.atlassian.webresource.api.WebResourceManagerList<com.atlassian.plugin.web.descriptors.WebSectionModuleDescriptor> getWebSectionsForLocation(String location) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanrenderFreemarkerTemplate(String templateString) protected StringresolveAvatarUri(URI uri) Resolve a URI against a base of Crowd's context path to get a suitable URI for placing into a page.voidsetActionHelper(ActionHelper actionHelper) voidsetApplicationManager(ApplicationManager applicationManager) voidsetApplicationService(ApplicationService applicationService) voidsetClientProperties(ClientProperties clientProperties) voidsetClusterService(ClusterService clusterService) voidsetCrowdApplication(Application crowdApplication) voidsetCrowdLicenseManager(CrowdLicenseManager crowdLicenseManager) voidsetDirectoryManager(DirectoryManager directoryManager) voidsetPluginPropertyManager(PluginPropertyManager pluginPropertyManager) voidsetPropertyManager(PropertyManager propertyManager) voidsetRememberMeService(CrowdRememberMeService rememberMeService) voidvoidsetTokenAuthenticationManager(TokenAuthenticationManager tokenAuthenticationManager) voidsetWebInterfaceManager(com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager) voidsetWebResourceManager(com.atlassian.webresource.api.WebResourceManager webResourceManager) voidsetXsrfTokenGenerator(XsrfTokenGenerator xsrfTokenGenerator) Methods inherited from class org.apache.struts2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, getActionErrors, getActionMessages, getContainer, getFieldErrors, getFormatted, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, toLocale, validate
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
tab
-
initialLoad
protected boolean initialLoad -
actionMessageAlertColor
Webwork action messages color settings. Displays the type of message dressing to use. -
ALERT_GREEN
- See Also:
-
ALERT_YELLOW
- See Also:
-
ALERT_RED
- See Also:
-
ALERT_BLUE
- See Also:
-
BASIC_AUTH_SYS_PROP_DISABLED
Property derived from the Authentication Plugin to determine if basic auth has been enabled or not. Returns true if disabled, false if enabled.- Since:
- 7.0.0
- See Also:
-
BASIC_AUTH_PLUGIN_KEY
Property key for the authentication plugin configurations- Since:
- 7.0.0
- See Also:
-
SMALL_AVATAR_SIZE
protected static final int SMALL_AVATAR_SIZE- See Also:
-
propertyManager
-
directoryManager
-
applicationManager
-
crowdLicenseManager
-
applicationService
-
tokenAuthenticationManager
-
rememberMeService
-
clientProperties
-
actionHelper
-
clusterService
-
pluginPropertyManager
-
smallAvatarUrl
-
-
Constructor Details
-
BaseAction
public BaseAction()
-
-
Method Details
-
execute
- Specified by:
executein interfaceorg.apache.struts2.action.Action- Overrides:
executein classorg.apache.struts2.ActionSupport- Throws:
Exception
-
applyFieldError
-
applyValidationErrors
-
isAuthenticated
public boolean isAuthenticated() -
isSysAdmin
public boolean isSysAdmin() -
isGroupAdmin
public boolean isGroupAdmin() -
getSitemeshPageProperties
-
getUserName
- Returns:
- username of the current logged in user, or
nullif the user is not authenticated - Throws:
InvalidUserException
-
getPrincipalName
-
getRemoteUser
-
getSession
protected jakarta.servlet.http.HttpSession getSession() -
getHttpRequest
protected jakarta.servlet.http.HttpServletRequest getHttpRequest() -
getTab
-
setTab
-
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:
trueif the license is a subscription license,falseotherwise.
-
isWithinGracePeriod
public boolean isWithinGracePeriod()- Returns:
trueif the license
-
isLicenseExpired
public boolean isLicenseExpired() -
getActionMessageAlertColor
Gets the action message color dressing to use with the decorator.- Returns:
- The window dressing color to use.
-
addActionMessage
Sets a UI message and the color type for the user.- Parameters:
color- The color to use.message- The message to display.
-
getWebItemsForSection
-
getWebSectionsForLocation
-
renderFreemarkerTemplate
-
getWebFragmentsContextMap
-
getDisplayableLink
-
getLink
-
getLabel
-
directory
-
addActionError
-
containsErrorMessages
public boolean containsErrorMessages() -
containsActionMessages
public boolean containsActionMessages() -
setPropertyManager
-
setDirectoryManager
-
setCrowdLicenseManager
-
setApplicationManager
-
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
-
isAtResourceLimit
public boolean isAtResourceLimit() -
getCurrentLicenseResourceTotal
-
getImageTitle
-
getImageLocation
-
authorisedToAccessCrowdConsole
protected boolean authorisedToAccessCrowdConsole(Long directoryId, String name) throws DirectoryNotFoundException, UserNotFoundException -
authorisedToAccessCrowdAdminConsole
public boolean authorisedToAccessCrowdAdminConsole(DirectoryMapping directoryMapping, Long directoryId, String username) throws DirectoryNotFoundException, UserNotFoundException -
getText
-
getXsrfTokenName
-
getXsrfToken
-
getText
- Specified by:
getTextin interfaceorg.apache.struts2.text.TextProvider- Overrides:
getTextin classorg.apache.struts2.ActionSupport
-
setApplicationService
-
setTokenAuthenticationManager
-
setRememberMeService
-
setClientProperties
-
setXsrfTokenGenerator
-
getPasswordComplexityMessage
- Returns:
- the password complexity message for the specified directory, or null if there is none
-
getCrowdApplication
- Throws:
ApplicationNotFoundException
-
setCrowdApplication
-
setActionHelper
-
resolveAvatarUri
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
-
getSmallAvatarUrl
-
applyFieldErrors
-
setClusterService
-
getTextProvider
protected org.apache.struts2.text.TextProvider getTextProvider()- Overrides:
getTextProviderin classorg.apache.struts2.ActionSupport
-
getLocaleProvider
protected org.apache.struts2.locale.LocaleProvider getLocaleProvider()- Overrides:
getLocaleProviderin classorg.apache.struts2.ActionSupport
-
isDataCenterLicense
public boolean isDataCenterLicense() -
bindInformationAboutLicense
protected void bindInformationAboutLicense() -
setPluginPropertyManager
-
isBasicAuthEnabled
public boolean isBasicAuthEnabled()
-