From 1710554809835a82415a1f8789bed3016c58fc96 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Sun, 28 Aug 2011 22:35:34 +0200 Subject: Handling of weblog index (including killing nested a elements). --- org/madore/damlengine/WeblogSummary.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'org/madore/damlengine/WeblogSummary.java') diff --git a/org/madore/damlengine/WeblogSummary.java b/org/madore/damlengine/WeblogSummary.java index ceaf28e..babfcf5 100644 --- a/org/madore/damlengine/WeblogSummary.java +++ b/org/madore/damlengine/WeblogSummary.java @@ -11,11 +11,15 @@ public final class WeblogSummary { public static final class EntrySummary { int id; String date; - String title; - public EntrySummary(int id, String date, String title) { + String lang; + String title; String titleXml; + public EntrySummary(int id, String date, String lang, + String title, String titleXml) { this.id = id; this.date = date; + this.lang = lang; this.title = title; + this.titleXml = titleXml; } } @@ -34,18 +38,19 @@ public final class WeblogSummary { try { final Connection conn = WeblogDatabaseConnection.getConnection(); final PreparedStatement selSt - = conn.prepareStatement("SELECT id , edate , title FROM entries"); + = conn.prepareStatement("SELECT id , edate , lang , title , title_xml FROM entries"); final ResultSet selRes = selSt.executeQuery(); while ( selRes.next() ) { int id = selRes.getInt(1); String date = selRes.getString(2); - String title = selRes.getString(3); - singleton.entries.put(new Integer(id), new EntrySummary(id, date, title)); + String lang = selRes.getString(3); + String title = selRes.getString(4); + String titleXml = selRes.getString(5); + singleton.entries.put(new Integer(id), new EntrySummary(id, date, lang, title, titleXml)); } } catch (SQLException e) { - throw new RuntimeException(e); // Well, we'll have no summary. Too bad, but better than abort. - // singleton = null; + singleton = null; } return singleton; } -- cgit v1.2.3