|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.rssowl.util.document.DocumentGenerator
public class DocumentGenerator
Class to generate PDF / RTF / HTML from a Newsfeed
| Field Summary | |
|---|---|
(package private) java.util.Hashtable |
chapters
Store Chapters for each newsfeed that is generated to document |
private com.lowagie.text.Document |
document
Document to write |
private DocumentConfig |
documentConfig
The config for the document containing Fonts |
private java.io.FileOutputStream |
fileOS
The File to write the Document into |
private int |
format
Chosen format (PDF, RTF or HTML) |
static int |
HTML_FORMAT
Constant to indicate a HTML formatted document |
private static int |
MAX_CHARS_PER_PAGE
Value to decide wether a Table fits a page or not |
static int |
PDF_FORMAT
Constant to indicate a PDF formatted document |
private Channel |
rssChannel
The Channel to generate the PDF / RTF / HTML from |
static int |
RTF_FORMAT
Constant to indicate a RTF formatted document |
private static java.lang.String |
TOKENIZER
Tokeniter to split Feed Title and News Title |
| Constructor Summary | |
|---|---|
DocumentGenerator(Channel rssChannel,
java.io.FileOutputStream fileOS,
int format)
Instantiate a new DocumentGenerator |
|
| Method Summary | |
|---|---|
void |
createDocument(java.util.ArrayList newsItemOrder)
Write header and a single news to the document |
static java.lang.String |
formatToString(int format)
Get a suitable file format name for the given format. |
private void |
initDocument(java.io.FileOutputStream file)
Init the document to PDF, HTML or RTF and with the given file |
private void |
writeFooter()
Write footer into document |
private void |
writeMetaInfos()
Write some meta informations to the document |
private void |
writeNews(java.util.ArrayList newsItemsOrder)
Write all news to the document |
private void |
writeNews(NewsItem item,
java.lang.String newsTitle)
Write a newsitem to the document |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int HTML_FORMAT
public static final int PDF_FORMAT
public static final int RTF_FORMAT
private static final int MAX_CHARS_PER_PAGE
private static final java.lang.String TOKENIZER
private com.lowagie.text.Document document
private DocumentConfig documentConfig
private java.io.FileOutputStream fileOS
private int format
private Channel rssChannel
java.util.Hashtable chapters
| Constructor Detail |
|---|
public DocumentGenerator(Channel rssChannel,
java.io.FileOutputStream fileOS,
int format)
throws com.lowagie.text.DocumentException
rssChannel - The selected ChannelfileOS - File to write document intoformat - PDF, RTF or HTML
com.lowagie.text.DocumentException - If an error occurs| Method Detail |
|---|
public static java.lang.String formatToString(int format)
format - Any of the allowed formats PDF, RTF or HTML
public void createDocument(java.util.ArrayList newsItemOrder)
throws com.lowagie.text.DocumentException,
java.io.IOException
newsItemOrder - The sort order of the selected newsfeed
com.lowagie.text.DocumentException - In case of an Error.
java.io.IOException - In case of an Error.
private void initDocument(java.io.FileOutputStream file)
throws com.lowagie.text.DocumentException
file - The path to the file where to save the document after
generation
com.lowagie.text.DocumentException - If an error occursprivate void writeFooter()
private void writeMetaInfos()
private void writeNews(java.util.ArrayList newsItemsOrder)
throws com.lowagie.text.DocumentException
newsItemsOrder - The sort order of the newsitems
com.lowagie.text.DocumentException - If an error occurs
private void writeNews(NewsItem item,
java.lang.String newsTitle)
throws com.lowagie.text.DocumentException
item - NewsItem to writenewsTitle - Title of the newsitem
com.lowagie.text.DocumentException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||