Class AbstractCreateAndEditPageAction
java.lang.Object
org.apache.struts2.ActionSupport
com.opensymphony.xwork2.ActionSupport
com.atlassian.confluence.core.AbstractI18nActionSupport
com.atlassian.confluence.core.ConfluenceActionSupport
com.atlassian.confluence.pages.actions.AbstractPageAwareAction
com.atlassian.confluence.pages.actions.AbstractPageAction
com.atlassian.confluence.pages.actions.AbstractPreviewPageAction
com.atlassian.confluence.pages.actions.AbstractTemplatePageAction
com.atlassian.confluence.pages.actions.AbstractCreateAndEditPageAction
- All Implemented Interfaces:
Beanable,PageAware,TinyUrlAware,WebInterface,CaptchaAware,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:
AbstractCreatePageAction,AbstractEditPageAction,EditorAction
public abstract class AbstractCreateAndEditPageAction
extends AbstractTemplatePageAction
implements CaptchaAware
- 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 TypeFieldDescriptionstatic final Stringprotected CaptchaManagerprotected CollaborativeEditingHelperprotected DraftManagerprotected DraftServiceprotected DraftsTransitionHelperprotected HeartbeatManagerstatic final Stringprotected MovePageCommandHelperprotected Stringprotected NotificationManagerprotected PageServiceprotected Pageprotected longprotected Stringprotected Stringprotected Stringprotected longstatic final StringFields inherited from class com.atlassian.confluence.pages.actions.AbstractTemplatePageAction
pageTemplateManager, templateIdFields inherited from class com.atlassian.confluence.pages.actions.AbstractPreviewPageAction
back, bean, formatConverter, inPreview, preview, storageFormat, wikiStyleRenderer, wysiwygContentFields inherited from class com.atlassian.confluence.pages.actions.AbstractPageAction
incomingLinks, linkManager, pageManager, PREVIEW, RICHTEXT, viewRenderer, wysiwygConverterFields inherited from class com.atlassian.confluence.pages.actions.AbstractPageAwareAction
contentPermissionManager, spaceManagerFields 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, 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 DraftDeprecated.since 5.10Convenient Action execution method which defaults to returning INPUTReturn the current draft in use if there is one or null otherwise.protected AbstractPageabstract StringReturns the content type being created or edited.getDraft()Deprecated.since 5.10 usegetDraftAsCEO()Deprecated.since 5.10 only use if still transitioning from legacy drafts, otherwise usegetContentDraft()longReturn the id of the current draft in use if there is one or 0 otherwise.longlonglongHack to grab the fromPageId in the AbstractCreatePageAction.Metadata is now retrieved from the existing page, if it exists, otherwise it is stored on the draft (i.e.protected MovePageCommandlongIf the parentPageSpaceKey is set, this function will return the parentPageSpaceKey value.protected Stringprotected longgetTitle()Returns a context which can be passed to web items when rendering them.protected booleanbooleanbooleanbooleanbooleanbooleanbooleanvoidsetCaptchaManager(CaptchaManager captchaManager) voidsetCollaborativeEditingHelper(CollaborativeEditingHelper collaborativeEditingHelper) voidsetDraftId(long draftId) voidsetDraftManager(DraftManager draftManager) voidsetDraftService(DraftService draftService) voidsetDraftShareId(String draftShareId) voidsetDraftsTransitionHelper(DraftsTransitionHelper draftsTransitionHelper) voidsetHeartbeatManager(HeartbeatManager heartbeatManager) voidsetLabelsString(String labelsString) voidsetLabelsString(List<Label> labels) voidsetMovePageCommandHelper(MovePageCommandHelper movePageCommandHelper) voidsetNewSpaceKey(String newSpaceKey) voidsetNotificationManager(NotificationManager notificationManager) voidsetPageService(PageService pageService) voidsetParentPageId(long parentPageId) voidsetParentPageSpaceKey(String parentPageSpaceKey) voidsetParentPageString(String parentPageString) voidsetParentPageTitle(String parentPageTitle) protected voidsetPermissions(List<ContentPermission> permissions) voidsetPosition(String position) voidsetShowDraftMessage(boolean showDraftMessage) voidsetSpaceService(SpaceService spaceService) voidsetSyncRev(String syncRev) voidsetTargetId(String targetId) voidvoidsetUseDraft(boolean useDraft) voidsetXsrfTokenGenerator(com.atlassian.struts.xsrf.XsrfTokenGenerator xsrfTokenGenerator) voidsetXsrfTokenGenerator(com.atlassian.xwork.XsrfTokenGenerator xsrfTokenGenerator) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3, usesetXsrfTokenGenerator(XsrfTokenGenerator)instead.booleanThis method determines whether the current action should start an activity on the HeartbeatManager.voidvalidate()Convert the editor content to storageFormat, catching and reporting any problems in the process.protected voidMethods inherited from class com.atlassian.confluence.pages.actions.AbstractTemplatePageAction
getGlobalPageTemplates, getPageTemplate, getSpacePageTemplates, getTemplateId, isPageTemplatesAvailable, loadTemplates, setPageTemplateManager, setTemplateIdMethods inherited from class com.atlassian.confluence.pages.actions.AbstractPreviewPageAction
getBean, getContentForSaving, getConversionContext, getEditorFormattedContent, getInPreview, getRenderContext, getStorageFormat, getWysiwygContent, getxHtmlContent, setBack, setFormatConverter, setInPreview, setPreview, setWikiStyleRenderer, setWysiwygContent, updateXHtmlContentMethods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAction
displayDatePath, getAttachmentSourceContent, getAvailableSpaces, getBeanKey, getBlogPost, getEditorVersion, getHelper, getIncomingLinks, getMode, getNextPost, getNumberOfAttachmentsAsString, getNumberOfLabelsAsString, getPermittedChildren, getPostingDateAsDate, getPostingDay, getPostingTimeAsTime, getPreviousPost, getPreviousVersion, getSpaceManager, getSuggestedLabels, getTinyUrl, hasAttachFilePermissions, hasPermittedChildren, isSpaceAdmin, isSuperUser, isUserWatchingOwnContent, setConfluenceWysiwygConverter, setEditorManager, setLinkManager, setMode, setPageManager, setPostingDate, setPostingTime, setViewRendererMethods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAwareAction
getCustomPageUrl, getPage, getPageId, getPageUrl, getSpace, getSpaceKey, isLatestVersionRequired, isPageRequired, isPermitted, isViewPermissionRequired, setContentPermissionManager, setPage, setSpaceManagerMethods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addActionMessage, addFieldError, addPermissionTypeTo, addToHistory, getActionErrors, getActionMessages, getActionName, getAuthenticatedUser, getBootstrapStatusProvider, getCurrentRequest, getCurrentResponse, getDateFormatter, getDefaultTimeZone, getFieldErrors, getGlobalSettings, 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, setSkipIsPermitted, setSpacePermissionManager, setStrutsHelper, setSystemInformationService, setTimeZoneManager, setUserAccessor, setWebInterfaceManager, shouldSkipIsPermittedMethods 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, toLocaleMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.struts2.action.Action
executeMethods inherited from interface com.atlassian.confluence.security.CaptchaAware
mustValidateCaptchaMethods inherited from interface com.atlassian.confluence.pages.actions.PageAware
isEditPermissionRequiredMethods inherited from interface org.apache.struts2.interceptor.ValidationAware
addActionError, addActionMessage, addFieldError, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors
-
Field Details
-
LOCKED
- See Also:
-
ACTIVITY_UNAVAILABLE
- See Also:
-
USER_LIMIT_REACHED
- See Also:
-
parentPageTitle
-
parentPageSpaceKey
-
parentPage
-
parentPageId
protected long parentPageId -
newSpaceKey
-
parentPageString
-
draftManager
-
draftService
-
targetId
protected long targetId -
captchaManager
-
notificationManager
-
pageService
-
collaborativeEditingHelper
-
draftsTransitionHelper
-
heartbeatManager
-
movePageCommandHelper
-
-
Constructor Details
-
AbstractCreateAndEditPageAction
public AbstractCreateAndEditPageAction()
-
-
Method Details
-
setParentPageId
public void setParentPageId(long parentPageId) -
getParentPageId
public long getParentPageId() -
getParentPage
-
getPermissionTypes
- Overrides:
getPermissionTypesin classAbstractPageAction- See Also:
-
validateDuplicatePageTitle
protected void validateDuplicatePageTitle() -
validate
public void validate()Description copied from class:AbstractPreviewPageActionConvert the editor content to storageFormat, catching and reporting any problems in the process. On successful validation, the storageFormat field will be populated with a storage format representation of the editor content, ready for saving.- Specified by:
validatein interfaceMessageHolderAware- Specified by:
validatein interfaceorg.apache.struts2.Validateable- Overrides:
validatein classAbstractPreviewPageAction
-
getMovePageCommand
-
setShowDraftMessage
public void setShowDraftMessage(boolean showDraftMessage) -
getContentType
Returns the content type being created or edited. e.g. "page", "blogpost" -
getFromPageId
public long getFromPageId()Hack to grab the fromPageId in the AbstractCreatePageAction. This is required so that we can create shared drafts with the correct parent page. This method is overridden in AbstractCreatePageAction which is the only place where fromPageId should be defined.- Returns:
- The page referenced by the fromPageId provided in the action call
-
startHeartbeatOnDoDefault
@Internal public boolean startHeartbeatOnDoDefault()This method determines whether the current action should start an activity on the HeartbeatManager. In most cases this should be left as true since we would like to track user activity in the editor. Only override this method if you know exactly what you doing.- Returns:
- boolean indicating whether activity should be started via the HeartbeatManager
-
doDefault
Description copied from class:ConfluenceActionSupportConvenient Action execution method which defaults to returning INPUT- Overrides:
doDefaultin classConfluenceActionSupport- Throws:
Exception
-
createDraft
Deprecated.since 5.10 -
hasDraftPermission
protected boolean hasDraftPermission() -
isNewAbstractPage
public boolean isNewAbstractPage() -
isCollaborativeContent
public boolean isCollaborativeContent()- Overrides:
isCollaborativeContentin classAbstractPageAwareAction
-
setTitle
-
getParentPageTitle
-
setParentPageTitle
-
getParentPageSpaceKey
If the parentPageSpaceKey is set, this function will return the parentPageSpaceKey value. Otherwise it will return the spaceKey of the current Page. -
setParentPageSpaceKey
-
getCurrentEditPermission
-
getCurrentViewPermission
-
hasSetPagePermissionsPermission
public boolean hasSetPagePermissionsPermission() -
getViewInheritedContentPermissionSets
-
setLabelsString
-
setLabelsString
-
getLabelsString
-
getNewSpaceKey
-
setNewSpaceKey
-
getParentPageString
-
setParentPageString
-
setDraftManager
-
setDraftService
-
isShowDraftMessage
public boolean isShowDraftMessage() -
setUseDraft
public void setUseDraft(boolean useDraft) -
getTitle
- Overrides:
getTitlein classAbstractPageAwareAction
-
getDraft
Deprecated.since 5.10 usegetDraftAsCEO()Return the current draft in use if there is one or null otherwise. -
getDraftAsCEO
Deprecated.since 5.10 only use if still transitioning from legacy drafts, otherwise usegetContentDraft()Return the current draft in use if there is one or null otherwise. -
getContentDraft
Return the current draft in use if there is one or null otherwise. -
getExistingDraft
-
getExistingDraftId
public long getExistingDraftId() -
getDraftId
public long getDraftId()Return the id of the current draft in use if there is one or 0 otherwise. -
getSyncRev
-
getConfluenceRevision
-
getSynchronyRevisionSource
-
getContentObject
-
setSyncRev
-
getEntityId
public long getEntityId() -
setDraftId
public void setDraftId(long draftId) -
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 classAbstractPageAction
-
getCancelResult
- Overrides:
getCancelResultin classConfluenceActionSupport
-
setPermissions
-
setPosition
-
setTargetId
-
getPosition
-
getTargetId
protected long getTargetId() -
getCaptchaManager
-
setCaptchaManager
-
setNotificationManager
-
getNotificationManager
-
setPageService
-
setSpaceService
-
isUseDraft
public boolean isUseDraft() -
isRestricted
public boolean isRestricted() -
getLabels
Metadata is now retrieved from the existing page, if it exists, otherwise it is stored on the draft (i.e. if the draft has never been published)- Overrides:
getLabelsin classAbstractPageAction- Returns:
- List of labels visible to the current user
-
setCollaborativeEditingHelper
-
getCollaborativeEditingHelper
-
setDraftsTransitionHelper
-
setHeartbeatManager
-
setMovePageCommandHelper
-
getXsrfToken
-
setXsrfTokenGenerator
public void setXsrfTokenGenerator(com.atlassian.struts.xsrf.XsrfTokenGenerator xsrfTokenGenerator) -
setXsrfTokenGenerator
@Deprecated(forRemoval=true, since="9.3") public void setXsrfTokenGenerator(com.atlassian.xwork.XsrfTokenGenerator xsrfTokenGenerator) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3, usesetXsrfTokenGenerator(XsrfTokenGenerator)instead.
-