From: Jan-Pascal van Best Date: Fri, 6 Apr 2012 09:25:59 +0000 (+0200) Subject: Removed mysql dependency; fix for Java6; added some internal documentation X-Git-Tag: 0.9.1~4 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=3e9e8c380632c72c76fe576c0ba7642024023aa4;p=tv_grab_nl_java Removed mysql dependency; fix for Java6; added some internal documentation --- diff --git a/.gitignore b/.gitignore index e40871a..a1a0d4a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /testdb.* /cachedb.* /tv_grab_nl_java.db.properties +*.orig diff --git a/pom.xml b/pom.xml index 46a350e..74dc9b1 100644 --- a/pom.xml +++ b/pom.xml @@ -31,11 +31,6 @@ hsqldb 2.2.8 - - mysql - mysql-connector-java - 5.1.18 - diff --git a/src/main/java/org/vanbest/xmltv/EPGSource.java b/src/main/java/org/vanbest/xmltv/EPGSource.java index 2c53e55..f8fbb54 100644 --- a/src/main/java/org/vanbest/xmltv/EPGSource.java +++ b/src/main/java/org/vanbest/xmltv/EPGSource.java @@ -14,7 +14,9 @@ public interface EPGSource { public int getId(); public void setId(int id); - public String getName(); // must be static + public String getName(); + // All implementing class must declare a + // public static final String NAME (e.g tvgids.nl or rtl.nl) public List getChannels(); // Convenience method diff --git a/src/main/java/org/vanbest/xmltv/EPGSourceFactory.java b/src/main/java/org/vanbest/xmltv/EPGSourceFactory.java index 31e8acd..bafde35 100644 --- a/src/main/java/org/vanbest/xmltv/EPGSourceFactory.java +++ b/src/main/java/org/vanbest/xmltv/EPGSourceFactory.java @@ -46,10 +46,16 @@ public class EPGSourceFactory { } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); - } catch (ReflectiveOperationException e) { + } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); - } catch (SecurityException e) { + } catch (NoSuchFieldException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } diff --git a/src/main/java/org/vanbest/xmltv/RTL.java b/src/main/java/org/vanbest/xmltv/RTL.java index fcf2583..164a196 100644 --- a/src/main/java/org/vanbest/xmltv/RTL.java +++ b/src/main/java/org/vanbest/xmltv/RTL.java @@ -65,8 +65,6 @@ public class RTL extends AbstractEPGSource implements EPGSource { String[] xmlKeys = {"zendernr", "pgmsoort", "genre", "bijvnwlanden", "ondertiteling", "begintijd", "titel", "site_path", "wwwadres", "presentatie", "omroep", "eindtijd", "inhoud", "tt_inhoud", "alginhoud", "afl_titel", "kijkwijzer" }; - //Map xmlKeyMap = new HashMap(); - class RTLException extends Exception { public RTLException(String s) { super(s); @@ -215,6 +213,7 @@ public class RTL extends AbstractEPGSource implements EPGSource { prog.endTime = parseTime(date, e.getTextContent()); } else if (tag.equals("omroep")) { } else if (tag.equals("kijkwijzer")) { + System.out.println("Kijkwijzer: \"" + e.getTextContent() + "\""); } else if (tag.equals("presentatie")) { // A; A en B; A, B, C en D String[] presentatoren = e.getTextContent().split(", | en "); @@ -228,6 +227,7 @@ public class RTL extends AbstractEPGSource implements EPGSource { } else if (tag.equals("inhoud")) { prog.addDescription(e.getTextContent()); } else if (tag.equals("tt_inhoud")) { + prog.addDescription(e.getTextContent()); // ignore, is summary of other fields } else if (tag.equals("zendernr")) { } else if (tag.equals("titel")) { @@ -307,6 +307,8 @@ public class RTL extends AbstractEPGSource implements EPGSource { super.close(); } + // FIXME probably not correct in all cases, maybe make use + // of the order of the programmes? private Date parseTime(Date date, String time) { Calendar result = Calendar.getInstance(); result.setTime(date);