Class AbstractPageTemplateAction
- java.lang.Object
-
- com.opensymphony.xwork2.ActionSupport
-
- 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,com.opensymphony.xwork2.Action,com.opensymphony.xwork2.interceptor.ValidationAware,com.opensymphony.xwork2.LocaleProvider,com.opensymphony.xwork2.TextProvider,com.opensymphony.xwork2.Validateable,Serializable
- Direct Known Subclasses:
AbstractEditPageTemplateAction,EditPageTemplateDescriptionAction,ListPageTemplatesAction,RemovePageTemplateAction,ViewPageTemplateAction
public abstract class AbstractPageTemplateAction extends AbstractSpaceAction implements BreadcrumbAware
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BreadcrumbGeneratorbreadcrumbGeneratorprotected longentityIdprotected StringlabelsStringprotected PageTemplateoriginalPageTemplateprotected PageTemplatepageTemplateprotected PageTemplateManagerpageTemplateManager-
Fields inherited from class com.atlassian.confluence.spaces.actions.AbstractSpaceAction
key, notificationManager, space, spaceManager, themeManager, wikiStyleRenderer
-
Fields inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
accessModeService, CANCEL, DEVMODE, eventManager, i18NBeanFactory, labelManager, languageManager, LICENSE_EXPIRED, LICENSE_USERS_EXCEEDED, messageHolder, permissionManager, permitted, personService, pluginAccessor, PREVIEW, settingsManager, spacePermissionManager, userAccessor, webInterfaceManager
-
-
Constructor Summary
Constructors Constructor Description AbstractPageTemplateAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BreadcrumbgetBreadcrumb()Returns the breadcrumb to be shown when the action is accessed.longgetDraftId()longgetEntityId()List<Label>getLabels()StringgetLabelsString()PageTemplategetPageTemplate()PageTemplategetPageTemplateByName(String name)WebInterfaceContextgetWebInterfaceContext()Returns a context which can be passed to web items when rendering them.protected StringglobalTemplateSuffix()booleanisPermitted()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.voidsetBreadcrumbGenerator(BreadcrumbGenerator breadcrumbGenerator)voidsetDraftId(long draftId)voidsetEntityId(long entityId)protected voidsetLabels(List<Label> labels)voidsetLabelsString(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
getKey, getPermissionTypes, getSpace, getSpaceKey, getSubscribableName, getThemeManager, hasSpaceIA, isPersonalSpace, isUserWatchingSpace, isValidSpaceKey, setKey, setNotificationManager, setSpace, setSpaceManager, setThemeManager, setWikiStyleRenderer
-
Methods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addActionMessage, addFieldError, addPermissionTypeTo, addToHistory, doDefault, formatFriendlyDate, getAccessMode, getActionName, getActionName, getAuthenticatedUser, getBootstrapManager, getBootstrapStatusProvider, getCancel, getCancelResult, getConfluenceAccessManager, getContext, getCurrentRequest, getCurrentSession, getDateFormatSetting, getDateFormatter, getDefaultResourceBundle, getDefaultTimeZone, getDocLink, getEventManager, getFriendlyDateFormatter, getFrontendServiceURL, getGlobalSettings, getHelper, getI18n, getInstalledLanguages, getLabelManager, getLanguageJs, getLanguageManager, getLanguageUserFriendly, getLocale, getLocaleManager, getLocaleString, getMessageHolder, getNiceContentType, getPermissionManager, getPermittedEntitiesOf, getPermittedEntitiesOf, getPermittedEntitiesOf, getPersonService, getPreviousLoginDate, getRemoteUser, getSession, getSystemInformationService, getText, getText, getText, getText, getText, getText, getText, getText, getTextStatic, getTextStatic, getTextStrict, getTimeZone, getUserAccessor, getUserByName, getUserFullName, getUserHasBrowseUsersPermission, getUserHasLicensedAccess, getUserInterfaceState, getUserLocaleDefaultDatePattern, getUserProfilePicUrl, getWebInterfaceManager, hasPermissionForSpace, isAnonymousUser, isCanceled, isDevMode, isEmailVisible, isExternalUserManagementEnabled, isLabelable, isPrintableVersion, isSkipAccessCheck, isUserStatusPluginEnabled, isUsingH2, isUsingHSQL, setAccessModeService, setApiDateFormatService, setApiPersonService, setBootstrapManager, setCancel, setConfluenceAccessManager, setContentUiSupport, setEventManager, setFormatSettingsManager, setI18NBean, setI18NBeanFactory, setLabelManager, setLanguageManager, setLocaleManager, setLoginManager, setMessageHolder, setPermissionManager, setPluginAccessor, setPreviousLoginDate, setServletRequestSupplier, setSettingsManager, setSkipAccessCheck, setSpacePermissionManager, setSystemInformationService, setTimeZoneManager, setUserAccessor, setWebInterfaceManager, withServletRequestSupplier
-
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, execute, getActionErrors, getActionMessages, getContainer, getFieldErrors, getFormatted, getLocaleProvider, getText, getText, getTextProvider, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors
-
-
-
-
Field Detail
-
pageTemplateManager
protected PageTemplateManager pageTemplateManager
-
pageTemplate
protected PageTemplate pageTemplate
-
entityId
protected long entityId
-
originalPageTemplate
protected PageTemplate originalPageTemplate
-
labelsString
protected String labelsString
-
breadcrumbGenerator
protected BreadcrumbGenerator breadcrumbGenerator
-
-
Method Detail
-
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 interfacecom.opensymphony.xwork2.Validateable- Overrides:
validatein classcom.opensymphony.xwork2.ActionSupport
-
setBreadcrumbGenerator
public void setBreadcrumbGenerator(BreadcrumbGenerator breadcrumbGenerator)
-
setPageTemplateManager
public void setPageTemplateManager(PageTemplateManager pageTemplateManager)
-
getEntityId
public long getEntityId()
-
setEntityId
public void setEntityId(long entityId)
-
getDraftId
public long getDraftId()
-
setDraftId
public void setDraftId(long draftId)
-
getPageTemplate
public PageTemplate getPageTemplate()
-
getPageTemplateByName
public PageTemplate getPageTemplateByName(String name)
-
getLabelsString
public String 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
public void setLabelsString(String labelsString)
-
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
public WebInterfaceContext 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
protected String 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
public Breadcrumb getBreadcrumb()
Description copied from interface:BreadcrumbAwareReturns the breadcrumb to be shown when the action is accessed.- Specified by:
getBreadcrumbin interfaceBreadcrumbAware- Returns:
- Breadcrumb
-
-