|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.rssowl.util.document.DocumentGenerator
Class to generate PDF / RTF / HTML from a Newsfeed
Field Summary | |
(package private) 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 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 String |
TOKENIZER
Tokeniter to split Feed Title and News Title |
Constructor Summary | |
DocumentGenerator(Channel rssChannel,
FileOutputStream fileOS,
int format)
Instantiate a new DocumentGenerator |
Method Summary | |
void |
createDocument(ArrayList newsItemOrder)
Write header and a single news to the document |
static String |
formatToString(int format)
Get a suitable file format name for the given format. |
private void |
initDocument(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(ArrayList newsItemsOrder)
Write all news to the document |
private void |
writeNews(NewsItem rssNewsItem,
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 String TOKENIZER
private com.lowagie.text.Document document
private DocumentConfig documentConfig
private int format
private Channel rssChannel
Hashtable chapters
Constructor Detail |
public DocumentGenerator(Channel rssChannel, 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 occursMethod Detail |
public static String formatToString(int format)
format
- Any of the allowed formats PDF, RTF or HTML
public void createDocument(ArrayList newsItemOrder) throws com.lowagie.text.DocumentException
newsItemOrder
- The sort order of the selected newsfeed
com.lowagie.text.DocumentException
- If an warning occursprivate void initDocument(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(ArrayList newsItemsOrder) throws com.lowagie.text.DocumentException
newsItemsOrder
- The sort order of the newsitems
com.lowagie.text.DocumentException
- If an error occursprivate void writeNews(NewsItem rssNewsItem, String newsTitle) throws com.lowagie.text.DocumentException
rssNewsItem
- 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 |