summaryrefslogtreecommitdiffstats
path: root/org/madore/damlengine/WeblogSummary.java
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2011-11-12 14:33:35 +0100
committerDavid A. Madore <david+git@madore.org>2011-11-12 14:33:35 +0100
commit07f2f3c30a6e0bc811e436925dfdfcf5befdecb7 (patch)
tree823deb363f8c7449a2028bc5171bf46d7f6218eb /org/madore/damlengine/WeblogSummary.java
parent71dc0d53fcefea70ce978d305fba653cc2180a3b (diff)
downloaddamlengine-07f2f3c30a6e0bc811e436925dfdfcf5befdecb7.tar.gz
damlengine-07f2f3c30a6e0bc811e436925dfdfcf5befdecb7.tar.bz2
damlengine-07f2f3c30a6e0bc811e436925dfdfcf5befdecb7.zip
Entry single pages: handle permalinks gracefully, populate with attribute.
* A single page is generated from the single-page attribute on <entry> element (stored in database as do_single_page). * Permalink refers to the single page. Same from weblog index. Other links are subject to debate (e.g., what about internal links? now we link to single page when link has a supplement part, but this is debatable).
Diffstat (limited to 'org/madore/damlengine/WeblogSummary.java')
-rw-r--r--org/madore/damlengine/WeblogSummary.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/org/madore/damlengine/WeblogSummary.java b/org/madore/damlengine/WeblogSummary.java
index babfcf5..997f67a 100644
--- a/org/madore/damlengine/WeblogSummary.java
+++ b/org/madore/damlengine/WeblogSummary.java
@@ -13,13 +13,16 @@ public final class WeblogSummary {
String date;
String lang;
String title; String titleXml;
+ String doSinglePage;
public EntrySummary(int id, String date, String lang,
- String title, String titleXml) {
+ String title, String titleXml,
+ String doSinglePage) {
this.id = id;
this.date = date;
this.lang = lang;
this.title = title;
this.titleXml = titleXml;
+ this.doSinglePage = doSinglePage;
}
}
@@ -38,7 +41,7 @@ public final class WeblogSummary {
try {
final Connection conn = WeblogDatabaseConnection.getConnection();
final PreparedStatement selSt
- = conn.prepareStatement("SELECT id , edate , lang , title , title_xml FROM entries");
+ = conn.prepareStatement("SELECT id , edate , lang , title , title_xml , do_single_page FROM entries");
final ResultSet selRes = selSt.executeQuery();
while ( selRes.next() ) {
int id = selRes.getInt(1);
@@ -46,7 +49,8 @@ public final class WeblogSummary {
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));
+ String doSinglePage = selRes.getString(6);
+ singleton.entries.put(new Integer(id), new EntrySummary(id, date, lang, title, titleXml, doSinglePage));
}
} catch (SQLException e) {
// Well, we'll have no summary. Too bad, but better than abort.