public class

HtmlExportHrefEvaluator

extends Object
implements HrefEvaluator
java.lang.Object
   ↳ com.atlassian.confluence.content.render.xhtml.links.HtmlExportHrefEvaluator

Class Overview

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.

Summary

Public Constructors
HtmlExportHrefEvaluator(HrefEvaluator defaultHrefEvaluator, HrefEvaluator absoluteHrefEvaluator)
Public Methods
String createHref(ConversionContext context, WebLink link, String anchor)
String createHref(ConversionContext context, Page page, 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, Attachment attachment, String anchor)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.content.render.xhtml.links.HrefEvaluator

Public Constructors

public HtmlExportHrefEvaluator (HrefEvaluator defaultHrefEvaluator, HrefEvaluator absoluteHrefEvaluator)

Public Methods

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

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

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.

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.

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