com.atlassian.confluence.pages.actions
Class AbstractPreviewPageAction

java.lang.Object
  extended by com.opensymphony.xwork.ActionSupport
      extended by com.atlassian.confluence.core.ConfluenceActionSupport
          extended by com.atlassian.confluence.pages.actions.AbstractPageAwareAction
              extended by com.atlassian.confluence.pages.actions.AbstractPageAction
                  extended by com.atlassian.confluence.pages.actions.AbstractPreviewPageAction
All Implemented Interfaces:
PageAware, TinyUrlAware, WebInterface, com.opensymphony.xwork.Action, com.opensymphony.xwork.LocaleProvider, com.opensymphony.xwork.TextProvider, com.opensymphony.xwork.Validateable, com.opensymphony.xwork.ValidationAware, Serializable
Direct Known Subclasses:
AbstractTemplatePageAction, AddCommentAction, EditCommentAction

public abstract class AbstractPreviewPageAction
extends AbstractPageAction

See Also:
Serialized Form

Field Summary
protected  String back
           
protected  EditorConverter editConverter
           
protected  Renderer editRenderer
           
protected  boolean inPreview
           
protected  String preview
           
protected  String storageFormat
          The current content in storageFormat ready for saving.
protected  com.atlassian.renderer.WikiStyleRenderer wikiStyleRenderer
           
protected  String wysiwygContent
          The editor content.
 
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
CANCEL, DEVMODE, eventManager, i18NBeanFactory, labelManager, languageManager, LICENSE_EXPIRED, LICENSE_USERS_EXCEEDED, permissionManager, permitted, pluginAccessor, settingsManager, spacePermissionManager, userAccessor, webInterfaceManager
 
Fields inherited from class com.opensymphony.xwork.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
AbstractPreviewPageAction()
           
 
Method Summary
protected  String convertContentToStorageFormat(ConversionContext conversionContext)
           
protected  String getContentForSaving()
          Returns the content that has been submitted as part of a user's attempt to add new content or edit existing content.
protected  ConversionContext getConversionContext()
           
 String getEditorFormattedContent(String storageFormat)
           
 boolean getInPreview()
           
protected  String getStorageFormat()
           
 String getWysiwygContent()
          Either - return the content entered via the editor (in the case of returning to the edit page due to validation failures or things like that).
 String getxHtmlContent()
           
 void setBack(String back)
           
 void setEditConverter(EditorConverter editConverter)
           
 void setEditRenderer(Renderer editRenderer)
           
 void setInPreview(boolean inPreview)
           
 void setPreview(String preview)
           
 void setWikiStyleRenderer(com.atlassian.renderer.WikiStyleRenderer wikiStyleRenderer)
           
 void setWysiwygContent(String content)
           
protected  void updateXHtmlContent()
           
 void validate()
          Convert the editor content to storageFormat, catching and reporting any problems in the process.
 
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAction
displayDatePath, getAttachmentSourceContent, getAvailableSpaces, getBeanKey, getBlogPost, getEditorVersion, getHelper, getIncomingLinks, getLabels, getMode, getNextPost, getNumberOfLabelsAsString, getPermissionTypes, getPermittedChildren, getPostingDate, getPostingDay, getPreviousPost, getPreviousVersion, getSpaceManager, getSuggestedLabels, getTinyUrl, getWebInterfaceContext, hasAttachFilePermissions, hasPermittedChildren, isSpaceAdmin, isSuperUser, isUserWatchingOwnContent, setConfluenceWysiwygConverter, setEditorManager, setLinkManager, setMode, setPageManager, setPostingDate, setViewRenderer
 
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAwareAction
getPage, getPageId, getSpace, getSpaceKey, getTitle, hasViewPagePermission, isLatestVersionRequired, isPageRequired, isPermitted, isViewPermissionRequired, setContentPermissionManager, setPage, setSpaceManager
 
Methods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addFieldError, addPermissionTypeTo, addToHistory, doDefault, formatFriendlyDate, getActionName, getActionName, getBootstrapManager, getCancelResult, getContext, getDateFormatSetting, getDateFormatter, getDefaultResourceBundle, getDocLink, getEventManager, getFriendlyDateFormatter, getGlobalSettings, getI18n, getInstalledLanguages, getLabelManager, getLanguageManager, getLanguageUserFriendly, getLocale, getLocaleManager, getLocaleString, getNiceContentType, getPermittedEntitiesOf, getPermittedEntitiesOf, getPermittedEntitiesOf, getPreviousLoginDate, getRandom, getRemoteUser, getSession, getSystemInformationService, getText, getText, getText, getText, getTextStatic, getTextStatic, getTextStrict, getTimeZone, getUser, getUserAccessor, getUserFullName, getUserInterfaceState, getWebInterfaceManager, hasPermissionForSpace, isAnonymousUser, isCanceled, isDevMode, isEmailVisible, isExternalUserManagementEnabled, isLabelable, isPermissionCheck, isPermittedAsString, isPrintableVersion, isSharedMode, isUserStatusPluginEnabled, isUsingHSQL, setBootstrapManager, setCancel, setEventManager, setFormatSettingsManager, setI18NBean, setI18NBeanFactory, setLabelManager, setLanguageManager, setLocaleManager, setLoginManager, setPermissionCheck, setPermissionManager, setPluginAccessor, setPreviousLoginDate, setSettingsManager, setSpacePermissionManager, setSystemInformationService, setUserAccessor, setWebInterfaceManager
 
Methods inherited from class com.opensymphony.xwork.ActionSupport
addActionError, addActionMessage, addFieldError, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wikiStyleRenderer

protected com.atlassian.renderer.WikiStyleRenderer wikiStyleRenderer

editConverter

protected EditorConverter editConverter

editRenderer

protected Renderer editRenderer

preview

protected String preview

back

protected String back

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

protected boolean inPreview
Constructor Detail

AbstractPreviewPageAction

public AbstractPreviewPageAction()
Method Detail

setInPreview

public void setInPreview(boolean inPreview)

getInPreview

public boolean getInPreview()

setPreview

public void setPreview(String preview)

setBack

public void setBack(String back)

setWysiwygContent

public void setWysiwygContent(String content)

getxHtmlContent

public String getxHtmlContent()

setWikiStyleRenderer

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

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 com.opensymphony.xwork.Validateable
Overrides:
validate in class com.opensymphony.xwork.ActionSupport

getWysiwygContent

public String getWysiwygContent()
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.

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

convertContentToStorageFormat

protected String convertContentToStorageFormat(ConversionContext conversionContext)
                                        throws XhtmlParsingException,
                                               XhtmlException
Throws:
XhtmlParsingException
XhtmlException

getConversionContext

protected ConversionContext getConversionContext()

setEditConverter

public void setEditConverter(EditorConverter editConverter)

setEditRenderer

public void setEditRenderer(Renderer editRenderer)

getStorageFormat

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


Copyright © 2003-2012 Atlassian. All Rights Reserved.