Class UserMacroAction
java.lang.Object
org.apache.struts2.ActionSupport
com.opensymphony.xwork2.ActionSupport
com.atlassian.confluence.core.AbstractI18nActionSupport
com.atlassian.confluence.core.ConfluenceActionSupport
com.atlassian.confluence.admin.actions.macros.UserMacroAction
- All Implemented Interfaces:
WebInterface
,MessageHolderAware
,com.opensymphony.xwork2.Action
,com.opensymphony.xwork2.interceptor.ValidationAware
,com.opensymphony.xwork2.LocaleProvider
,com.opensymphony.xwork2.TextProvider
,com.opensymphony.xwork2.Validateable
,Serializable
,org.apache.struts2.action.Action
,org.apache.struts2.interceptor.ValidationAware
,org.apache.struts2.Validateable
- Direct Known Subclasses:
AddUserMacroAction
,RemoveUserMacroAction
,UpdateUserMacroAction
Super class for updating the user macro library and the action for viewing the library
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.opensymphony.xwork2.interceptor.ValidationAware
com.opensymphony.xwork2.interceptor.ValidationAware.LegacyAdapter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected com.atlassian.renderer.v2.macro.MacroManager
protected MacroMetadataManager
protected UserMacroConfig
protected UserMacroLibrary
Fields inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
accessModeService, CANCEL, confluenceAccessManager, contentUiSupport, eventPublisher, formatSettingsManager, globalSettingsManager, i18NBeanFactory, labelManager, languageManager, LICENSE_EXPIRED, LICENSE_USERS_EXCEEDED, localeManager, loginManager, messageHolder, permissionManager, pluginAccessor, PREVIEW, request, response, spacePermissionManager, strutsHelper, systemInformationService, userAccessor, webInterfaceManager
Fields inherited from class org.apache.struts2.ActionSupport
container
Fields inherited from interface org.apache.struts2.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addUpdateMacro
(UserMacroConfig userMacro) Add the updated macro to the user macro library.int
int
Convenient Action execution method which defaults to returning INPUTPopulates the body type select box Only used by AddUserMacroAction and UpdateUserMacroAction If this class gets any more complex consider using delegationPopulates the category multiple-select box Only used by AddUserMacroAction and UpdateUserMacroAction If this class gets _any_ more complex consider using delegationboolean
protected List<UserMacroConfig>
getToBeValidatedUserMacros
(@Nullable UserMacroConfig macroConfig) boolean
isMissingMetadata
(String macroName) boolean
Consulted byPermissionCheckInterceptor
.boolean
isWikiTemplate
(String macroName) void
setDocBean
(DocumentationBean docBean) void
void
setMacroManager
(com.atlassian.renderer.v2.macro.MacroManager macroManager) void
setMacroMetadataManager
(MacroMetadataManager macroMetadataManager) void
setShowInMacroBrowser
(boolean showInMacroBrowser) void
setUserMacro
(UserMacroConfig userMacro) void
setUserMacroLibrary
(UserMacroLibrary userMacroLibrary) protected void
protected void
validateMacroMissingContextVariables
(@Nullable UserMacroConfig macroConfig) protected void
validateNewMacroName
(String name) Methods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addActionMessage, addFieldError, addPermissionTypeTo, addToHistory, getActionErrors, getActionMessages, getActionName, getAuthenticatedUser, getBootstrapStatusProvider, getCancelResult, getCurrentRequest, getCurrentResponse, getDateFormatter, getDefaultTimeZone, getFieldErrors, getGlobalSettings, getHelper, getI18n, getLocale, getMessageHolder, getPermissionTypes, getPermittedEntitiesOf, getPermittedEntitiesOf, getPermittedEntitiesOf, getPreviousLoginDate, getTimeZone, getUserByName, getUserInterfaceState, getWebInterfaceContext, isAnonymousUser, isEmailVisible, setAccessModeService, setBootstrapStatusProvider, setCancel, setConfluenceAccessManager, setContentUiSupport, setEventPublisher, setFormatSettingsManager, setI18NBean, setI18NBeanFactory, setLabelManager, setLanguageManager, setLocaleManager, setLoginManager, setMessageHolder, setPermissionManager, setPluginAccessor, setPreviousLoginDate, setSettingsManager, setSkipIsPermitted, setSpacePermissionManager, setStrutsHelper, setSystemInformationService, setTimeZoneManager, setUserAccessor, setWebInterfaceManager, shouldSkipIsPermitted
Methods inherited from class com.atlassian.confluence.core.AbstractI18nActionSupport
getText, getText, getText, getText, getText, getText, getText, getText, getTextStrict
Methods inherited from class org.apache.struts2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, execute, getContainer, getFormatted, getLocaleProvider, getText, getText, getTextProvider, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, toLocale, validate
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.struts2.action.Action
execute
Methods inherited from interface com.atlassian.confluence.validation.MessageHolderAware
validate
Methods inherited from interface org.apache.struts2.interceptor.ValidationAware
addActionError, addActionMessage, addFieldError, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors
-
Field Details
-
userMacro
-
userMacroLibrary
-
macroManager
protected com.atlassian.renderer.v2.macro.MacroManager macroManager -
macroMetadataManager
-
macro
-
-
Constructor Details
-
UserMacroAction
public UserMacroAction()
-
-
Method Details
-
setDocBean
-
getUserMacro
-
getUserMacros
-
setUserMacroLibrary
-
setMacroManager
public void setMacroManager(com.atlassian.renderer.v2.macro.MacroManager macroManager) -
setMacroMetadataManager
-
setMacro
-
setUserMacro
-
doDefault
Description copied from class:ConfluenceActionSupport
Convenient Action execution method which defaults to returning INPUT- Overrides:
doDefault
in classConfluenceActionSupport
- Throws:
Exception
-
addUpdateMacro
Add the updated macro to the user macro library. HasBody isn't displayed in the UI and it isn't worth updating with JS and killing the acceptance tests, so we set it here based on the body type. We also set hidden at this point. -
isPermitted
public boolean isPermitted()Description copied from class:ConfluenceActionSupport
Consulted byPermissionCheckInterceptor
.- Overrides:
isPermitted
in classConfluenceActionSupport
-
isWikiTemplate
- Parameters:
macroName
- the name of the macro to check- Returns:
- true if the macro has a wiki formatted template.
-
isMissingMetadata
-
countUserMacrosWithWikiTemplates
public int countUserMacrosWithWikiTemplates() -
countUserMacrosWithoutMetadata
public int countUserMacrosWithoutMetadata() -
getBodyTypes
Populates the body type select box Only used by AddUserMacroAction and UpdateUserMacroAction If this class gets any more complex consider using delegation- Returns:
- list of body types
-
getVisibleTypes
-
getCategories
Populates the category multiple-select box Only used by AddUserMacroAction and UpdateUserMacroAction If this class gets _any_ more complex consider using delegation- Returns:
- list of categories
-
getShowInMacroBrowser
public boolean getShowInMacroBrowser() -
setShowInMacroBrowser
public void setShowInMacroBrowser(boolean showInMacroBrowser) -
getTemplateHtml
-
validateNewMacroName
-
validateMacroForm
protected void validateMacroForm() -
validateMacroMissingContextVariables
-
getToBeValidatedUserMacros
-