public class ConfluenceActionSupport extends com.opensymphony.xwork.ActionSupport implements com.opensymphony.xwork.LocaleProvider, WebInterface, MessageHolderAware
Modifier and Type | Field and Description |
---|---|
protected AccessModeService |
accessModeService |
static String |
CANCEL |
static String |
DEVMODE |
protected com.atlassian.event.EventManager |
eventManager |
protected I18NBeanFactory |
i18NBeanFactory |
protected LabelManager |
labelManager |
protected LanguageManager |
languageManager |
static String |
LICENSE_EXPIRED |
static String |
LICENSE_USERS_EXCEEDED |
protected MessageHolder |
messageHolder |
protected PermissionManager |
permissionManager |
protected boolean |
permitted |
protected PersonService |
personService |
protected com.atlassian.plugin.PluginAccessor |
pluginAccessor |
static String |
PREVIEW |
protected SettingsManager |
settingsManager |
protected SpacePermissionManager |
spacePermissionManager |
protected UserAccessor |
userAccessor |
protected com.atlassian.plugin.web.WebInterfaceManager |
webInterfaceManager |
Constructor and Description |
---|
ConfluenceActionSupport() |
Modifier and Type | Method and Description |
---|---|
void |
addActionError(String textKey,
Object... args)
Adds an error to the current action which will be displayed to the user.
|
void |
addActionMessage(String textKey,
Object... args)
Adds a message to the current action which will be displayed to the user.
|
void |
addFieldError(String fieldName,
String textKey,
Object[] args)
Adds an error to the current action which will be displayed next to the specified field.
|
protected void |
addPermissionTypeTo(String permissionType,
List<String> permissionTypes) |
protected void |
addToHistory(ContentEntityObject content) |
String |
doDefault()
Default webwork action execution method.
|
String |
formatFriendlyDate(Date date) |
String |
getAccessMode()
Used by velocity to add to page meta data, indicating the current access mode
|
String |
getActionName()
Returns the internationalised name of the current action.
|
String |
getActionName(String fullClassName) |
ConfluenceUser |
getAuthenticatedUser()
Return the user from
AuthenticatedUserThreadLocal.get() . |
BootstrapManager |
getBootstrapManager() |
protected String |
getCancel()
get the value of the cancel parameter
|
String |
getCancelResult() |
ConfluenceAccessManager |
getConfluenceAccessManager() |
Map<String,Object> |
getContext() |
protected javax.servlet.http.HttpServletRequest |
getCurrentRequest() |
protected javax.servlet.http.HttpSession |
getCurrentSession() |
String |
getDateFormatSetting() |
DateFormatter |
getDateFormatter() |
ResourceBundle |
getDefaultResourceBundle() |
TimeZone |
getDefaultTimeZone() |
String |
getDocLink(String page)
Creates a version specific documentation link for the provided page.
|
com.atlassian.event.EventManager |
getEventManager() |
FriendlyDateFormatter |
getFriendlyDateFormatter() |
String |
getFrontendServiceURL()
Returns the URL of the Confluence Frontend microservice.
|
Settings |
getGlobalSettings() |
ThemeHelper |
getHelper() |
I18NBean |
getI18n() |
List<Language> |
getInstalledLanguages() |
LabelManager |
getLabelManager() |
String |
getLanguageJs() |
LanguageManager |
getLanguageManager() |
String |
getLanguageUserFriendly(String locale) |
Locale |
getLocale() |
LocaleManager |
getLocaleManager() |
String |
getLocaleString() |
MessageHolder |
getMessageHolder() |
String |
getNiceContentType(ContentEntityObject entityObject)
Deprecated.
since 4.2 - use ContentUiSupport directly
|
protected PermissionManager |
getPermissionManager() |
protected List<String> |
getPermissionTypes() |
protected <TYPE> List<TYPE> |
getPermittedEntitiesOf(Iterator<TYPE> entities,
int maxCount) |
protected <TYPE> List<TYPE> |
getPermittedEntitiesOf(Iterator<TYPE> entities,
int maxCount,
List<? extends PermissionManager.Criterion> criteria) |
protected <TYPE> List<TYPE> |
getPermittedEntitiesOf(List<TYPE> entities) |
PersonService |
getPersonService() |
Date |
getPreviousLoginDate() |
com.atlassian.user.User |
getRemoteUser()
Deprecated.
since 5.2. Use
getAuthenticatedUser() instead. |
Map |
getSession()
Deprecated.
since 5.9. This method is too tightly couple to the XWork API. No replacement
|
SystemInformationService |
getSystemInformationService() |
String |
getText(String key) |
String |
getText(String key,
List list) |
String |
getText(String key,
Object[] args) |
String |
getText(String key,
String defaultValue)
This can be used for internationalisation where a non-internationalised default string exists.
|
static String |
getTextStatic(String key) |
static String |
getTextStatic(String key,
Object[] list) |
String |
getTextStrict(String key) |
TimeZone |
getTimeZone() |
UserAccessor |
getUserAccessor() |
ConfluenceUser |
getUserByName(String username)
Returns user by name.
|
String |
getUserFullName(String username) |
boolean |
getUserHasBrowseUsersPermission()
Used by velocity to add to page meta data, indicating if the current user has browse users permission.
|
boolean |
getUserHasLicensedAccess()
Used by velocity to add to page meta data, indicating if the current user has licensed access to Confluence.
|
protected UserInterfaceState |
getUserInterfaceState() |
String |
getUserLocaleDefaultDatePattern() |
String |
getUserProfilePicUrl()
Deprecated.
since 5.10. Use $userAvatarUriReference, which is provided in the velocity context by
SitemeshContextItemProvider |
WebInterfaceContext |
getWebInterfaceContext()
Returns a context which can be passed to web items when rendering them.
|
com.atlassian.plugin.web.WebInterfaceManager |
getWebInterfaceManager() |
protected boolean |
hasPermissionForSpace(List permissionTypes,
Space space) |
boolean |
isAnonymousUser() |
boolean |
isCanceled()
Has this action been cancelled? Used by
CancellingInterceptor to determine if the action should be
executed. |
boolean |
isDevMode()
Returns true if the system property confluence.devmode is set and has the value "true".
|
boolean |
isEmailVisible() |
boolean |
isExternalUserManagementEnabled() |
boolean |
isLabelable(Object object) |
boolean |
isPermitted() |
boolean |
isPrintableVersion() |
boolean |
isSkipAccessCheck() |
boolean |
isUserStatusPluginEnabled()
Temporary method until we have plugin points to require i18n keys.
|
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.
|
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.
|
void |
setAccessModeService(AccessModeService accessModeService) |
void |
setApiDateFormatService(DateFormatService dateFormatService) |
void |
setApiPersonService(PersonService personService) |
void |
setBootstrapManager(BootstrapManager bootstrapManager) |
void |
setCancel(String cancel)
Set by the "cancel" button on forms.
|
void |
setConfluenceAccessManager(ConfluenceAccessManager confluenceAccessManager) |
void |
setContentUiSupport(ContentUiSupport contentUiSupport) |
void |
setEventManager(com.atlassian.event.EventManager eventManager) |
void |
setFormatSettingsManager(FormatSettingsManager formatSettingsManager) |
void |
setI18NBean(I18NBean i18NBean) |
void |
setI18NBeanFactory(I18NBeanFactory i18NBeanFactory) |
void |
setLabelManager(LabelManager labelManager) |
void |
setLanguageManager(LanguageManager languageManager) |
void |
setLocaleManager(LocaleManager localeManager) |
void |
setLoginManager(LoginManager loginManager) |
void |
setMessageHolder(MessageHolder messageHolder) |
void |
setPermissionManager(PermissionManager permissionManager) |
void |
setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor) |
void |
setPreviousLoginDate(Date previousLoginDate) |
void |
setServletRequestSupplier(com.google.common.base.Supplier<javax.servlet.http.HttpServletRequest> servletRequestSupplier)
Deprecated.
since 7.0.1. Use
withServletRequestSupplier(java.util.function.Supplier) |
void |
setSettingsManager(SettingsManager settingsManager) |
void |
setSkipAccessCheck(boolean skipAccessCheck)
For use by
ConfluenceAccessInterceptor to indicate that access checking has already been performed |
void |
setSpacePermissionManager(SpacePermissionManager spacePermissionManager) |
void |
setSystemInformationService(SystemInformationService systemInformationService) |
void |
setTimeZoneManager(com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager) |
void |
setUserAccessor(UserAccessor userAccessor) |
void |
setWebInterfaceManager(com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager) |
void |
withServletRequestSupplier(Supplier<javax.servlet.http.HttpServletRequest> servletRequestSupplier) |
addActionError, addActionMessage, addFieldError, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
validate
public static final String CANCEL
public static final String PREVIEW
public static final String LICENSE_EXPIRED
public static final String LICENSE_USERS_EXCEEDED
public static final String DEVMODE
protected UserAccessor userAccessor
protected com.atlassian.event.EventManager eventManager
protected SpacePermissionManager spacePermissionManager
protected PermissionManager permissionManager
protected SettingsManager settingsManager
protected LabelManager labelManager
protected LanguageManager languageManager
protected I18NBeanFactory i18NBeanFactory
protected MessageHolder messageHolder
protected com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager
protected boolean permitted
protected AccessModeService accessModeService
protected PersonService personService
protected com.atlassian.plugin.PluginAccessor pluginAccessor
public void setCancel(String cancel)
CancellingInterceptor
that an action should not be
executed, and should just return its getCancelResult()
result.cancel
- Any non-null, non-empty string value.public boolean isCanceled()
CancellingInterceptor
to determine if the action should be
executed.setCancel(String)
protected String getCancel()
public String doDefault() throws Exception
doDefault
in class com.opensymphony.xwork.ActionSupport
Exception
- if something goes wrongpublic String getText(String key)
getText
in interface com.opensymphony.xwork.TextProvider
getText
in class com.opensymphony.xwork.ActionSupport
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.
getText
in interface com.opensymphony.xwork.TextProvider
getText
in class com.opensymphony.xwork.ActionSupport
public String getText(String key, List list)
getText
in interface com.opensymphony.xwork.TextProvider
getText
in class com.opensymphony.xwork.ActionSupport
public String getActionName()
public boolean isPrintableVersion()
public boolean isPermitted()
public final void setSkipAccessCheck(boolean skipAccessCheck)
ConfluenceAccessInterceptor
to indicate that access checking has already been performedpublic boolean isSkipAccessCheck()
@Deprecated public com.atlassian.user.User getRemoteUser()
getAuthenticatedUser()
instead.public ConfluenceUser getAuthenticatedUser()
AuthenticatedUserThreadLocal.get()
. This user is
usually set by UserThreadLocalFilter
for request threads.public ConfluenceUser getUserByName(String username)
public String getUserProfilePicUrl()
SitemeshContextItemProvider
protected void addPermissionTypeTo(String permissionType, List<String> permissionTypes)
protected <TYPE> List<TYPE> getPermittedEntitiesOf(Iterator<TYPE> entities, int maxCount, List<? extends PermissionManager.Criterion> criteria)
protected <TYPE> List<TYPE> getPermittedEntitiesOf(Iterator<TYPE> entities, int maxCount)
public void setPreviousLoginDate(Date previousLoginDate)
public Date getPreviousLoginDate()
public boolean isExternalUserManagementEnabled()
@Deprecated public void setServletRequestSupplier(com.google.common.base.Supplier<javax.servlet.http.HttpServletRequest> servletRequestSupplier)
withServletRequestSupplier(java.util.function.Supplier)
public void withServletRequestSupplier(Supplier<javax.servlet.http.HttpServletRequest> servletRequestSupplier)
protected javax.servlet.http.HttpServletRequest getCurrentRequest()
protected javax.servlet.http.HttpSession getCurrentSession()
protected void addToHistory(ContentEntityObject content)
@Deprecated public Map getSession()
protected UserInterfaceState getUserInterfaceState()
public boolean isAnonymousUser()
public boolean isDevMode()
public String getFrontendServiceURL()
public String getCancelResult()
@Deprecated public String getNiceContentType(ContentEntityObject entityObject)
public ResourceBundle getDefaultResourceBundle()
public Settings getGlobalSettings()
public boolean isEmailVisible()
public boolean isLabelable(Object object)
public final boolean getUserHasLicensedAccess()
public final boolean getUserHasBrowseUsersPermission()
public final String getAccessMode()
public void setSettingsManager(SettingsManager settingsManager)
public com.atlassian.event.EventManager getEventManager()
public void setEventManager(com.atlassian.event.EventManager eventManager)
public void setBootstrapManager(BootstrapManager bootstrapManager)
public BootstrapManager getBootstrapManager()
public void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
protected PermissionManager getPermissionManager()
public void setPermissionManager(PermissionManager permissionManager)
public com.atlassian.plugin.web.WebInterfaceManager getWebInterfaceManager()
public void setWebInterfaceManager(com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager)
public void setLabelManager(LabelManager labelManager)
public LabelManager getLabelManager()
public void setLanguageManager(LanguageManager languageManager)
public LanguageManager getLanguageManager()
public ThemeHelper getHelper()
public UserAccessor getUserAccessor()
public void setUserAccessor(UserAccessor userAccessor)
public void setLoginManager(LoginManager loginManager)
public Locale getLocale()
getLocale
in interface com.opensymphony.xwork.LocaleProvider
getLocale
in class com.opensymphony.xwork.ActionSupport
public String getLocaleString()
public String getLanguageJs()
public String getUserLocaleDefaultDatePattern()
public void setApiDateFormatService(DateFormatService dateFormatService)
public void addFieldError(String fieldName, String textKey, Object[] args)
fieldName
- field to apply error totextKey
- key to internationalised textargs
- args to be merged with text via standard MessageFormat rulespublic void addActionError(String textKey, Object... args)
textKey
- key to internationalised textargs
- args to be merged with text via standard MessageFormat rulespublic void addActionMessage(String textKey, Object... args)
textKey
- key to internationalised textargs
- args to be merged with text via standard MessageFormat rulespublic I18NBean getI18n()
public String getDocLink(String page)
page
- the page to link to (just the title)public SystemInformationService getSystemInformationService()
public void setSystemInformationService(SystemInformationService systemInformationService)
public void setLocaleManager(LocaleManager localeManager)
public LocaleManager getLocaleManager()
public void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
public void setMessageHolder(MessageHolder messageHolder)
setMessageHolder
in interface MessageHolderAware
public MessageHolder getMessageHolder()
getMessageHolder
in interface MessageHolderAware
public TimeZone getTimeZone()
public TimeZone getDefaultTimeZone()
public DateFormatter getDateFormatter()
public FriendlyDateFormatter getFriendlyDateFormatter()
public String getDateFormatSetting()
public void setFormatSettingsManager(FormatSettingsManager formatSettingsManager)
public boolean isUsingHSQL()
public boolean isUsingH2()
public void setI18NBean(I18NBean i18NBean)
public WebInterfaceContext getWebInterfaceContext()
WebInterface
Typically, WebWork actions will implement this to provide extra details in the context such as content objects, and so on.
getWebInterfaceContext
in interface WebInterface
public boolean isUserStatusPluginEnabled()
public void setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)
public void setContentUiSupport(ContentUiSupport contentUiSupport)
public void setTimeZoneManager(com.atlassian.sal.api.timezone.TimeZoneManager timeZoneManager)
public void setConfluenceAccessManager(ConfluenceAccessManager confluenceAccessManager)
public ConfluenceAccessManager getConfluenceAccessManager()
public void setAccessModeService(AccessModeService accessModeService)
public PersonService getPersonService()
public void setApiPersonService(PersonService personService)
Copyright © 2003–2020 Atlassian. All rights reserved.