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 String
ACTIVITY_UNAVAILABLE
protected CaptchaManager
captchaManager
protected CollaborativeEditingHelper
collaborativeEditingHelper
protected DraftManager
draftManager
protected DraftService
draftService
protected DraftsTransitionHelper
draftsTransitionHelper
protected HeartbeatManager
heartbeatManager
static String
LOCKED
protected MovePageCommandHelper
movePageCommandHelper
protected String
newSpaceKey
protected NotificationManager
notificationManager
protected PageService
pageService
protected Page
parentPage
protected long
parentPageId
protected String
parentPageSpaceKey
protected String
parentPageString
protected String
parentPageTitle
protected long
targetId
static String
USER_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, systemInformationService, 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 Draft
createDraft()
Deprecated.since 5.10String
doDefault()
Convenient Action execution method which defaults to returning INPUTString
getCancelResult()
CaptchaManager
getCaptchaManager()
CollaborativeEditingHelper
getCollaborativeEditingHelper()
String
getConfluenceRevision()
AbstractPage
getContentDraft()
Return the current draft in use if there is one or null otherwise.protected AbstractPage
getContentObject()
abstract String
getContentType()
Returns the content type being created or edited.ContentPermission
getCurrentEditPermission()
ContentPermission
getCurrentViewPermission()
Draft
getDraft()
Deprecated.since 5.10 usegetDraftAsCEO()
ContentEntityObject
getDraftAsCEO()
Deprecated.since 5.10 only use if still transitioning from legacy drafts, otherwise usegetContentDraft()
long
getDraftId()
Return the id of the current draft in use if there is one or 0 otherwise.String
getDraftShareId()
long
getEntityId()
Draft
getExistingDraft()
long
getExistingDraftId()
long
getFromPageId()
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.String
getLabelsString()
protected MovePageCommand
getMovePageCommand()
String
getNewSpaceKey()
NotificationManager
getNotificationManager()
Page
getParentPage()
long
getParentPageId()
String
getParentPageSpaceKey()
If the parentPageSpaceKey is set, this function will return the parentPageSpaceKey value.String
getParentPageString()
String
getParentPageTitle()
protected List<String>
getPermissionTypes()
protected String
getPosition()
String
getSynchronyRevisionSource()
String
getSyncRev()
protected long
getTargetId()
String
getTitle()
List
getViewInheritedContentPermissionSets()
WebInterfaceContext
getWebInterfaceContext()
Returns a context which can be passed to web items when rendering them.protected boolean
hasDraftPermission()
boolean
hasSetPagePermissionsPermission()
boolean
isCollaborativeContent()
boolean
isNewAbstractPage()
boolean
isRestricted()
boolean
isShowDraftMessage()
boolean
isUseDraft()
void
setCaptchaManager(CaptchaManager captchaManager)
void
setCollaborativeEditingHelper(CollaborativeEditingHelper collaborativeEditingHelper)
void
setDraftId(long draftId)
void
setDraftManager(DraftManager draftManager)
void
setDraftService(DraftService draftService)
void
setDraftShareId(String draftShareId)
void
setDraftsTransitionHelper(DraftsTransitionHelper draftsTransitionHelper)
void
setHeartbeatManager(HeartbeatManager heartbeatManager)
void
setLabelsString(String labelsString)
void
setLabelsString(List<Label> labels)
void
setMovePageCommandHelper(MovePageCommandHelper movePageCommandHelper)
void
setNewSpaceKey(String newSpaceKey)
void
setNotificationManager(NotificationManager notificationManager)
void
setPageService(PageService pageService)
void
setParentPageId(long parentPageId)
void
setParentPageSpaceKey(String parentPageSpaceKey)
void
setParentPageString(String parentPageString)
void
setParentPageTitle(String parentPageTitle)
protected void
setPermissions(List<ContentPermission> permissions)
void
setPosition(String position)
void
setShowDraftMessage(boolean showDraftMessage)
void
setSpaceService(SpaceService spaceService)
void
setSyncRev(String syncRev)
void
setTargetId(String targetId)
void
setTitle(String title)
void
setUseDraft(boolean useDraft)
boolean
startHeartbeatOnDoDefault()
This method determines whether the current action should start an activity on the HeartbeatManager.void
validate()
Convert the editor content to storageFormat, catching and reporting any problems in the process.protected void
validateDuplicatePageTitle()
-
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, getPostingDateAsDate, getPostingDay, getPostingTimeAsTime, 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, setBootstrapStatusProvider, 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
-
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:
getPermissionTypes
in classAbstractPageAction
-
validateDuplicatePageTitle
protected void validateDuplicatePageTitle()
-
validate
public void validate()
Description copied from class:AbstractPreviewPageAction
Convert 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:
validate
in interfaceMessageHolderAware
- Specified by:
validate
in interfacecom.opensymphony.xwork2.Validateable
- Overrides:
validate
in 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:ConfluenceActionSupport
Convenient Action execution method which defaults to returning INPUT- Overrides:
doDefault
in 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:
isCollaborativeContent
in 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:
getTitle
in 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: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 classAbstractPageAction
-
getCancelResult
public String getCancelResult()
- Overrides:
getCancelResult
in 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:
getLabels
in 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)
-
-