To read in an RSS feed you have to provide basically two things:
a source from where to read the feed (URL, File, InputStream or Reader)
and a ChannelBuilder which builds the news channel object model.
Currently two ChannelBuilder are available: one in-memory
(see de.nava.informa.impl.basic.ChannelBuilder) and the other one using
the Hibernate O/R mapping mechansim to persist the data in a relational
database (see de.nava.informa.impl.hibernate.ChannelBuilder).
The following code fragment demonstrates the usage:
Further information about the channel object can be found in the
JavaDoc for ChannelIF.
This provides a convenient facility to read in a collection of
FeedIF
objects which might be helpful for retrieving news channels.
For creating your own news channel object model in-memory, look
at following example:
If you like to make use of the persistent backend using
de.nava.informa.impl.hibernate.ChannelBuilder you can achieve the above
with:
Please look at
ChannelIndexer
and
ChannelSearcher
in the meantime or find more information about the usage inside the
test cases (directory: test/src/de/nava/informa/search).
Some day you might want to export a news channel to a file. The
informa library does support writing a news channel to RSS 0.91 and 1.0
formats. Please look at the following example:
There are two utility classes provided by the Informa API which are
UpdateChannelTask
using the Push-approach (registering event listeners) and
FeedManager
using the Pull-approach (suitable for web pages, i.e.)
The Hibernate 2 library files are provided with the informa
distribution. If you do not want to use the Hypersonic SQL database,
you have to make sure that you include any files
required for JDBC connectivity to the database in the classpath.
The first file that to investigate is the hibernate.properties file.
Place this file in your classpath so that Hibernate can find it at
runtime. This file contains the runtime settings that Hibernate will
use when it is started up. Here is an example:
There are also DDLs (for MySQL, PostgreSQL and HSQL) for the tables
needed by Informa's hibernate backend provided with the distribution
under the directory sql.