Class AbstractCreatePageAction
- 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
-
- 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
- Direct Known Subclasses:
CreateBlogPostAction
,CreatePageAction
public abstract class AbstractCreatePageAction extends AbstractCreateAndEditPageAction implements Spaced, BreadcrumbAware
Functions shared between creating pages and blog posts.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AttachmentManager
attachmentManager
protected BreadcrumbGenerator
breadcrumbGenerator
protected StringParsingContextProvider
contextProvider
static String
INPUT_VARIABLES
protected String
originalReferrer
To get back to the correct place if creation gets cancelled.protected Space
space
protected ThemeManager
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, 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 AbstractCreatePageAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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
beforeAdd()
Common processing to be performed by all subclasses prior to performing the add.void
createPage()
Create the CEO to be saved from the data supplied to the action.String
doAdd()
String
doDefault()
Convenient Action execution method which defaults to returning INPUTContentEntityObject
getAttachmentSourceContent()
Returns theConfluenceEntityObject
that contains attachments relevant to the current action.Breadcrumb
getBreadcrumb()
Returns the breadcrumb to be shown when the action is accessed.String
getCancelRedirectUrl()
String
getCancelResult()
protected abstract CommandActionHelper
getCommandActionHelper()
protected Breadcrumb
getContentBreadcrumb()
String
getContentType()
Returns the content type being created or edited.protected abstract AbstractPage
getCreatedAbstractPage()
Page
getFromPage()
long
getFromPageId()
Hack to grab the fromPageId in the AbstractCreatePageAction.Space
getNewSpace()
String
getOriginalReferrer()
protected abstract AbstractPage
getPageToCreate()
String
getQueryString()
Space
getSpace()
String
getSpaceKey()
boolean
hasSetPagePermissionsPermission()
protected abstract void
initialiseProvider(AbstractPage abstractPage)
boolean
isPageRequired()
If the action requires that the page be set before being run, then it should return true to this method.protected void
populateContextProvider()
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
transferDraftAttachments()
-
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, 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, 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, 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, isLatestVersionRequired, 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, 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
-
INPUT_VARIABLES
public static final String INPUT_VARIABLES
- See Also:
- Constant Field Values
-
space
protected Space space
-
attachmentManager
protected AttachmentManager attachmentManager
-
themeManager
protected ThemeManager themeManager
-
breadcrumbGenerator
protected BreadcrumbGenerator breadcrumbGenerator
-
contextProvider
protected final StringParsingContextProvider contextProvider
-
originalReferrer
protected String originalReferrer
To get back to the correct place if creation gets cancelled. Specially important for integrations like Service Desk
-
-
Method Detail
-
setSpaceKey
public void setSpaceKey(String spaceKey)
-
getSpaceKey
public String getSpaceKey()
- Overrides:
getSpaceKey
in classAbstractPageAwareAction
-
getSpace
public Space getSpace()
- Specified by:
getSpace
in interfaceSpaced
- Overrides:
getSpace
in classAbstractPageAwareAction
-
getNewSpace
public Space getNewSpace()
- Returns:
- the space referenced by the newSpaceKey property, or null if there is none or it cannot be found.
-
doDefault
public String doDefault() throws Exception
Description copied from class:ConfluenceActionSupport
Convenient Action execution method which defaults to returning INPUT- Overrides:
doDefault
in classAbstractCreateAndEditPageAction
- Throws:
Exception
-
beforeAdd
protected String beforeAdd() throws Exception
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
-
populateContextProvider
protected void populateContextProvider()
-
assignSpace
protected void assignSpace(ContentEntityObject draft, Space space)
-
assignParentPage
protected void assignParentPage(ContentEntityObject page, Page parentPage)
-
getCreatedAbstractPage
protected abstract AbstractPage getCreatedAbstractPage()
-
getCommandActionHelper
protected abstract CommandActionHelper getCommandActionHelper()
-
initialiseProvider
protected abstract void initialiseProvider(AbstractPage abstractPage)
-
afterAdd
protected String 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
public void createPage() throws XhtmlException, IOException
Create the CEO to be saved from the data supplied to the action.- Throws:
IOException
XhtmlException
-
getPageToCreate
protected abstract AbstractPage 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
public Page getFromPage()
-
setFromPage
public void setFromPage(Page fromPage)
-
getAttachmentSourceContent
public ContentEntityObject 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
public String getCancelRedirectUrl()
-
getContentType
public String 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
public void setTitleWritten(String titleWritten)
-
setAttachmentManager
public void setAttachmentManager(AttachmentManager attachmentManager)
-
setThemeManager
public void setThemeManager(ThemeManager themeManager)
-
getCancelResult
public String getCancelResult()
- Overrides:
getCancelResult
in classAbstractCreateAndEditPageAction
-
setBreadcrumbGenerator
public void setBreadcrumbGenerator(BreadcrumbGenerator breadcrumbGenerator)
-
getBreadcrumb
public Breadcrumb 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
protected Breadcrumb getContentBreadcrumb()
-
setQueryString
public void setQueryString(String queryString)
-
getQueryString
public String getQueryString()
-
getOriginalReferrer
public String getOriginalReferrer()
-
setOriginalReferrer
public void setOriginalReferrer(String originalReferrer)
-
-