Class 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:
  • Field Details

  • Constructor Details

    • AbstractCreateAndEditPageAction

      public AbstractCreateAndEditPageAction()
  • Method Details

    • setParentPageId

      public void setParentPageId(long parentPageId)
    • getParentPageId

      public long getParentPageId()
    • getParentPage

      public Page getParentPage()
    • getPermissionTypes

      protected List<String> getPermissionTypes()
      Overrides:
      getPermissionTypes in class AbstractPageAction
      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 interface MessageHolderAware
      Specified by:
      validate in interface org.apache.struts2.Validateable
      Overrides:
      validate in class AbstractPreviewPageAction
    • 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 class ConfluenceActionSupport
      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 class AbstractPageAwareAction
    • 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)
    • setLabelsString

      public void setLabelsString(List<Label> labels)
    • 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 class AbstractPageAwareAction
    • getDraft

      @Deprecated public Draft getDraft()
      Deprecated.
      since 5.10 use getDraftAsCEO()
      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 use getContentDraft()
      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 interface WebInterface
      Overrides:
      getWebInterfaceContext in class AbstractPageAction
    • getCancelResult

      public String getCancelResult()
      Overrides:
      getCancelResult in class ConfluenceActionSupport
    • 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 class AbstractPageAction
      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)
    • getXsrfToken

      public String 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.