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 String
protected CaptchaManager
protected CollaborativeEditingHelper
protected DraftManager
protected DraftService
protected DraftsTransitionHelper
protected HeartbeatManager
static final String
protected MovePageCommandHelper
protected String
protected NotificationManager
protected PageService
protected Page
protected long
protected String
protected String
protected String
protected long
static final String
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, confluenceAccessManager, contentUiSupport, eventPublisher, formatSettingsManager, globalSettingsManager, i18NBeanFactory, labelManager, languageManager, LICENSE_EXPIRED, LICENSE_USERS_EXCEEDED, localeManager, loginManager, messageHolder, permissionManager, pluginAccessor, request, response, spacePermissionManager, strutsHelper, systemInformationService, userAccessor, webInterfaceManager
Fields inherited from class org.apache.struts2.ActionSupport
container
Fields inherited from interface org.apache.struts2.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Draft
Deprecated.since 5.10Convenient Action execution method which defaults to returning INPUTReturn the current draft in use if there is one or null otherwise.protected AbstractPage
abstract String
Returns 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()
long
Return the id of the current draft in use if there is one or 0 otherwise.long
long
long
Hack 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 MovePageCommand
long
If the parentPageSpaceKey is set, this function will return the parentPageSpaceKey value.protected String
protected long
getTitle()
Returns a context which can be passed to web items when rendering them.protected boolean
boolean
boolean
boolean
boolean
boolean
boolean
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
void
setUseDraft
(boolean useDraft) void
setXsrfTokenGenerator
(com.atlassian.struts.xsrf.XsrfTokenGenerator xsrfTokenGenerator) 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.boolean
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
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, 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, 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, shouldSkipIsPermitted
Methods inherited from class com.atlassian.confluence.core.AbstractI18nActionSupport
getText, getText, getText, getText, getText, getText, getText, getText, getTextStrict
Methods 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, toLocale
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.struts2.action.Action
execute
Methods inherited from interface com.atlassian.confluence.security.CaptchaAware
mustValidateCaptcha
Methods inherited from interface com.atlassian.confluence.pages.actions.PageAware
isEditPermissionRequired
Methods 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:
getPermissionTypes
in classAbstractPageAction
- See Also:
-
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 interfaceorg.apache.struts2.Validateable
- Overrides:
validate
in 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:ConfluenceActionSupport
Convenient Action execution method which defaults to returning INPUT- Overrides:
doDefault
in classConfluenceActionSupport
- Throws:
Exception
-
createDraft
Deprecated.since 5.10 -
hasDraftPermission
protected boolean hasDraftPermission() -
isNewAbstractPage
public boolean isNewAbstractPage() -
isCollaborativeContent
public boolean isCollaborativeContent()- Overrides:
isCollaborativeContent
in 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:
getTitle
in 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: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
- Overrides:
getCancelResult
in 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:
getLabels
in 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.
-