Package org.faceless.publisher.ext
Class SpiderExtension
java.lang.Object
org.faceless.publisher.ext.SpiderExtension
- All Implemented Interfaces:
ReportFactoryExtension
A ReportFactoryExtension that will listen for any hyperlinks in the document,
consider whether the document being linked to is "local" and if it is, attach
it to the PDF as another PDF and redirect all links to that document.
This allows you to build up a single PDF that contains an entire folder or
website.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Return true if a target URL is considered "local" for the base URL, and therefore attachable.process
(org.faceless.publisher.ext.SpiderExtension.State state) Called whenever a hyperlink to an external resource is added to a Report.void
unregister
(Report report) Notify this object when the Report it was registered on has completed parsing.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.faceless.publisher.ext.ReportFactoryExtension
configure, load, register, register, unregister
-
Constructor Details
-
SpiderExtension
public SpiderExtension()
-
-
Method Details
-
unregister
Description copied from interface:ReportFactoryExtension
Notify this object when the Report it was registered on has completed parsing. Will be called when this object is added to the list returned byReportFactory.getReportFactoryExtensions()
. The default implementation is a no-op.- Specified by:
unregister
in interfaceReportFactoryExtension
-
process
Called whenever a hyperlink to an external resource is added to a Report. Attachments can be made by returning the report to attach the document at the target URL to, or calling state.addAttachment directly. The defaut implementation attaches the PDF to the top document in the stack if "isLocal" returns true.- Parameters:
state
- the current state.- Returns:
- the report to attach the resource to, or null to not attach anything.
-
isLocal
Return true if a target URL is considered "local" for the base URL, and therefore attachable.
-