Class AbstractCreateAndEditPageAction
- java.lang.Object
-
- com.opensymphony.xwork2.ActionSupport
-
- 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
- Direct Known Subclasses:
AbstractCreatePageAction,AbstractEditPageAction,EditorAction
public abstract class AbstractCreateAndEditPageAction extends AbstractTemplatePageAction implements CaptchaAware
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringACTIVITY_UNAVAILABLEprotected CaptchaManagercaptchaManagerprotected CollaborativeEditingHelpercollaborativeEditingHelperprotected DraftManagerdraftManagerprotected DraftServicedraftServiceprotected DraftsTransitionHelperdraftsTransitionHelperprotected HeartbeatManagerheartbeatManagerstatic StringLOCKEDprotected MovePageCommandHelpermovePageCommandHelperprotected StringnewSpaceKeyprotected NotificationManagernotificationManagerprotected PageServicepageServiceprotected PageparentPageprotected longparentPageIdprotected StringparentPageSpaceKeyprotected StringparentPageStringprotected StringparentPageTitleprotected longtargetIdstatic StringUSER_LIMIT_REACHED-
Fields inherited from class com.atlassian.confluence.pages.actions.AbstractTemplatePageAction
pageTemplateManager, templateId
-
Fields inherited from class com.atlassian.confluence.pages.actions.AbstractPreviewPageAction
back, bean, formatConverter, inPreview, preview, storageFormat, wikiStyleRenderer, wysiwygContent
-
Fields inherited from class com.atlassian.confluence.pages.actions.AbstractPageAction
incomingLinks, linkManager, pageManager, PREVIEW, RICHTEXT, viewRenderer, wysiwygConverter
-
Fields inherited from class com.atlassian.confluence.pages.actions.AbstractPageAwareAction
contentPermissionManager, spaceManager
-
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, settingsManager, spacePermissionManager, userAccessor, webInterfaceManager
-
-
Constructor Summary
Constructors Constructor Description AbstractCreateAndEditPageAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected DraftcreateDraft()Deprecated.since 5.10StringdoDefault()Convenient Action execution method which defaults to returning INPUTStringgetCancelResult()CaptchaManagergetCaptchaManager()CollaborativeEditingHelpergetCollaborativeEditingHelper()StringgetConfluenceRevision()AbstractPagegetContentDraft()Return the current draft in use if there is one or null otherwise.protected AbstractPagegetContentObject()abstract StringgetContentType()Returns the content type being created or edited.ContentPermissiongetCurrentEditPermission()ContentPermissiongetCurrentViewPermission()DraftgetDraft()Deprecated.since 5.10 usegetDraftAsCEO()ContentEntityObjectgetDraftAsCEO()Deprecated.since 5.10 only use if still transitioning from legacy drafts, otherwise usegetContentDraft()longgetDraftId()Return the id of the current draft in use if there is one or 0 otherwise.StringgetDraftShareId()longgetEntityId()DraftgetExistingDraft()longgetExistingDraftId()longgetFromPageId()Hack to grab the fromPageId in the AbstractCreatePageAction.protected List<Label>getLabels()Metadata is now retrieved from the existing page, if it exists, otherwise it is stored on the draft (i.e.StringgetLabelsString()protected MovePageCommandgetMovePageCommand()StringgetNewSpaceKey()NotificationManagergetNotificationManager()PagegetParentPage()longgetParentPageId()StringgetParentPageSpaceKey()If the parentPageSpaceKey is set, this function will return the parentPageSpaceKey value.StringgetParentPageString()StringgetParentPageTitle()protected List<String>getPermissionTypes()protected StringgetPosition()StringgetSynchronyRevisionSource()StringgetSyncRev()protected longgetTargetId()StringgetTitle()ListgetViewInheritedContentPermissionSets()WebInterfaceContextgetWebInterfaceContext()Returns a context which can be passed to web items when rendering them.protected booleanhasDraftPermission()booleanhasSetPagePermissionsPermission()booleanisCollaborativeContent()booleanisNewAbstractPage()booleanisRestricted()booleanisShowDraftMessage()booleanisUseDraft()voidsetCaptchaManager(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)voidsetTitle(String title)voidsetUseDraft(boolean useDraft)booleanstartHeartbeatOnDoDefault()This 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 voidvalidateDuplicatePageTitle()-
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractTemplatePageAction
getGlobalPageTemplates, getPageTemplate, getSpacePageTemplates, getTemplateId, isPageTemplatesAvailable, loadTemplates, setPageTemplateManager, setTemplateId
-
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPreviewPageAction
getBean, getContentForSaving, getConversionContext, getEditorFormattedContent, getInPreview, getRenderContext, getStorageFormat, getWysiwygContent, getxHtmlContent, setBack, setFormatConverter, setInPreview, setPreview, setWikiStyleRenderer, setWysiwygContent, updateXHtmlContent
-
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAction
displayDatePath, getAttachmentSourceContent, getAvailableSpaces, getBeanKey, getBlogPost, getEditorVersion, getHelper, getIncomingLinks, getMode, getNextPost, getNumberOfAttachmentsAsString, getNumberOfLabelsAsString, getPermittedChildren, getPostingDate, getPostingDay, getPostingTime, getPreviousPost, getPreviousVersion, getSpaceManager, getSuggestedLabels, getTinyUrl, hasAttachFilePermissions, hasPermittedChildren, isSpaceAdmin, isSuperUser, isUserWatchingOwnContent, setConfluenceWysiwygConverter, setEditorManager, setLinkManager, setMode, setPageManager, setPostingDate, setPostingTime, setViewRenderer
-
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAwareAction
getCustomPageUrl, getFriendlyDateFormatterHelper, getPage, getPageId, getPageUrl, getSpace, getSpaceKey, isLatestVersionRequired, isPageRequired, isPermitted, isViewPermissionRequired, setContentPermissionManager, setPage, setSpaceManager
-
Methods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addActionMessage, addFieldError, addPermissionTypeTo, addToHistory, formatFriendlyDate, getAccessMode, getActionName, getActionName, getAuthenticatedUser, getBootstrapManager, getBootstrapStatusProvider, getCancel, getConfluenceAccessManager, getContentUiSupport, getContext, getCurrentRequest, getCurrentSession, getDateFormatSetting, getDateFormatter, getDefaultResourceBundle, getDefaultTimeZone, getDocBean, getDocLink, getEventManager, getFriendlyDateFormatter, getFrontendServiceURL, getGlobalSettings, 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
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.security.CaptchaAware
mustValidateCaptcha
-
Methods inherited from interface com.opensymphony.xwork2.LocaleProvider
isValidLocale, isValidLocaleString
-
Methods inherited from interface com.atlassian.confluence.pages.actions.PageAware
isEditPermissionRequired
-
-
-
-
Field Detail
-
LOCKED
public static final String LOCKED
- See Also:
- Constant Field Values
-
ACTIVITY_UNAVAILABLE
public static final String ACTIVITY_UNAVAILABLE
- See Also:
- Constant Field Values
-
USER_LIMIT_REACHED
public static final String USER_LIMIT_REACHED
- See Also:
- Constant Field Values
-
parentPageTitle
protected String parentPageTitle
-
parentPageSpaceKey
protected String parentPageSpaceKey
-
parentPage
protected Page parentPage
-
parentPageId
protected long parentPageId
-
newSpaceKey
protected String newSpaceKey
-
parentPageString
protected String parentPageString
-
draftManager
protected DraftManager draftManager
-
draftService
protected DraftService draftService
-
targetId
protected long targetId
-
captchaManager
protected CaptchaManager captchaManager
-
notificationManager
protected NotificationManager notificationManager
-
pageService
protected PageService pageService
-
collaborativeEditingHelper
protected CollaborativeEditingHelper collaborativeEditingHelper
-
draftsTransitionHelper
protected DraftsTransitionHelper draftsTransitionHelper
-
heartbeatManager
protected HeartbeatManager heartbeatManager
-
movePageCommandHelper
protected MovePageCommandHelper movePageCommandHelper
-
-
Method Detail
-
setParentPageId
public void setParentPageId(long parentPageId)
-
getParentPageId
public long getParentPageId()
-
getParentPage
public Page getParentPage()
-
getPermissionTypes
protected List<String> getPermissionTypes()
- Overrides:
getPermissionTypesin classAbstractPageAction
-
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 interfacecom.opensymphony.xwork2.Validateable- Overrides:
validatein classAbstractPreviewPageAction
-
getMovePageCommand
protected MovePageCommand getMovePageCommand()
-
setShowDraftMessage
public void setShowDraftMessage(boolean showDraftMessage)
-
getContentType
public abstract String 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
public String doDefault() throws Exception
Description copied from class:ConfluenceActionSupportConvenient Action execution method which defaults to returning INPUT- Overrides:
doDefaultin classConfluenceActionSupport- Throws:
Exception
-
createDraft
@Deprecated protected Draft createDraft()
Deprecated.since 5.10
-
hasDraftPermission
protected boolean hasDraftPermission()
-
isNewAbstractPage
public boolean isNewAbstractPage()
-
isCollaborativeContent
public boolean isCollaborativeContent()
- Overrides:
isCollaborativeContentin classAbstractPageAwareAction
-
setTitle
public void setTitle(String title)
-
getParentPageTitle
public String getParentPageTitle()
-
setParentPageTitle
public void setParentPageTitle(String parentPageTitle)
-
getParentPageSpaceKey
public String getParentPageSpaceKey()
If the parentPageSpaceKey is set, this function will return the parentPageSpaceKey value. Otherwise it will return the spaceKey of the current Page.
-
setParentPageSpaceKey
public void setParentPageSpaceKey(String parentPageSpaceKey)
-
getCurrentEditPermission
public ContentPermission getCurrentEditPermission()
-
getCurrentViewPermission
public ContentPermission getCurrentViewPermission()
-
hasSetPagePermissionsPermission
public boolean hasSetPagePermissionsPermission()
-
getViewInheritedContentPermissionSets
public List getViewInheritedContentPermissionSets()
-
setLabelsString
public void setLabelsString(String labelsString)
-
getLabelsString
public String getLabelsString()
-
getNewSpaceKey
public String getNewSpaceKey()
-
setNewSpaceKey
public void setNewSpaceKey(String newSpaceKey)
-
getParentPageString
public String getParentPageString()
-
setParentPageString
public void setParentPageString(String parentPageString)
-
setDraftManager
public void setDraftManager(DraftManager draftManager)
-
setDraftService
public void setDraftService(DraftService draftService)
-
isShowDraftMessage
public boolean isShowDraftMessage()
-
setUseDraft
public void setUseDraft(boolean useDraft)
-
getTitle
public String getTitle()
- Overrides:
getTitlein classAbstractPageAwareAction
-
getDraft
@Deprecated public Draft getDraft()
Deprecated.since 5.10 usegetDraftAsCEO()Return the current draft in use if there is one or null otherwise.
-
getDraftAsCEO
@Deprecated public ContentEntityObject 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
public AbstractPage getContentDraft()
Return the current draft in use if there is one or null otherwise.
-
getExistingDraft
public Draft 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.
-
getDraftShareId
public String getDraftShareId()
-
setDraftShareId
public void setDraftShareId(String draftShareId)
-
getSyncRev
public String getSyncRev()
-
getConfluenceRevision
public String getConfluenceRevision()
-
getSynchronyRevisionSource
public String getSynchronyRevisionSource()
-
getContentObject
protected AbstractPage getContentObject()
-
setSyncRev
public void setSyncRev(String syncRev)
-
getEntityId
public long getEntityId()
-
setDraftId
public void setDraftId(long draftId)
-
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 classAbstractPageAction
-
getCancelResult
public String getCancelResult()
- Overrides:
getCancelResultin classConfluenceActionSupport
-
setPermissions
protected void setPermissions(List<ContentPermission> permissions)
-
setPosition
public void setPosition(String position)
-
setTargetId
public void setTargetId(String targetId)
-
getPosition
protected String getPosition()
-
getTargetId
protected long getTargetId()
-
getCaptchaManager
public CaptchaManager getCaptchaManager()
-
setCaptchaManager
public void setCaptchaManager(CaptchaManager captchaManager)
-
setNotificationManager
public void setNotificationManager(NotificationManager notificationManager)
-
getNotificationManager
public NotificationManager getNotificationManager()
-
setPageService
public void setPageService(PageService pageService)
-
setSpaceService
public void setSpaceService(SpaceService spaceService)
-
isUseDraft
public boolean isUseDraft()
-
isRestricted
public boolean isRestricted()
-
getLabels
protected List<Label> 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
public void setCollaborativeEditingHelper(CollaborativeEditingHelper collaborativeEditingHelper)
-
getCollaborativeEditingHelper
public CollaborativeEditingHelper getCollaborativeEditingHelper()
-
setDraftsTransitionHelper
public void setDraftsTransitionHelper(DraftsTransitionHelper draftsTransitionHelper)
-
setHeartbeatManager
public void setHeartbeatManager(HeartbeatManager heartbeatManager)
-
setMovePageCommandHelper
public void setMovePageCommandHelper(MovePageCommandHelper movePageCommandHelper)
-
-