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 BreadcrumbGenerator
breadcrumbGenerator
protected long
entityId
protected String
labelsString
protected PageTemplate
originalPageTemplate
protected PageTemplate
pageTemplate
protected PageTemplateManager
pageTemplateManager
-
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, systemInformationService, userAccessor, webInterfaceManager
-
-
Constructor Summary
Constructors Constructor Description AbstractPageTemplateAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Breadcrumb
getBreadcrumb()
Returns the breadcrumb to be shown when the action is accessed.long
getDraftId()
long
getEntityId()
List<Label>
getLabels()
String
getLabelsString()
PageTemplate
getPageTemplate()
PageTemplate
getPageTemplateByName(String name)
WebInterfaceContext
getWebInterfaceContext()
Returns a context which can be passed to web items when rendering them.protected String
globalTemplateSuffix()
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.void
setBreadcrumbGenerator(BreadcrumbGenerator breadcrumbGenerator)
void
setDraftId(long draftId)
void
setEntityId(long entityId)
protected void
setLabels(List<Label> labels)
void
setLabelsString(String labelsString)
void
setPageTemplateManager(PageTemplateManager pageTemplateManager)
void
validate()
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, 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, getContentUiSupport, getContext, getCurrentRequest, getCurrentSession, getDateFormatSetting, getDateFormatter, getDefaultResourceBundle, getDefaultTimeZone, getDocBean, 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, setSpacePermissionManager, setSystemInformationService, setTimeZoneManager, setUserAccessor, setWebInterfaceManager, useSkipAccessCheck, 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:
validate
in interfaceMessageHolderAware
- Specified by:
validate
in interfacecom.opensymphony.xwork2.Validateable
- Overrides:
validate
in 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:
isPermitted
in classAbstractSpaceAction
-
getWebInterfaceContext
public WebInterfaceContext getWebInterfaceContext()
Description copied from interface:WebInterface
Returns 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:
getWebInterfaceContext
in interfaceWebInterface
- Overrides:
getWebInterfaceContext
in 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:BreadcrumbAware
Returns the breadcrumb to be shown when the action is accessed.- Specified by:
getBreadcrumb
in interfaceBreadcrumbAware
- Returns:
- Breadcrumb
-
-