com.atlassian.confluence.pages.wysiwyg
Class DefaultConfluenceWysiwygConverter

java.lang.Object
  extended bycom.atlassian.confluence.pages.wysiwyg.DefaultConfluenceWysiwygConverter
All Implemented Interfaces:
ConfluenceWysiwygConverter

public class DefaultConfluenceWysiwygConverter
extends Object
implements ConfluenceWysiwygConverter

When debugging this code, see SimpleMarkupTest for test cases. The XHTML coming into this code is not what is important -- you need to look at the post JTidy XHTML, which you can see in the 'out' ByteArray.

Set debug to true below to see where newlines in the resulting Wiki markup are coming from.


Constructor Summary
DefaultConfluenceWysiwygConverter()
           
 
Method Summary
 String convertToPreview(String inputText, String pageIdString, String spaceKey, String fromMode)
           
 String convertWikiMarkupToXHtml(AbstractPage page, String wikiMarkup)
           
 String convertWikiMarkupToXHtmlWithoutPage(String wikiMarkup, String pageIdString)
           
 String convertXHtmlToWikiMarkup(AbstractPage page, String xhtml)
           
 String convertXHtmlToWikiMarkupWithoutPage(String xhtml, String pageIdString)
           
 boolean getUserWysiwygPreference()
          Retrieves the user's WYSIWYG editor preference and returns it.
 void setPageManager(PageManager pageManager)
           
 void setSettingsManager(SettingsManager settingsManager)
           
 void setSpaceManager(SpaceManager spaceManager)
           
 void setWikiStyleRenderer(WikiStyleRenderer wikiStyleRenderer)
           
 void setWysiwygConverter(WysiwygConverter converter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConfluenceWysiwygConverter

public DefaultConfluenceWysiwygConverter()
Method Detail

setSettingsManager

public void setSettingsManager(SettingsManager settingsManager)

setWysiwygConverter

public void setWysiwygConverter(WysiwygConverter converter)

setPageManager

public void setPageManager(PageManager pageManager)

setWikiStyleRenderer

public void setWikiStyleRenderer(WikiStyleRenderer wikiStyleRenderer)

setSpaceManager

public void setSpaceManager(SpaceManager spaceManager)

convertXHtmlToWikiMarkup

public String convertXHtmlToWikiMarkup(AbstractPage page,
                                       String xhtml)
Specified by:
convertXHtmlToWikiMarkup in interface ConfluenceWysiwygConverter

convertWikiMarkupToXHtml

public String convertWikiMarkupToXHtml(AbstractPage page,
                                       String wikiMarkup)
Specified by:
convertWikiMarkupToXHtml in interface ConfluenceWysiwygConverter

convertXHtmlToWikiMarkupWithoutPage

public String convertXHtmlToWikiMarkupWithoutPage(String xhtml,
                                                  String pageIdString)
Specified by:
convertXHtmlToWikiMarkupWithoutPage in interface ConfluenceWysiwygConverter

convertWikiMarkupToXHtmlWithoutPage

public String convertWikiMarkupToXHtmlWithoutPage(String wikiMarkup,
                                                  String pageIdString)
Specified by:
convertWikiMarkupToXHtmlWithoutPage in interface ConfluenceWysiwygConverter

convertToPreview

public String convertToPreview(String inputText,
                               String pageIdString,
                               String spaceKey,
                               String fromMode)
Specified by:
convertToPreview in interface ConfluenceWysiwygConverter

getUserWysiwygPreference

public boolean getUserWysiwygPreference()
Description copied from interface: ConfluenceWysiwygConverter
Retrieves the user's WYSIWYG editor preference and returns it. If the preference isn't set, the global settings are checked and returned.

Specified by:
getUserWysiwygPreference in interface ConfluenceWysiwygConverter
Returns:
True if the use has set the WYSIWYG editor as the default, false otherwise


Confluence is developed by Atlassian.