com.atlassian.confluence.content.render.xhtml.links
Class HtmlExportHrefEvaluator

java.lang.Object
  extended by com.atlassian.confluence.content.render.xhtml.links.HtmlExportHrefEvaluator
All Implemented Interfaces:
HrefEvaluator

public class HtmlExportHrefEvaluator
extends Object
implements HrefEvaluator

An HrefEvaluator that will generate links appropriate for HTML exported content. This means that should a link be to a page included in the export then it will become a file system link. Otherwise it will become a link to the server i.e. will include the server's baseUrl.


Constructor Summary
HtmlExportHrefEvaluator(HrefEvaluator defaultHrefEvaluator, HrefEvaluator absoluteHrefEvaluator)
           
 
Method Summary
 String createHref(ConversionContext context, Attachment attachment, String anchor)
           
 String createHref(ConversionContext context, Object entity, String anchor)
          Attachments and Pages may well exist in the export so look for them as a special case.
 String createHref(ConversionContext context, Page page, String anchor)
           
 String createHref(ConversionContext context, WebLink link, String anchor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlExportHrefEvaluator

public HtmlExportHrefEvaluator(HrefEvaluator defaultHrefEvaluator,
                               HrefEvaluator absoluteHrefEvaluator)
Method Detail

createHref

public String createHref(ConversionContext context,
                         Object entity,
                         String anchor)
Attachments and Pages may well exist in the export so look for them as a special case. All other entity types will have hrefs created using the defaultHrefEvaluator. WebLinks may be server relative - relative links will need to become absolute URLs in the export. Note that while comment may also exist in the export, Confluence does not have a comment link type so there is no handling for comments. If this changes in the future then we need to add additional handling here.

Specified by:
createHref in interface HrefEvaluator
Parameters:
context - the ConversionContext providing information about the conversion being performed, including the target output type e.g. display, pdf
entity - the object
anchor - an option parameter specifying an anchor component for the href attribute. This may be null if there is no destination anchor.
Returns:
the attribute value appropriate for the outputType specified.
See Also:
ConversionContextOutputType} for the supported outputType

createHref

public String createHref(ConversionContext context,
                         Page page,
                         String anchor)

createHref

public String createHref(ConversionContext context,
                         Attachment attachment,
                         String anchor)

createHref

public String createHref(ConversionContext context,
                         WebLink link,
                         String anchor)


Copyright © 2003-2012 Atlassian. All Rights Reserved.