Class AbstractPageTemplateAction
java.lang.Object
org.apache.struts2.ActionSupport
com.atlassian.confluence.core.AbstractI18nActionSupport
com.atlassian.confluence.core.ConfluenceActionSupport
com.atlassian.confluence.spaces.actions.AbstractSpaceAction
com.atlassian.confluence.plugins.templates.actions.AbstractPageTemplateAction
- All Implemented Interfaces:
WebInterface,Spaced,BreadcrumbAware,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:
AbstractEditPageTemplateAction,EditPageTemplateDescriptionAction,ListPageTemplatesAction,RemovePageTemplateAction,ViewPageTemplateAction
public abstract class AbstractPageTemplateAction
extends AbstractSpaceAction
implements BreadcrumbAware
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BreadcrumbGeneratorprotected longprotected Stringprotected PageTemplateprotected PageTemplateprotected PageTemplateManagerFields inherited from class com.atlassian.confluence.spaces.actions.AbstractSpaceAction
key, notificationManager, space, spaceManager, themeManager, wikiStyleRendererFields 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 TypeMethodDescriptionReturns the breadcrumb to be shown when the action is accessed.longlonggetPageTemplateByName(String name) Returns a context which can be passed to web items when rendering them.protected StringbooleanWe should really be splitting up each of the template actions (create, edit, list) and getting them to implement SpaceAdministrative or Administrative to enforce space or global permissions.voidsetBreadcrumbGenerator(BreadcrumbGenerator breadcrumbGenerator) voidsetDraftId(long draftId) voidsetEntityId(long entityId) protected voidvoidsetLabelsString(String labelsString) voidsetPageTemplateManager(PageTemplateManager pageTemplateManager) voidvalidate()Ensure that the size of the labels associated with the template are less than the column size for storing them (255).Methods inherited from class com.atlassian.confluence.spaces.actions.AbstractSpaceAction
getActionSpaceKey, getKey, getPermissionTypes, getSpace, getSpaceKey, getSpaceManager, getSubscribableName, getThemeManager, hasSpaceIA, isPersonalSpace, isUserWatchingSpace, isValidSpaceKey, setKey, setNotificationManager, setSpace, setSpaceManager, setThemeManager, setWikiStyleRendererMethods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addActionMessage, addFieldError, addPermissionTypeTo, addToHistory, doDefault, getActionErrors, getActionMessages, getActionName, getActiveRequest, getActiveResponse, getAuthenticatedUser, getBootstrapStatusProvider, getCancelResult, getDateFormatter, getDefaultTimeZone, getFieldErrors, getGlobalSettings, getHelper, getI18n, getLocale, getMessageHolder, getPermittedEntitiesOf, getPermittedEntitiesOf, getPermittedEntitiesOf, getPreviousLoginDate, getTimeZone, getUserByName, getUserInterfaceState, 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
-
Field Details
-
pageTemplateManager
-
pageTemplate
-
entityId
protected long entityId -
originalPageTemplate
-
labelsString
-
breadcrumbGenerator
-
-
Constructor Details
-
AbstractPageTemplateAction
public AbstractPageTemplateAction()
-
-
Method Details
-
validate
public void validate()Ensure that the size of the labels associated with the template are less than the column size for storing them (255).- Specified by:
validatein interfaceMessageHolderAware- Specified by:
validatein interfaceorg.apache.struts2.Validateable- Overrides:
validatein classorg.apache.struts2.ActionSupport
-
setBreadcrumbGenerator
-
setPageTemplateManager
-
getEntityId
public long getEntityId() -
setEntityId
public void setEntityId(long entityId) -
getDraftId
public long getDraftId() -
setDraftId
public void setDraftId(long draftId) -
getPageTemplate
-
getPageTemplateByName
-
getLabelsString
- Returns:
- the label String that has been set on the action. If there is none then return the label String from the pageTemplate if one has been set.
-
setLabelsString
-
getLabels
-
setLabels
-
isPermitted
public boolean isPermitted()We should really be splitting up each of the template actions (create, edit, list) and getting them to implement SpaceAdministrative or Administrative to enforce space or global permissions.We will determine the permission type required based on the type of template being served or modified If the template id does not exist (ie when we are browsing templates, use the space key to determine permissions
- Overrides:
isPermittedin classAbstractSpaceAction
-
getWebInterfaceContext
Description copied from interface:WebInterfaceReturns a context which can be passed to web items when rendering them.Typically, Struts actions will implement this to provide extra details in the context such as content objects, and so on.
- Specified by:
getWebInterfaceContextin interfaceWebInterface- Overrides:
getWebInterfaceContextin classConfluenceActionSupport
-
globalTemplateSuffix
- Returns:
- returns "-global" if the spacekey is _not_ set, empty string otherwise. Use this suffix to create action results that differentiate between global templates and space templates.
-
getBreadcrumb
Description copied from interface:BreadcrumbAwareReturns the breadcrumb to be shown when the action is accessed.- Specified by:
getBreadcrumbin interfaceBreadcrumbAware- Returns:
- Breadcrumb
-