|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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 String |
CANCEL
|
static String |
DEVMODE
|
protected EventManager |
eventManager
|
protected I18NBeanFactory |
i18NBeanFactory
|
protected LabelManager |
labelManager
|
protected LanguageManager |
languageManager
|
static String |
LICENSE_EXPIRED
|
static String |
LICENSE_USERS_EXCEEDED
|
protected org.apache.log4j.Logger |
log
Deprecated. since 2.6.1 create a private static logger in your action class |
protected PermissionManager |
permissionManager
|
protected boolean |
permitted
|
protected PluginAccessor |
pluginAccessor
|
static String |
PREVIEW
|
protected SettingsManager |
settingsManager
|
protected SpacePermissionManager |
spacePermissionManager
|
protected UserAccessor |
userAccessor
|
protected 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(String textKey,
Object... args)
Adds an error 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 |
getActionName()
Returns the internationalised name of the current action. |
String |
getActionName(String fullClassName)
|
BootstrapManager |
getBootstrapManager()
|
String |
getCancelResult()
|
Map<String,Object> |
getContext()
|
DateFormatter |
getDateFormatter()
|
ResourceBundle |
getDefaultResourceBundle()
|
String |
getDocLink(String page)
Creates a version specific documentation link for the provided page. |
EventManager |
getEventManager()
|
FriendlyDateFormatter |
getFriendlyDateFormatter()
|
Settings |
getGlobalSettings()
|
ThemeHelper |
getHelper()
|
I18NBean |
getI18n()
|
List<Language> |
getInstalledLanguages()
|
LabelManager |
getLabelManager()
|
LanguageManager |
getLanguageManager()
|
String |
getLanguageUserFriendly(String locale)
|
Locale |
getLocale()
|
LocaleManager |
getLocaleManager()
|
String |
getLocaleString()
|
String |
getNiceContentType(ContentEntityObject entityObject)
|
protected List<String> |
getPermissionTypes()
|
protected List |
getPermittedEntitiesOf(Iterator entities,
int maxCount)
|
protected List |
getPermittedEntitiesOf(Iterator entities,
int maxCount,
List criteria)
|
protected List |
getPermittedEntitiesOf(List entities)
|
Date |
getPreviousLoginDate()
|
int |
getRandom()
Deprecated. since 2.9. Random number generation does not belong here. Please introduce your own random number generation in your own actions. |
com.atlassian.user.User |
getRemoteUser()
Return the user from ServletActionContext.getRequest() , or if that is not found,
the user returned from AuthenticatedUserThreadLocal.getUser() . |
Map |
getSession()
|
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 an uninternationalised default string exists. |
static String |
getTextStatic(String key)
|
static String |
getTextStatic(String key,
Object[] list)
|
String |
getTextStrict(String key)
|
TimeZone |
getTimeZone()
|
com.atlassian.user.User |
getUser(String username)
|
UserAccessor |
getUserAccessor()
|
String |
getUserFullName(String username)
|
protected UserInterfaceState |
getUserInterfaceState()
|
WebInterfaceContext |
getWebInterfaceContext()
Returns a context which can be passed to web items when rendering them. |
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 |
isPermissionCheck()
|
boolean |
isPermitted()
|
String |
isPermittedAsString()
|
boolean |
isPrintableVersion()
|
boolean |
isSharedMode()
|
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 |
setBootstrapManager(BootstrapManager bootstrapManager)
|
void |
setCancel(String cancel)
Set by the "cancel" button on forms. |
void |
setEventManager(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 |
setPermissionCheck(boolean permissionCheck)
|
void |
setPermissionManager(PermissionManager permissionManager)
|
void |
setPluginAccessor(PluginAccessor pluginAccessor)
|
void |
setPreviousLoginDate(Date previousLoginDate)
|
void |
setSettingsManager(SettingsManager settingsManager)
|
void |
setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
|
void |
setSystemInformationService(SystemInformationService systemInformationService)
|
void |
setUserAccessor(UserAccessor userAccessor)
|
void |
setWebInterfaceManager(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 |
Field Detail |
---|
@Deprecated protected org.apache.log4j.Logger log
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 EventManager eventManager
protected SpacePermissionManager spacePermissionManager
protected PermissionManager permissionManager
protected SettingsManager settingsManager
protected LabelManager labelManager
protected LanguageManager languageManager
protected I18NBeanFactory i18NBeanFactory
protected WebInterfaceManager webInterfaceManager
protected boolean permitted
protected PluginAccessor pluginAccessor
Constructor Detail |
---|
public ConfluenceActionSupport()
Method Detail |
---|
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)
public int getRandom()
public String doDefault() throws Exception
doDefault
in class ActionSupport
Exception
- if something goes wrongpublic String getText(String key)
getText
in interface TextProvider
getText
in class ActionSupport
public String getText(String key, String defaultValue)
getText
in interface TextProvider
getText
in class ActionSupport
public String getText(String key, Object[] args)
public String getText(String key, List list)
getText
in interface TextProvider
getText
in class ActionSupport
public String getActionName(String fullClassName)
public String getActionName()
public String getTextStrict(String key)
public boolean isPrintableVersion()
public String isPermittedAsString()
public boolean isPermitted()
protected List<String> getPermissionTypes()
public boolean isPermissionCheck()
public void setPermissionCheck(boolean permissionCheck)
public com.atlassian.user.User getRemoteUser()
ServletActionContext.getRequest()
, or if that is not found,
the user returned from AuthenticatedUserThreadLocal.getUser()
.
public com.atlassian.user.User getUser(String username)
public String getUserFullName(String username)
protected void addPermissionTypeTo(String permissionType, List<String> permissionTypes)
protected List getPermittedEntitiesOf(List entities)
protected List getPermittedEntitiesOf(Iterator entities, int maxCount, List criteria)
protected List getPermittedEntitiesOf(Iterator entities, int maxCount)
public void setPreviousLoginDate(Date previousLoginDate)
public Date getPreviousLoginDate()
public boolean isExternalUserManagementEnabled()
protected void addToHistory(ContentEntityObject content)
public Map getSession()
protected UserInterfaceState getUserInterfaceState()
public boolean isAnonymousUser()
public boolean isDevMode()
public String getCancelResult()
public String getNiceContentType(ContentEntityObject entityObject)
public ResourceBundle getDefaultResourceBundle()
public Settings getGlobalSettings()
public boolean isEmailVisible()
public boolean isLabelable(Object object)
public void setSettingsManager(SettingsManager settingsManager)
protected boolean hasPermissionForSpace(List permissionTypes, Space space)
public EventManager getEventManager()
public void setEventManager(EventManager eventManager)
public void setBootstrapManager(BootstrapManager bootstrapManager)
public BootstrapManager getBootstrapManager()
public void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
public void setPermissionManager(PermissionManager permissionManager)
public WebInterfaceManager getWebInterfaceManager()
public void setWebInterfaceManager(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 static String getTextStatic(String key)
public static String getTextStatic(String key, Object[] list)
public Locale getLocale()
getLocale
in interface LocaleProvider
getLocale
in class ActionSupport
public String getLocaleString()
public String getLanguageUserFriendly(String locale)
public List<Language> getInstalledLanguages()
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 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 TimeZone getTimeZone()
public DateFormatter getDateFormatter()
public FriendlyDateFormatter getFriendlyDateFormatter()
public String formatFriendlyDate(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(PluginAccessor pluginAccessor)
public Map<String,Object> getContext()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |