com.atlassian.confluence.content.render.xhtml.migration
Class WikiToXhtmlMigrator

java.lang.Object
  extended by com.atlassian.confluence.content.render.xhtml.migration.WikiToXhtmlMigrator
All Implemented Interfaces:
ExceptionTolerantMigrator

public class WikiToXhtmlMigrator
extends java.lang.Object
implements ExceptionTolerantMigrator

Convert wiki formatted text to the XHTML format used for storage from Confluence 4.0.

Based on V2RendererFacade (which we aren't using because it would cause spring autowiring by type to fail because there would then be two beans that implement WikiStyleRenderer.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.confluence.content.render.xhtml.migration.ExceptionTolerantMigrator
ExceptionTolerantMigrator.MigrationResult
 
Constructor Summary
WikiToXhtmlMigrator(com.atlassian.renderer.RendererConfiguration rendererConfiguration, com.atlassian.renderer.links.LinkRenderer defaultLinkRenderer, com.atlassian.renderer.embedded.EmbeddedResourceRenderer defaultEmbeddedRenderer, ErrorReportingV2Renderer renderer)
           
 
Method Summary
 ExceptionTolerantMigrator.MigrationResult migrate(java.lang.String wiki, ConversionContext conversionContext)
          Migrate the supplied content.
 java.lang.String migrate(java.lang.String wiki, com.atlassian.renderer.RenderContext context, java.util.List<java.lang.RuntimeException> exceptions)
           Convert wiki text to storage format XHTML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikiToXhtmlMigrator

public WikiToXhtmlMigrator(com.atlassian.renderer.RendererConfiguration rendererConfiguration,
                           com.atlassian.renderer.links.LinkRenderer defaultLinkRenderer,
                           com.atlassian.renderer.embedded.EmbeddedResourceRenderer defaultEmbeddedRenderer,
                           ErrorReportingV2Renderer renderer)
Method Detail

migrate

public java.lang.String migrate(java.lang.String wiki,
                                com.atlassian.renderer.RenderContext context,
                                java.util.List<java.lang.RuntimeException> exceptions)

Convert wiki text to storage format XHTML. Even on the event of any exceptions occurring during migration (as reported via the exceptions parameter) suitable storage XHTML formatted data will be returned.

Specified by:
migrate in interface ExceptionTolerantMigrator
Parameters:
wiki - wiki formatted String to be migrated to storage XHTML.
context - the context for the rendering during this migration
exceptions - a List to add any migration exceptions too as they occur (this may be null if you don't care about exceptions)
Returns:
an XHTML formatted String suitable for storage. Even on the event of exceptions the returned String will still have been migrated in a manner suitable for XHTML storage.

migrate

public ExceptionTolerantMigrator.MigrationResult migrate(java.lang.String wiki,
                                                         ConversionContext conversionContext)
Description copied from interface: ExceptionTolerantMigrator
Migrate the supplied content.

Specified by:
migrate in interface ExceptionTolerantMigrator
Parameters:
wiki - the comtent to be migrated
conversionContext - the context to be applied for this migration
Returns:
a ExceptionTolerantMigrator.MigrationResult containing the migrated content (if any), as well as indications of failures.


Copyright © 2003-2014 Atlassian. All Rights Reserved.