Class HtmlExportHrefEvaluator
- java.lang.Object
-
- 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
Constructors Constructor Description HtmlExportHrefEvaluator(HrefEvaluator defaultHrefEvaluator, HrefEvaluator absoluteHrefEvaluator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createHref(ConversionContext context, WebLink link, String anchor)
String
createHref(ConversionContext context, Attachment attachment, 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.
-
-
-
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 interfaceHrefEvaluator
- Parameters:
context
- the ConversionContext providing information about the conversion being performed, including the target output type e.g. display, pdfentity
- the objectanchor
- 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.
-
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)
-
-