Class AbstractPreviewPageAction

All Implemented Interfaces:
Beanable, PageAware, TinyUrlAware, WebInterface, MessageHolderAware, Serializable, org.apache.struts2.action.Action, org.apache.struts2.interceptor.ValidationAware, org.apache.struts2.locale.LocaleProvider, org.apache.struts2.text.TextProvider, org.apache.struts2.Validateable
Direct Known Subclasses:
AbstractTemplatePageAction, AddCommentAction, EditCommentAction

public abstract class AbstractPreviewPageAction extends AbstractPageAction implements Beanable
See Also:
  • Field Details

    • formatConverter

      protected FormatConverter formatConverter
    • wikiStyleRenderer

      protected com.atlassian.renderer.WikiStyleRenderer wikiStyleRenderer
    • preview

      @Deprecated protected String preview
      Deprecated.
      since 5.3 (and really much much longer)
      This ancient unused field used to do something when there were full page reloads for going to preview/edit/back
    • back

      @Deprecated protected String back
      Deprecated.
      since 5.3 (and really much much longer)
      This ancient unused field used to do something when there were full page reloads for going to preview/edit/back
    • bean

      protected Map bean
    • wysiwygContent

      protected String wysiwygContent
      The editor content.
    • storageFormat

      protected String storageFormat
      The current content in storageFormat ready for saving. This is set during the validate call on the action. Anything taking place after validation can assume this field to be populated.
    • inPreview

      @Deprecated protected boolean inPreview
      Deprecated.
      since 5.3 (and really much much longer)
      This ancient unused field used to do something when there were full page reloads for going to preview/edit/back
  • Constructor Details

    • AbstractPreviewPageAction

      public AbstractPreviewPageAction()
  • Method Details

    • getBean

      public Object getBean()
      Specified by:
      getBean in interface Beanable
    • setInPreview

      @Deprecated public void setInPreview(boolean inPreview)
      Deprecated.
      since 5.3 (and really much much longer)
      This ancient unused method used to do something when there were full page reloads for going to preview/edit/back
    • getInPreview

      @Deprecated public boolean getInPreview()
      Deprecated.
      since 5.3 (and really much much longer)
      This ancient unused method used to do something when there were full page reloads for going to preview/edit/back
    • setPreview

      @Deprecated public void setPreview(String preview)
      Deprecated.
      since 5.3 (and really much much longer)
      This ancient unused method used to do something when there were full page reloads for going to preview/edit/back
    • setBack

      @Deprecated public void setBack(String back)
      Deprecated.
      since 5.3 (and really much much longer)
      This ancient unused method used to do something when there were full page reloads for going to preview/edit/back
    • setWysiwygContent

      public void setWysiwygContent(String content)
    • getxHtmlContent

      public String getxHtmlContent()
    • setWikiStyleRenderer

      public void setWikiStyleRenderer(com.atlassian.renderer.WikiStyleRenderer wikiStyleRenderer)
    • setFormatConverter

      public void setFormatConverter(FormatConverter formatConverter)
    • updateXHtmlContent

      protected void updateXHtmlContent()
    • validate

      public void validate()
      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 AbstractPageAction
    • getWysiwygContent

      public String getWysiwygContent() throws XhtmlException
      Either -
      1. return the content entered via the editor (in the case of returning to the edit page due to validation failures or things like that).
      2. or set the content from the CEO that is being edited.
      Returns:
      the editor formatted content for the CEO being edited.
      Throws:
      XhtmlException
    • getEditorFormattedContent

      public String getEditorFormattedContent(String storageFormat)
      Parameters:
      storageFormat - the storage data to be converted for editing.
      Returns:
      the supplied storage formatted content in editor format
    • getContentForSaving

      protected String getContentForSaving() throws XhtmlParsingException, XhtmlException
      Returns the content that has been submitted as part of a user's attempt to add new content or edit existing content. The content is returned in storage format ready for saving.
      Returns:
      the content that has been submitted as part of a user's attempt to add new content or edit existing content.
      Throws:
      XhtmlParsingException
      XhtmlException
    • getRenderContext

      protected com.atlassian.renderer.RenderContext getRenderContext()
    • getConversionContext

      protected ConversionContext getConversionContext()
    • getStorageFormat

      protected String getStorageFormat() throws XhtmlException
      Returns:
      the content that a user has submitted from the editor but converted to storage format.
      Throws:
      XhtmlException