Class AbstractCreatePageAction
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
com.atlassian.confluence.pages.actions.AbstractCreatePageAction
- All Implemented Interfaces:
Beanable
,PageAware
,TinyUrlAware
,WebInterface
,CaptchaAware
,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
,org.apache.struts2.action.Action
,org.apache.struts2.interceptor.ValidationAware
,org.apache.struts2.Validateable
- Direct Known Subclasses:
CreateBlogPostAction
,CreatePageAction
public abstract class AbstractCreatePageAction
extends AbstractCreateAndEditPageAction
implements Spaced, BreadcrumbAware
Functions shared between creating pages and blog posts.
- 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 TypeFieldDescriptionprotected AttachmentManager
protected BreadcrumbGenerator
protected final StringParsingContextProvider
static final String
protected String
To get back to the correct place if creation gets cancelled.protected Space
protected ThemeManager
Fields inherited from class com.atlassian.confluence.pages.actions.AbstractCreateAndEditPageAction
ACTIVITY_UNAVAILABLE, captchaManager, collaborativeEditingHelper, draftManager, draftService, draftsTransitionHelper, heartbeatManager, LOCKED, movePageCommandHelper, newSpaceKey, notificationManager, pageService, parentPage, parentPageId, parentPageSpaceKey, parentPageString, parentPageTitle, targetId, 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, 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 String
afterAdd()
Common processing to be performed by all subclasses after the add operation.protected void
assignParentPage
(ContentEntityObject page, Page parentPage) protected void
assignSpace
(ContentEntityObject draft, Space space) protected String
Common processing to be performed by all subclasses prior to performing the add.void
Create the CEO to be saved from the data supplied to the action.doAdd()
Convenient Action execution method which defaults to returning INPUTReturns theConfluenceEntityObject
that contains attachments relevant to the current action.Returns the breadcrumb to be shown when the action is accessed.protected abstract CommandActionHelper
protected Breadcrumb
Returns the content type being created or edited.protected abstract AbstractPage
long
Hack to grab the fromPageId in the AbstractCreatePageAction.protected abstract AbstractPage
getSpace()
boolean
protected abstract void
initialiseProvider
(AbstractPage abstractPage) boolean
If the action requires that the page be set before being run, then it should return true to this method.protected void
void
setAttachmentManager
(AttachmentManager attachmentManager) void
setBreadcrumbGenerator
(BreadcrumbGenerator breadcrumbGenerator) void
setFromPage
(Page fromPage) void
setFromPageId
(long fromPageId) void
setOriginalReferrer
(String originalReferrer) void
setQueryString
(String queryString) void
setSpaceKey
(String spaceKey) void
setThemeManager
(ThemeManager themeManager) void
setTitleWritten
(String titleWritten) protected void
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractCreateAndEditPageAction
createDraft, getCaptchaManager, getCollaborativeEditingHelper, getConfluenceRevision, getContentDraft, getContentObject, getCurrentEditPermission, getCurrentViewPermission, getDraft, getDraftAsCEO, getDraftId, getDraftShareId, getEntityId, getExistingDraft, getExistingDraftId, getLabels, getLabelsString, getMovePageCommand, getNewSpaceKey, getNotificationManager, getParentPage, getParentPageId, getParentPageSpaceKey, getParentPageString, getParentPageTitle, getPermissionTypes, getPosition, getSynchronyRevisionSource, getSyncRev, getTargetId, getTitle, getViewInheritedContentPermissionSets, getWebInterfaceContext, getXsrfToken, hasDraftPermission, isCollaborativeContent, isNewAbstractPage, isRestricted, isShowDraftMessage, isUseDraft, setCaptchaManager, setCollaborativeEditingHelper, setDraftId, setDraftManager, setDraftService, setDraftShareId, setDraftsTransitionHelper, setHeartbeatManager, setLabelsString, setLabelsString, setMovePageCommandHelper, setNewSpaceKey, setNotificationManager, setPageService, setParentPageId, setParentPageSpaceKey, setParentPageString, setParentPageTitle, setPermissions, setPosition, setShowDraftMessage, setSpaceService, setSyncRev, setTargetId, setTitle, setUseDraft, setXsrfTokenGenerator, setXsrfTokenGenerator, startHeartbeatOnDoDefault, validate, 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, 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, isLatestVersionRequired, 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
-
INPUT_VARIABLES
- See Also:
-
space
-
attachmentManager
-
themeManager
-
breadcrumbGenerator
-
contextProvider
-
originalReferrer
To get back to the correct place if creation gets cancelled. Specially important for integrations like Service Desk
-
-
Constructor Details
-
AbstractCreatePageAction
public AbstractCreatePageAction()
-
-
Method Details
-
setSpaceKey
-
getSpaceKey
- Overrides:
getSpaceKey
in classAbstractPageAwareAction
-
getSpace
- Specified by:
getSpace
in interfaceSpaced
- Overrides:
getSpace
in classAbstractPageAwareAction
-
getNewSpace
- Returns:
- the space referenced by the newSpaceKey property, or null if there is none or it cannot be found.
-
doDefault
Description copied from class:ConfluenceActionSupport
Convenient Action execution method which defaults to returning INPUT- Overrides:
doDefault
in classAbstractCreateAndEditPageAction
- Throws:
Exception
-
beforeAdd
Common processing to be performed by all subclasses prior to performing the add.- Returns:
Action.SUCCESS
if successful. Any other return value means the add operation should not proceed.- Throws:
Exception
-
doAdd
- Throws:
Exception
-
populateContextProvider
protected void populateContextProvider() -
assignSpace
-
assignParentPage
-
getCreatedAbstractPage
-
getCommandActionHelper
-
initialiseProvider
-
afterAdd
Common processing to be performed by all subclasses after the add operation.- Returns:
Action.SUCCESS
if successful. Any other return value means a failure.
-
transferDraftAttachments
protected void transferDraftAttachments() -
createPage
Create the CEO to be saved from the data supplied to the action.- Throws:
IOException
XhtmlException
-
getPageToCreate
-
isPageRequired
public boolean isPageRequired()Description copied from interface:PageAware
If the action requires that the page be set before being run, then it should return true to this method. If the action requires a page, but no page is available, then the interceptor will automatically redirect to the 'pagenotfound' result- Specified by:
isPageRequired
in interfacePageAware
- Overrides:
isPageRequired
in classAbstractPageAwareAction
- Returns:
- true if the action requires a page in order to execute
-
setFromPageId
public void setFromPageId(long fromPageId) -
getFromPageId
public long getFromPageId()Description copied from class:AbstractCreateAndEditPageAction
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.- Overrides:
getFromPageId
in classAbstractCreateAndEditPageAction
- Returns:
- The page referenced by the fromPageId provided in the action call
-
getFromPage
-
setFromPage
-
getAttachmentSourceContent
Description copied from class:AbstractPageAction
Returns theConfluenceEntityObject
that contains attachments relevant to the current action. E.g.:- The
AbstractPage
being viewed or edited. - The
Draft
of theAbstractPage
being created - The
AbstractPage
to which theComment
being created/edited belongs
- Overrides:
getAttachmentSourceContent
in classAbstractPageAction
- The
-
getCancelRedirectUrl
-
getContentType
Description copied from class:AbstractCreateAndEditPageAction
Returns the content type being created or edited. e.g. "page", "blogpost"- Specified by:
getContentType
in classAbstractCreateAndEditPageAction
-
hasSetPagePermissionsPermission
public boolean hasSetPagePermissionsPermission()- Overrides:
hasSetPagePermissionsPermission
in classAbstractCreateAndEditPageAction
-
setTitleWritten
-
setAttachmentManager
-
setThemeManager
-
getCancelResult
- Overrides:
getCancelResult
in classAbstractCreateAndEditPageAction
-
setBreadcrumbGenerator
-
getBreadcrumb
Description copied from interface:BreadcrumbAware
Returns the breadcrumb to be shown when the action is accessed.- Specified by:
getBreadcrumb
in interfaceBreadcrumbAware
- Returns:
- Breadcrumb
-
getContentBreadcrumb
-
setQueryString
-
getQueryString
-
getOriginalReferrer
-
setOriginalReferrer
-