summaryrefslogtreecommitdiffstats
path: root/org/madore/damlengine/WeblogSummary.java
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2013-04-06 20:18:10 +0200
committerDavid A. Madore <david+git@madore.org>2013-04-06 20:18:10 +0200
commita49cff43d551b29dd726a6d5c19aba31db3bfc71 (patch)
treebc3fcaebfee6b0d457e918f878ca8852a906c85a /org/madore/damlengine/WeblogSummary.java
parent2836e8c6547a04a35e08abc14f4d97e5afaf7243 (diff)
downloaddamlengine-a49cff43d551b29dd726a6d5c19aba31db3bfc71.tar.gz
damlengine-a49cff43d551b29dd726a6d5c19aba31db3bfc71.tar.bz2
damlengine-a49cff43d551b29dd726a6d5c19aba31db3bfc71.zip
Support for d:wrefcat attribute to create links inside a category.
Diffstat (limited to 'org/madore/damlengine/WeblogSummary.java')
-rw-r--r--org/madore/damlengine/WeblogSummary.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/org/madore/damlengine/WeblogSummary.java b/org/madore/damlengine/WeblogSummary.java
index 997f67a..50ab143 100644
--- a/org/madore/damlengine/WeblogSummary.java
+++ b/org/madore/damlengine/WeblogSummary.java
@@ -1,6 +1,7 @@
package org.madore.damlengine;
import java.util.HashMap;
+import java.util.HashSet;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -14,6 +15,7 @@ public final class WeblogSummary {
String lang;
String title; String titleXml;
String doSinglePage;
+ HashSet<String> catSet;
public EntrySummary(int id, String date, String lang,
String title, String titleXml,
String doSinglePage) {
@@ -23,6 +25,7 @@ public final class WeblogSummary {
this.title = title;
this.titleXml = titleXml;
this.doSinglePage = doSinglePage;
+ this.catSet = null;
}
}
@@ -50,7 +53,20 @@ public final class WeblogSummary {
String title = selRes.getString(4);
String titleXml = selRes.getString(5);
String doSinglePage = selRes.getString(6);
- singleton.entries.put(new Integer(id), new EntrySummary(id, date, lang, title, titleXml, doSinglePage));
+ singleton.entries.put(id, new EntrySummary(id, date, lang, title, titleXml, doSinglePage));
+ }
+ final PreparedStatement catSt
+ = conn.prepareStatement("SELECT id , code FROM incat");
+ final ResultSet catRes = catSt.executeQuery();
+ while ( catRes.next() ) {
+ int id = catRes.getInt(1);
+ String code = catRes.getString(2);
+ HashSet<String> catSet = singleton.entries.get(id).catSet;
+ if ( catSet == null ) {
+ catSet = new HashSet<String>();
+ singleton.entries.get(id).catSet = catSet;
+ }
+ catSet.add(code);
}
} catch (SQLException e) {
// Well, we'll have no summary. Too bad, but better than abort.