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

java.lang.Object
  extended by com.atlassian.renderer.v2.components.AbstractRendererComponent
      extended by com.atlassian.renderer.v2.components.AbstractRegexRendererComponent
          extended by com.atlassian.confluence.content.render.xhtml.migration.XhtmlCamelCaseLinkMigrationRendererComponent
All Implemented Interfaces:
com.atlassian.renderer.v2.components.RendererComponent

public class XhtmlCamelCaseLinkMigrationRendererComponent
extends com.atlassian.renderer.v2.components.AbstractRegexRendererComponent
implements com.atlassian.renderer.v2.components.RendererComponent

Handles conversion of camelCase links to XHTML links during migration. We can't use the regular CamelCaseLinkRendererComponent as migration runs without a user in the existing context so space permissions break the links. Apart from that, the old renderer doesn't properly render links and results in links that do not auto-update when the linked page is created or deleted.


Field Summary
static Pattern LINK_CAMELCASE_PATTERN
          Identical to the non-public com.atlassian.renderer.v2.components.CamelCaseLinkRendererComponent field.
 
Constructor Summary
XhtmlCamelCaseLinkMigrationRendererComponent(ConfluenceRendererConfiguration rendererConfiguration, Marshaller<Link> linkMarshaller, LinkResolver linkResolver)
           
 
Method Summary
 void appendSubstitution(StringBuffer stringBuffer, com.atlassian.renderer.RenderContext context, Matcher matcher)
           
 String render(String wiki, com.atlassian.renderer.RenderContext renderContext)
           
 boolean shouldRender(com.atlassian.renderer.v2.RenderMode renderMode)
           
 
Methods inherited from class com.atlassian.renderer.v2.components.AbstractRegexRendererComponent
regexRender
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINK_CAMELCASE_PATTERN

public static final Pattern LINK_CAMELCASE_PATTERN
Identical to the non-public com.atlassian.renderer.v2.components.CamelCaseLinkRendererComponent field.

Constructor Detail

XhtmlCamelCaseLinkMigrationRendererComponent

public XhtmlCamelCaseLinkMigrationRendererComponent(ConfluenceRendererConfiguration rendererConfiguration,
                                                    Marshaller<Link> linkMarshaller,
                                                    LinkResolver linkResolver)
Method Detail

shouldRender

public boolean shouldRender(com.atlassian.renderer.v2.RenderMode renderMode)
Specified by:
shouldRender in interface com.atlassian.renderer.v2.components.RendererComponent
Specified by:
shouldRender in class com.atlassian.renderer.v2.components.AbstractRegexRendererComponent

render

public String render(String wiki,
                     com.atlassian.renderer.RenderContext renderContext)
Specified by:
render in interface com.atlassian.renderer.v2.components.RendererComponent
Specified by:
render in class com.atlassian.renderer.v2.components.AbstractRegexRendererComponent

appendSubstitution

public void appendSubstitution(StringBuffer stringBuffer,
                               com.atlassian.renderer.RenderContext context,
                               Matcher matcher)
Specified by:
appendSubstitution in class com.atlassian.renderer.v2.components.AbstractRegexRendererComponent


Copyright © 2003-2012 Atlassian. All Rights Reserved.