Now using dependency injection for the XslTransformer instead of
[utils] / crawler / kiss / src / org / wamblee / crawler / kiss / main / KissCrawler.java
index c522131d8bb8b1ddb49f9040bdc4b6463dfe1d9d..ad8de40205a2bbf34b91acb1ade106292cc3b1d2 100644 (file)
@@ -46,6 +46,8 @@ import org.wamblee.crawler.kiss.guide.Time;
 import org.wamblee.crawler.kiss.guide.TimeInterval;
 import org.wamblee.crawler.kiss.notification.NotificationException;
 import org.wamblee.crawler.kiss.notification.Notifier;
+import org.wamblee.xml.ClasspathUriResolver;
+import org.wamblee.xml.XslTransformer;
 
 /**
  * The KiSS crawler for automatic recording of interesting TV shows.
@@ -117,11 +119,13 @@ public class KissCrawler {
         try {
             HttpClient client = new HttpClient();
             // client.getHostConfiguration().setProxy("127.0.0.1", 3128);
+            
+            XslTransformer transformer = new XslTransformer(new ClasspathUriResolver());
 
-            Crawler crawler = createCrawler(aCrawlerConfig, client);
+            Crawler crawler = createCrawler(aCrawlerConfig, client, transformer);
             InputStream programConfigFile = new FileInputStream(new File(
                     aProgramConfig));
-            ProgramConfigurationParser parser = new ProgramConfigurationParser();
+            ProgramConfigurationParser parser = new ProgramConfigurationParser(transformer);
             parser.parse(programConfigFile);
             List<ProgramFilter> programFilters = parser.getFilters();
 
@@ -177,8 +181,8 @@ public class KissCrawler {
      *             In case configuration files cannot be found.
      */
     private Crawler createCrawler(String aCrawlerConfig, 
-            HttpClient aClient) throws FileNotFoundException {
-        ConfigurationParser parser = new ConfigurationParser();
+            HttpClient aClient, XslTransformer aTransformer) throws FileNotFoundException {
+        ConfigurationParser parser = new ConfigurationParser(aTransformer);
         InputStream crawlerConfigFile = new FileInputStream(new File(
                 aCrawlerConfig));
         Configuration config = parser.parse(crawlerConfigFile);