Class HtmlContentTransformer
- java.lang.Object
 - 
- org.eclipse.epsilon.picto.transformers.HtmlContentTransformer
 
 
- 
- All Implemented Interfaces:
 ViewContentTransformer
public class HtmlContentTransformer extends java.lang.Object implements ViewContentTransformer
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected java.util.List<HtmlElementTransformer>htmlElementTransformersprotected XmlHelperxmlHelper 
- 
Constructor Summary
Constructors Constructor Description HtmlContentTransformer() 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddZoom(org.w3c.dom.Document document)booleancanTransform(ViewContent content)protected org.w3c.dom.ElementgetElementByName(org.w3c.dom.Element parent, java.lang.String name)protected org.w3c.dom.NodeListgetElements(org.w3c.dom.Document document, java.lang.String xpath)java.lang.StringgetLabel(ViewContent content)protected static ExternalContentTransformationinvokePandoc(java.nio.file.Path document, java.lang.String outputExt, java.lang.Object... additionalArgs)Converts the HTML to the desired format using Pandoc.static java.nio.file.Pathpandoc(java.lang.String html, java.lang.String outputExt, java.lang.Object... additionalArgs)Converts the HTML to the desired format using Pandoc.static java.nio.file.Pathpandoc(java.nio.file.Path document, java.lang.String outputExt, java.lang.Object... additionalArgs)Converts the HTML to the desired format using Pandoc.static java.lang.StringpandocRaw(java.lang.String html, java.lang.String outputExt, java.lang.Object... additionalArgs)Converts the HTML to the desired format using Pandoc.ViewContenttransform(ViewContent content, PictoView pictoView)static java.nio.file.Pathwkhtmltopdf(java.lang.String html)Converts HTML to PDF using wkhtmltopdf.static java.nio.file.Pathwkhtmltopdf(java.nio.file.Path document)Converts HTML to PDF using wkhtmltopdf. 
 - 
 
- 
- 
Field Detail
- 
htmlElementTransformers
protected java.util.List<HtmlElementTransformer> htmlElementTransformers
 
- 
xmlHelper
protected XmlHelper xmlHelper
 
 - 
 
- 
Method Detail
- 
canTransform
public boolean canTransform(ViewContent content)
- Specified by:
 canTransformin interfaceViewContentTransformer
 
- 
getLabel
public java.lang.String getLabel(ViewContent content)
- Specified by:
 getLabelin interfaceViewContentTransformer
 
- 
transform
public ViewContent transform(ViewContent content, PictoView pictoView) throws java.lang.Exception
- Specified by:
 transformin interfaceViewContentTransformer- Throws:
 java.lang.Exception
 
- 
addZoom
protected void addZoom(org.w3c.dom.Document document)
 
- 
getElementByName
protected org.w3c.dom.Element getElementByName(org.w3c.dom.Element parent, java.lang.String name) 
- 
getElements
protected org.w3c.dom.NodeList getElements(org.w3c.dom.Document document, java.lang.String xpath) throws java.lang.Exception- Throws:
 java.lang.Exception
 
- 
pandocRaw
public static java.lang.String pandocRaw(java.lang.String html, java.lang.String outputExt, java.lang.Object... additionalArgs) throws java.io.IOExceptionConverts the HTML to the desired format using Pandoc.- Parameters:
 html- The raw HTML text.outputExt- The output file format.additionalArgs- Other arguments to pass to Pandoc.- Returns:
 - The raw output of the file as a String.
 - Throws:
 java.io.IOException- If invoking Pandoc fails.
 
- 
pandoc
public static java.nio.file.Path pandoc(java.lang.String html, java.lang.String outputExt, java.lang.Object... additionalArgs) throws java.io.IOExceptionConverts the HTML to the desired format using Pandoc.- Parameters:
 html- The raw HTML text.outputExt- The output file format.additionalArgs- Other arguments to pass to Pandoc.- Returns:
 - The output file.
 - Throws:
 java.io.IOException- If invoking Pandoc fails.
 
- 
pandoc
public static java.nio.file.Path pandoc(java.nio.file.Path document, java.lang.String outputExt, java.lang.Object... additionalArgs) throws java.io.IOExceptionConverts the HTML to the desired format using Pandoc.- Parameters:
 document- The HTML file.outputExt- The output file format.additionalArgs- Other arguments to pass to Pandoc.- Returns:
 - The output file.
 - Throws:
 java.io.IOException- If invoking Pandoc fails.
 
- 
invokePandoc
protected static ExternalContentTransformation invokePandoc(java.nio.file.Path document, java.lang.String outputExt, java.lang.Object... additionalArgs) throws java.io.IOException
Converts the HTML to the desired format using Pandoc.- Parameters:
 html- The HTML file.outputExt- The output file format.additionalArgs- Other arguments to pass to Pandoc.- Returns:
 - The transformation, prior to running it.
 - Throws:
 java.io.IOException- If invoking Pandoc fails.
 
- 
wkhtmltopdf
public static java.nio.file.Path wkhtmltopdf(java.lang.String html) throws java.io.IOExceptionConverts HTML to PDF using wkhtmltopdf.- Parameters:
 html- The raw HTML text.- Returns:
 - The output PDF file.
 - Throws:
 java.io.IOException- If invoking wkhtmltopdf fails.
 
- 
wkhtmltopdf
public static java.nio.file.Path wkhtmltopdf(java.nio.file.Path document) throws java.io.IOExceptionConverts HTML to PDF using wkhtmltopdf.- Parameters:
 html- The HTML file.- Returns:
 - The output PDF file.
 - Throws:
 java.io.IOException- If invoking wkhtmltopdf fails.
 
 - 
 
 -