java.lang.Object sferyx.administration.htmlgenerator.HTMLGenerator
public class HTMLGenerator
General purpose HTML Generator - this class provides fully featured generation of HTML files from various sources containing RTF, Docx, Plain text or image content.
Field Summary | |
---|---|
static boolean |
debug
|
Constructor Summary | |
---|---|
HTMLGenerator()
Creates a new instance of HTMLGenerator |
Method Summary | |
---|---|
void |
addPageBreakToContentBuffer()
Adds a HTML page break to the content buffer and all the content appended after that will be on the next page when printed |
void |
appendDocxToContentBuffer(java.io.File file)
Appends the whole content of the Docx file from the File to the content buffer. |
void |
appendDocxToContentBuffer(java.net.URL file)
Appends the whole content of the Docx file from the given URL to the content buffer. |
void |
appendHTMLContentToContentBuffer(java.lang.String content)
Appends new HTML string to existing content buffer. |
void |
appendPlainTextContentToContentBuffer(java.lang.String content)
Appends the Plain Text string content to the content buffer. |
void |
appendRTFBase64EncodedStringToContentBuffer(java.lang.String base64EncodedRTFString)
Appends RTF content encoded as Base64 string to the content buffer. |
void |
appendRTFFileToContentBuffer(java.io.InputStream is)
Appends RTF file from the InputStream to the content buffer. |
void |
appendRTFFileToContentBuffer(java.net.URL file)
Appends RTF file from the URL to the content buffer. |
void |
clearContentBuffer()
Closes the content buffer and clears the content. |
java.lang.String |
closeBufferAndGenerateHTML()
Generates the HTML content automatically for given content buffer created prevuiously by using openContentBuffer() and appendContentXXX() methods. |
void |
closeBufferAndGenerateHTML(java.io.OutputStream destinationStream)
Closes the existing content buffer and generates the resulting content from the HTML Generator - it will be saved in the given OutputStream. |
void |
closeBufferAndGenerateHTML(java.lang.String destinationFile)
Generates the HTML content automatically for given content buffer created prevuiously by using openContentBuffer() and appendContentXXX() methods. |
java.lang.String |
generateHTMLFromContent(java.lang.String content)
Generates HTML automatically for given image or HTML content. |
void |
generateHTMLFromContent(java.lang.String content,
java.io.File destinationFile)
Generates html automatically for given html content. |
void |
generateHTMLFromContent(java.lang.String content,
java.io.OutputStream destinationStream)
Generates HTML automatically for given image or html content. |
void |
generateHTMLFromContent(java.lang.String content,
java.lang.String destinationFile)
Generates the HTML automatically for given html content. |
java.lang.String |
generateHTMLFromDocxURL(java.lang.String sourceURL)
Generates HTML automatically for given URL source containing a MS Word Docx file. |
void |
generateHTMLFromDocxURL(java.lang.String sourceURL,
java.io.File destinationFile)
Generates HTML automatically for given URL source containing a MS Word Docx file. |
void |
generateHTMLFromDocxURL(java.lang.String sourceURL,
java.lang.String destinationFile)
Generates HTML automatically for given URL source containing a MS Word Docx file. |
java.lang.String |
generateHTMLFromDocxURL(java.net.URL sourceURL)
Generates HTML automatically for given URL source containing a MS Word Docx file. |
void |
generateHTMLFromDocxURL(java.net.URL sourceURL,
java.io.File destinationFile)
Generates HTML automatically for given URL source containing a MS Word Docx file. |
void |
generateHTMLFromDocxURL(java.net.URL sourceURL,
java.io.OutputStream fos)
Generates HTML automatically for given URL source containing a MS Word Docx file. |
java.lang.String |
generateHTMLFromPlainTextContent(java.lang.String content)
Generates HTML automatically for given Plain text content. |
void |
generateHTMLFromPlainTextContent(java.lang.String content,
java.io.File destinationFile)
Generates HTML automatically for given Plain text content. |
void |
generateHTMLFromPlainTextContent(java.lang.String content,
java.io.OutputStream destinationStream)
Generates HTML automatically for given Plain text content. |
void |
generateHTMLFromPlainTextContent(java.lang.String content,
java.lang.String destinationFile)
Generates HTML automatically for given Plain text content. |
void |
generateHTMLFromRTFContentBase64String(java.lang.String rtfString,
java.io.OutputStream outputStream)
Generates HTML automatically for given URL source containing a base64 encoded Rich Text Format RTF string. |
java.lang.String |
generateHTMLFromRTFInputStream(java.io.InputStream rtfStream)
Generates HTML automatically for given InputStream containing a Rich Text Format RTF file. |
void |
generateHTMLFromRTFInputStream(java.io.InputStream rtfStream,
java.io.OutputStream outputStream)
Generates HTML automatically for given InputStream containing a Rich Text Format RTF file. |
java.lang.String |
generateHTMLFromRTFURL(java.lang.String sourceURL)
Generates HTML automatically for given URL source containing a Rich Text Format RTF file. |
void |
generateHTMLFromRTFURL(java.lang.String sourceURL,
java.io.File destinationFile)
Generates HTML automatically for given URL source containing a Rich Text Format RTF file. |
void |
generateHTMLFromRTFURL(java.lang.String sourceURL,
java.lang.String destinationFile)
Generates HTML automatically for given URL source containing a Rich Text Format RTF file. |
java.lang.String |
generateHTMLFromRTFURL(java.net.URL sourceURL)
Generates HTML automatically for given URL source containing a Rich Text Format RTF file. |
void |
generateHTMLFromRTFURL(java.net.URL sourceURL,
java.io.File destinationFile)
Generates HTML automatically for given URL source containing a Rich Text Format RTF file. |
void |
generateHTMLFromRTFURL(java.net.URL sourceURL,
java.io.OutputStream fos)
Generates HTML automatically for given URL source containing a Rich Text Format RTF file. |
void |
generateHTMLFromURL(java.lang.String sourceURL)
Generates HTML automatically for given URL source. |
void |
generateHTMLFromURL(java.lang.String sourceURL,
java.io.File destinationFile)
Generates HTML automatically for given URL source and saves the result to destinationFile as string. |
void |
generateHTMLFromURL(java.lang.String sourceURL,
java.io.OutputStream destinationStream)
Generates HTML automatically for given URL source and saves the result to the given OutputStream as a string. |
void |
generateHTMLFromURL(java.lang.String sourceURL,
java.lang.String destinationFile)
Generates HTML automatically for given URL source and saves the result to destinationFile as a string. |
java.lang.String |
generateHTMLFromURL(java.net.URL sourceURL)
Generates HTML automatically for given URL source and saves the result will be returned as a String. |
void |
generateHTMLFromURL(java.net.URL sourceURL,
java.io.OutputStream destinationStream)
Generates HTML automatically for given URL source and saves the result to destinationStream as string. |
boolean |
getXMLMode()
Returns the XML mode for the renderer. |
static void |
main(java.lang.String[] args)
|
void |
openContentBuffer()
Opens the new content buffer for inserting content to be used for dynamic HTML generation. |
void |
setXMLMode(boolean mode)
Sets the XML mode for the renderer - this will define how custom XML tags will be rendered. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean debug
Constructor Detail |
---|
public HTMLGenerator()
Method Detail |
---|
public void generateHTMLFromURL(java.lang.String sourceURL) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromURL(java.lang.String sourceURL, java.lang.String destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromURL(java.lang.String sourceURL, java.io.OutputStream destinationStream) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromURL(java.lang.String sourceURL, java.io.File destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromURL(java.net.URL sourceURL, java.io.OutputStream destinationStream) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public java.lang.String generateHTMLFromURL(java.net.URL sourceURL) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromDocxURL(java.lang.String sourceURL, java.lang.String destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromDocxURL(java.lang.String sourceURL, java.io.File destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromDocxURL(java.net.URL sourceURL, java.io.File destinationFile) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromDocxURL(java.net.URL sourceURL, java.io.OutputStream fos) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public java.lang.String generateHTMLFromDocxURL(java.net.URL sourceURL) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public java.lang.String generateHTMLFromDocxURL(java.lang.String sourceURL) throws java.io.UnsupportedEncodingException, java.io.IOException, java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
java.net.MalformedURLException
public void generateHTMLFromRTFURL(java.lang.String sourceURL, java.lang.String destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromRTFURL(java.lang.String sourceURL, java.io.File destinationFile) throws java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromRTFURL(java.net.URL sourceURL, java.io.File destinationFile) throws java.io.FileNotFoundException, java.net.MalformedURLException, java.io.UnsupportedEncodingException, java.io.IOException
java.io.FileNotFoundException
java.net.MalformedURLException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromRTFURL(java.net.URL sourceURL, java.io.OutputStream fos) throws java.io.IOException, java.io.UnsupportedEncodingException
java.io.IOException
java.io.UnsupportedEncodingException
public java.lang.String generateHTMLFromRTFURL(java.net.URL sourceURL) throws java.io.IOException, java.io.UnsupportedEncodingException
java.io.IOException
java.io.UnsupportedEncodingException
public java.lang.String generateHTMLFromRTFURL(java.lang.String sourceURL) throws java.io.IOException, java.io.UnsupportedEncodingException, java.net.MalformedURLException
java.io.IOException
java.io.UnsupportedEncodingException
java.net.MalformedURLException
public void generateHTMLFromRTFContentBase64String(java.lang.String rtfString, java.io.OutputStream outputStream) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromRTFInputStream(java.io.InputStream rtfStream, java.io.OutputStream outputStream) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public java.lang.String generateHTMLFromRTFInputStream(java.io.InputStream rtfStream) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void setXMLMode(boolean mode)
public boolean getXMLMode()
public void openContentBuffer()
public void appendHTMLContentToContentBuffer(java.lang.String content)
public void appendPlainTextContentToContentBuffer(java.lang.String content)
public void appendDocxToContentBuffer(java.net.URL file)
public void appendDocxToContentBuffer(java.io.File file)
public void appendRTFFileToContentBuffer(java.net.URL file)
public void appendRTFFileToContentBuffer(java.io.InputStream is)
public void appendRTFBase64EncodedStringToContentBuffer(java.lang.String base64EncodedRTFString)
public void addPageBreakToContentBuffer()
public void closeBufferAndGenerateHTML(java.io.OutputStream destinationStream) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void closeBufferAndGenerateHTML(java.lang.String destinationFile) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public java.lang.String closeBufferAndGenerateHTML() throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void clearContentBuffer()
public void generateHTMLFromContent(java.lang.String content, java.io.OutputStream destinationStream) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public java.lang.String generateHTMLFromContent(java.lang.String content) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromContent(java.lang.String content, java.lang.String destinationFile) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException, java.io.IOException
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromContent(java.lang.String content, java.io.File destinationFile) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException, java.io.IOException
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
java.io.IOException
public java.lang.String generateHTMLFromPlainTextContent(java.lang.String content) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromPlainTextContent(java.lang.String content, java.io.OutputStream destinationStream) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromPlainTextContent(java.lang.String content, java.lang.String destinationFile) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public void generateHTMLFromPlainTextContent(java.lang.String content, java.io.File destinationFile) throws java.io.UnsupportedEncodingException, java.io.IOException
java.io.UnsupportedEncodingException
java.io.IOException
public static void main(java.lang.String[] args)