|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.opensymphony.xwork.ActionSupport com.atlassian.confluence.core.ConfluenceActionSupport
public class ConfluenceActionSupport
Base class for all Confluence webwork actions. Mainly takes care of managing permissions, and a few other tasks that are common across all actions in the app.
Field Summary | |
---|---|
static java.lang.String |
CANCEL
|
static java.lang.String |
DEVMODE
|
protected com.atlassian.event.EventManager |
eventManager
|
protected I18NBeanFactory |
i18NBeanFactory
|
protected LabelManager |
labelManager
|
protected LanguageManager |
languageManager
|
static java.lang.String |
LICENSE_EXPIRED
|
static java.lang.String |
LICENSE_USERS_EXCEEDED
|
protected MessageHolder |
messageHolder
|
protected PermissionManager |
permissionManager
|
protected boolean |
permitted
|
protected com.atlassian.plugin.PluginAccessor |
pluginAccessor
|
static java.lang.String |
PREVIEW
|
protected SettingsManager |
settingsManager
|
protected SpacePermissionManager |
spacePermissionManager
|
protected UserAccessor |
userAccessor
|
protected com.atlassian.plugin.web.WebInterfaceManager |
webInterfaceManager
|
Fields inherited from class com.opensymphony.xwork.ActionSupport |
---|
LOG |
Fields inherited from interface com.opensymphony.xwork.Action |
---|
ERROR, INPUT, LOGIN, NONE, SUCCESS |
Constructor Summary | |
---|---|
ConfluenceActionSupport()
|
Method Summary | |
---|---|
void |
addActionError(java.lang.String textKey,
java.lang.Object... args)
Adds an error to the current action which will be displayed to the user. |
void |
addActionMessage(java.lang.String textKey,
java.lang.Object... args)
Adds a message to the current action which will be displayed to the user. |
void |
addFieldError(java.lang.String fieldName,
java.lang.String textKey,
java.lang.Object[] args)
Adds an error to the current action which will be displayed next to the specified field. |
protected void |
addPermissionTypeTo(java.lang.String permissionType,
java.util.List<java.lang.String> permissionTypes)
|
protected void |
addToHistory(ContentEntityObject content)
|
java.lang.String |
doDefault()
Default webwork action execution method. |
java.lang.String |
formatFriendlyDate(java.util.Date date)
|
java.lang.String |
getActionName()
Returns the internationalised name of the current action. |
java.lang.String |
getActionName(java.lang.String fullClassName)
|
ConfluenceUser |
getAuthenticatedUser()
Return the user from AuthenticatedUserThreadLocal.get() . |
BootstrapManager |
getBootstrapManager()
|
protected java.lang.String |
getCancel()
get the value of the cancel parameter |
java.lang.String |
getCancelResult()
|
java.util.Map<java.lang.String,java.lang.Object> |
getContext()
|
java.lang.String |
getDateFormatSetting()
|
DateFormatter |
getDateFormatter()
|
java.util.ResourceBundle |
getDefaultResourceBundle()
|
java.lang.String |
getDocLink(java.lang.String page)
Creates a version specific documentation link for the provided page. |
com.atlassian.event.EventManager |
getEventManager()
|
FriendlyDateFormatter |
getFriendlyDateFormatter()
|
Settings |
getGlobalSettings()
|
ThemeHelper |
getHelper()
|
I18NBean |
getI18n()
|
java.util.List<Language> |
getInstalledLanguages()
|
LabelManager |
getLabelManager()
|
LanguageManager |
getLanguageManager()
|
java.lang.String |
getLanguageUserFriendly(java.lang.String locale)
|
java.util.Locale |
getLocale()
|
LocaleManager |
getLocaleManager()
|
java.lang.String |
getLocaleString()
|
MessageHolder |
getMessageHolder()
|
java.lang.String |
getNiceContentType(ContentEntityObject entityObject)
Deprecated. since 4.2 - use ContentUiSupport directly |
protected java.util.List<java.lang.String> |
getPermissionTypes()
|
protected java.util.List |
getPermittedEntitiesOf(java.util.Iterator entities,
int maxCount)
|
protected java.util.List |
getPermittedEntitiesOf(java.util.Iterator entities,
int maxCount,
java.util.List criteria)
|
protected java.util.List |
getPermittedEntitiesOf(java.util.List entities)
|
java.util.Date |
getPreviousLoginDate()
|
com.atlassian.user.User |
getRemoteUser()
Deprecated. since 5.2. Use getAuthenticatedUser() instead. |
java.util.Map |
getSession()
|
SystemInformationService |
getSystemInformationService()
|
java.lang.String |
getText(java.lang.String key)
|
java.lang.String |
getText(java.lang.String key,
java.util.List list)
|
java.lang.String |
getText(java.lang.String key,
java.lang.Object[] args)
|
java.lang.String |
getText(java.lang.String key,
java.lang.String defaultValue)
This can be used for internationalisation where a non-internationalised default string exists. |
static java.lang.String |
getTextStatic(java.lang.String key)
|
static java.lang.String |
getTextStatic(java.lang.String key,
java.lang.Object[] list)
|
java.lang.String |
getTextStrict(java.lang.String key)
|
TimeZone |
getTimeZone()
|
com.atlassian.user.User |
getUser(java.lang.String username)
Deprecated. since 5.2. Use getUserByName(String) instead. |
UserAccessor |
getUserAccessor()
|
ConfluenceUser |
getUserByName(java.lang.String username)
Returns user by name. |
java.lang.String |
getUserFullName(java.lang.String username)
|
protected UserInterfaceState |
getUserInterfaceState()
|
java.lang.String |
getUserLocaleDefaultDatePattern()
|
java.lang.String |
getUserProfilePicUrl()
|
WebInterfaceContext |
getWebInterfaceContext()
Returns a context which can be passed to web items when rendering them. |
com.atlassian.plugin.web.WebInterfaceManager |
getWebInterfaceManager()
|
protected boolean |
hasPermissionForSpace(java.util.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(java.lang.Object object)
|
boolean |
isPermissionCheck()
|
boolean |
isPermitted()
|
java.lang.String |
isPermittedAsString()
|
boolean |
isPrintableVersion()
|
boolean |
isSharedMode()
Deprecated. Since 5.1. "Shared mode" no longer supported, always returns false; |
boolean |
isUserStatusPluginEnabled()
Temporary method until we have plugin points to require i18n keys. |
boolean |
isUsingHSQL()
Placing this method in ConfluenceActionSupport is a bit of a hack, but it is suprisingly difficult to have a generic piece of logic that can be used in decorators. |
void |
setApiDateFormatService(DateFormatService dateFormatService)
|
void |
setBootstrapManager(BootstrapManager bootstrapManager)
|
void |
setCancel(java.lang.String cancel)
Set by the "cancel" button on forms. |
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 |
setPermissionCheck(boolean permissionCheck)
|
void |
setPermissionManager(PermissionManager permissionManager)
|
void |
setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)
|
void |
setPreviousLoginDate(java.util.Date previousLoginDate)
|
void |
setSettingsManager(SettingsManager settingsManager)
|
void |
setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
|
void |
setSystemInformationService(SystemInformationService systemInformationService)
|
void |
setUserAccessor(UserAccessor userAccessor)
|
void |
setWebInterfaceManager(com.atlassian.plugin.web.WebInterfaceManager webInterfaceManager)
|
Methods inherited from class com.opensymphony.xwork.ActionSupport |
---|
addActionError, addActionMessage, addFieldError, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.confluence.validation.MessageHolderAware |
---|
validate |
Field Detail |
---|
public static final java.lang.String CANCEL
public static final java.lang.String PREVIEW
public static final java.lang.String LICENSE_EXPIRED
public static final java.lang.String LICENSE_USERS_EXCEEDED
public static final java.lang.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 com.atlassian.plugin.PluginAccessor pluginAccessor
Constructor Detail |
---|
public ConfluenceActionSupport()
Method Detail |
---|
public void setCancel(java.lang.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 java.lang.String getCancel()
public java.lang.String doDefault() throws java.lang.Exception
doDefault
in class com.opensymphony.xwork.ActionSupport
java.lang.Exception
- if something goes wrongpublic java.lang.String getText(java.lang.String key)
getText
in interface com.opensymphony.xwork.TextProvider
getText
in class com.opensymphony.xwork.ActionSupport
public java.lang.String getText(java.lang.String key, java.lang.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 java.lang.String getText(java.lang.String key, java.lang.Object[] args)
public java.lang.String getText(java.lang.String key, java.util.List list)
getText
in interface com.opensymphony.xwork.TextProvider
getText
in class com.opensymphony.xwork.ActionSupport
public java.lang.String getActionName(java.lang.String fullClassName)
public java.lang.String getActionName()
public java.lang.String getTextStrict(java.lang.String key)
public boolean isPrintableVersion()
public java.lang.String isPermittedAsString()
public boolean isPermitted()
protected java.util.List<java.lang.String> getPermissionTypes()
public boolean isPermissionCheck()
public void setPermissionCheck(boolean permissionCheck)
@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(java.lang.String username)
username
-
@Deprecated public com.atlassian.user.User getUser(java.lang.String username)
getUserByName(String)
instead.
public java.lang.String getUserFullName(java.lang.String username)
public java.lang.String getUserProfilePicUrl()
protected void addPermissionTypeTo(java.lang.String permissionType, java.util.List<java.lang.String> permissionTypes)
protected java.util.List getPermittedEntitiesOf(java.util.List entities)
protected java.util.List getPermittedEntitiesOf(java.util.Iterator entities, int maxCount, java.util.List criteria)
protected java.util.List getPermittedEntitiesOf(java.util.Iterator entities, int maxCount)
public void setPreviousLoginDate(java.util.Date previousLoginDate)
public java.util.Date getPreviousLoginDate()
public boolean isExternalUserManagementEnabled()
protected void addToHistory(ContentEntityObject content)
public java.util.Map getSession()
protected UserInterfaceState getUserInterfaceState()
public boolean isAnonymousUser()
public boolean isDevMode()
public java.lang.String getCancelResult()
@Deprecated public java.lang.String getNiceContentType(ContentEntityObject entityObject)
public java.util.ResourceBundle getDefaultResourceBundle()
public Settings getGlobalSettings()
public boolean isEmailVisible()
public boolean isLabelable(java.lang.Object object)
public void setSettingsManager(SettingsManager settingsManager)
protected boolean hasPermissionForSpace(java.util.List permissionTypes, Space space)
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)
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 static java.lang.String getTextStatic(java.lang.String key)
public static java.lang.String getTextStatic(java.lang.String key, java.lang.Object[] list)
public java.util.Locale getLocale()
getLocale
in interface com.opensymphony.xwork.LocaleProvider
getLocale
in class com.opensymphony.xwork.ActionSupport
public java.lang.String getLocaleString()
public java.lang.String getLanguageUserFriendly(java.lang.String locale)
public java.lang.String getUserLocaleDefaultDatePattern()
public void setApiDateFormatService(DateFormatService dateFormatService)
public java.util.List<Language> getInstalledLanguages()
public void addFieldError(java.lang.String fieldName, java.lang.String textKey, java.lang.Object[] args)
fieldName
- field to apply error totextKey
- key to internationalised textargs
- args to be merged with text via standard MessageFormat rulespublic void addActionError(java.lang.String textKey, java.lang.Object... args)
textKey
- key to internationalised textargs
- args to be merged with text via standard MessageFormat rulespublic void addActionMessage(java.lang.String textKey, java.lang.Object... args)
textKey
- key to internationalised textargs
- args to be merged with text via standard MessageFormat rulespublic I18NBean getI18n()
public java.lang.String getDocLink(java.lang.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 DateFormatter getDateFormatter()
public FriendlyDateFormatter getFriendlyDateFormatter()
public java.lang.String getDateFormatSetting()
public java.lang.String formatFriendlyDate(java.util.Date date)
public void setFormatSettingsManager(FormatSettingsManager formatSettingsManager)
public boolean isUsingHSQL()
public void setI18NBean(I18NBean i18NBean)
public WebInterfaceContext getWebInterfaceContext()
WebInterface
getWebInterfaceContext
in interface WebInterface
public boolean isSharedMode()
public boolean isUserStatusPluginEnabled()
public void setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)
public java.util.Map<java.lang.String,java.lang.Object> getContext()
public void setContentUiSupport(ContentUiSupport contentUiSupport)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |