public static void main(String[] args) throws Exception
{
// Use Rome|Aqueduct-Prevayler to get DAO layer
System.out.println("Starting Aqueduct-Prevayler...");
PrevaylerDAOFactory factory = (PrevaylerDAOFactory) RomeDAOFactory.getDAOFactory(PrevaylerDAOFactory.class);
PrevaylerSyndFeedDAO syndFeedDAO = (PrevaylerSyndFeedDAO) factory.getSyndFeedDAO();
// Do various queries on the feeds in persistence.
QueryByMetaData metaDataQuery;
QueryByContent contentQuery;
// Query on Feed types
metaDataQuery = new QueryByMetaData("(rss).*");
metaDataQuery.setCheckFeedType(true);
showTitles("RSS feeds:", syndFeedDAO.select(metaDataQuery));
metaDataQuery = new QueryByMetaData("(atom).*");
metaDataQuery.setCheckFeedType(true);
showTitles("Atom feeds:", syndFeedDAO.select(metaDataQuery));
metaDataQuery = new QueryByMetaData(".*(2005).*");
metaDataQuery.setCheckCopyright(true);
showTitles("Feeds with 2005 copyright:", syndFeedDAO.select(metaDataQuery));
metaDataQuery = new QueryByMetaData(".*( and ).*");
metaDataQuery.setCheckAll(true);
showTitles("Feeds with 'and' in any metadata:", syndFeedDAO.select(metaDataQuery));
// Query on Feed content
contentQuery = new QueryByContent(".*( and ).*");
showTitles("Feeds with 'and' in content:", syndFeedDAO.select(contentQuery));
contentQuery = new QueryByContent(".*( [Tt]he ).*");
showTitles("Feeds with 'The/the' in content:", syndFeedDAO.select(contentQuery));
}