net.sourceforge.rssowl.dao
Class Exporter

java.lang.Object
  extended bynet.sourceforge.rssowl.dao.Exporter

public class Exporter
extends Object

This class is used to export export categories and favorites to external ressources (for example OPML files).

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
private  org.jdom.Document document
           
 
Constructor Summary
Exporter()
          Instantiate a new Exporter for OPML files
Exporter(String root, String filePath)
          Instantiate a new Exporter for the given Format
 
Method Summary
 void exportCategoryToOPML(Category rssOwlCategory)
          Export the given Category to a XML OPML file.
private  void exportCategoryToOPML(Category rssOwlCategory, org.jdom.Element element)
          Recursivly export categories / favorits to the OPML file
 void exportFavoriteToOPML(Favorite favorite, Category rssOwlCategory)
          Export the given Favorite to a XML OPML file.
 void exportResultsToOPML(Hashtable links, String searchTopic)
          Export the given results to a XML OPML file.
 org.jdom.Document getDocument()
          Get the Document
private  org.jdom.Document initExportToFile(String rootOpen, String rootClose)
          Init the document for the export to a file
private  org.jdom.Document initExportToFile(String rootOpen, String rootClose, File file)
          Init the document for the export to a file
(package private)  org.jdom.Document initExportToFile(String rootOpen, String rootClose, String filePath)
          Init the document for the export to a file.
private  org.jdom.Element prepareOPMLDocument(org.jdom.Document document)
          Setup default OPML Template with head tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

document

private org.jdom.Document document
Constructor Detail

Exporter

public Exporter()
Instantiate a new Exporter for OPML files


Exporter

public Exporter(String root,
                String filePath)
Instantiate a new Exporter for the given Format

Parameters:
root - Name of the root Element
filePath - The path to write the Document to
Method Detail

exportCategoryToOPML

public void exportCategoryToOPML(Category rssOwlCategory)
Export the given Category to a XML OPML file. The XML file contains all favorits and sub- categorys.

Parameters:
rssOwlCategory - Selected Category

exportFavoriteToOPML

public void exportFavoriteToOPML(Favorite favorite,
                                 Category rssOwlCategory)
Export the given Favorite to a XML OPML file.

Parameters:
rssOwlCategory - Selected Category
favorite - Selected Favorite

exportResultsToOPML

public void exportResultsToOPML(Hashtable links,
                                String searchTopic)
Export the given results to a XML OPML file.

Parameters:
links - Some links with title to export
searchTopic - The search topic that was used

getDocument

public org.jdom.Document getDocument()
Get the Document

Returns:
Document The XML document

exportCategoryToOPML

private void exportCategoryToOPML(Category rssOwlCategory,
                                  org.jdom.Element element)
Recursivly export categories / favorits to the OPML file

Parameters:
rssOwlCategory - Current rssOwlCategory
element - Current outline element

initExportToFile

private org.jdom.Document initExportToFile(String rootOpen,
                                           String rootClose)
Init the document for the export to a file

Parameters:
rootOpen - Open tag for the root element
rootClose - Close tag for the root element
Returns:
Document The initalized document

initExportToFile

private org.jdom.Document initExportToFile(String rootOpen,
                                           String rootClose,
                                           File file)
Init the document for the export to a file

Parameters:
rootOpen - Open tag for the root element
rootClose - Close tag for the root element
file - File that should be initialized
Returns:
Document The initalized document

prepareOPMLDocument

private org.jdom.Element prepareOPMLDocument(org.jdom.Document document)
Setup default OPML Template with head tag

Parameters:
document - The current working OPML XML document
Returns:
Element Body element

initExportToFile

org.jdom.Document initExportToFile(String rootOpen,
                                   String rootClose,
                                   String filePath)
Init the document for the export to a file. This method also checks if the medium is writeable.

Parameters:
rootOpen - Open tag for the root element
rootClose - Close tag for the root element
filePath - Path to the file that should be initialized
Returns:
Document The initalized document


RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo