Class UserMacroAction
java.lang.Object
org.apache.struts2.ActionSupport
com.atlassian.confluence.core.AbstractI18nActionSupport
com.atlassian.confluence.core.ConfluenceActionSupport
com.atlassian.confluence.admin.actions.macros.UserMacroAction
- All Implemented Interfaces:
WebInterface,MessageHolderAware,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:
AddUserMacroAction,RemoveUserMacroAction,UpdateUserMacroAction
Super class for updating the user macro library and the action for viewing the library
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected com.atlassian.renderer.v2.macro.MacroManagerprotected MacroMetadataManagerprotected UserMacroConfigprotected UserMacroLibraryFields 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, webInterfaceManagerFields 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 voidaddUpdateMacro(UserMacroConfig userMacro) Add the updated macro to the user macro library.intintConvenient 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 delegationbooleanprotected List<UserMacroConfig> getToBeValidatedUserMacros(@Nullable UserMacroConfig macroConfig) booleanisMissingMetadata(String macroName) booleanConsulted byPermissionCheckInterceptor.booleanisWikiTemplate(String macroName) voidsetDocBean(DocumentationBean docBean) voidvoidsetMacroManager(com.atlassian.renderer.v2.macro.MacroManager macroManager) voidsetMacroMetadataManager(MacroMetadataManager macroMetadataManager) voidsetShowInMacroBrowser(boolean showInMacroBrowser) voidsetUserMacro(UserMacroConfig userMacro) voidsetUserMacroLibrary(UserMacroLibrary userMacroLibrary) protected voidprotected voidvalidateMacroMissingContextVariables(@Nullable UserMacroConfig macroConfig) protected voidvalidateNewMacroName(String name) Methods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addActionMessage, addFieldError, addPermissionTypeTo, addToHistory, getActionErrors, getActionMessages, getActionName, getActiveRequest, getActiveResponse, getAuthenticatedUser, getBootstrapStatusProvider, getCancelResult, 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, setSpacePermissionManager, setStrutsHelper, setSystemInformationService, setTimeZoneManager, setUserAccessor, setWebInterfaceManagerMethods inherited from class com.atlassian.confluence.core.AbstractI18nActionSupport
getText, getText, getText, getText, getText, getText, getText, getText, getTextStrictMethods 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, validateMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.validation.MessageHolderAware
validate
-
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:ConfluenceActionSupportConvenient Action execution method which defaults to returning INPUT- Overrides:
doDefaultin 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:ConfluenceActionSupportConsulted byPermissionCheckInterceptor.- Overrides:
isPermittedin 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
-