summaryrefslogtreecommitdiffstats
path: root/org/madore/damlengine/WeblogRSS.java
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2014-10-10 21:54:23 +0200
committerDavid A. Madore <david+git@madore.org>2014-10-10 21:54:23 +0200
commiteaa29f26c5aa1ff9cfc306dc23c6bcfae0c0c68d (patch)
treeb4acc2289987a57685eac4db0fb51e2b1d550f92 /org/madore/damlengine/WeblogRSS.java
parent01ad55efbfb3b0056efaa0f9a7d7c48765d7db81 (diff)
parentd6b9db7926af4dc6d7df5af55d261731bd623c23 (diff)
downloaddamlengine-eaa29f26c5aa1ff9cfc306dc23c6bcfae0c0c68d.tar.gz
damlengine-eaa29f26c5aa1ff9cfc306dc23c6bcfae0c0c68d.tar.bz2
damlengine-eaa29f26c5aa1ff9cfc306dc23c6bcfae0c0c68d.zip
Merge branch 'master' into servlet
Conflicts: org/madore/damlengine/TodoWrefAttr.java
Diffstat (limited to 'org/madore/damlengine/WeblogRSS.java')
-rw-r--r--org/madore/damlengine/WeblogRSS.java41
1 files changed, 18 insertions, 23 deletions
diff --git a/org/madore/damlengine/WeblogRSS.java b/org/madore/damlengine/WeblogRSS.java
index 0f3b296..85d9fc0 100644
--- a/org/madore/damlengine/WeblogRSS.java
+++ b/org/madore/damlengine/WeblogRSS.java
@@ -93,31 +93,26 @@ public final class WeblogRSS {
itemsSeq.appendChild(rssDoc.createTextNode("\n"));
while ( selRes.next() ) {
- int id = selRes.getInt(1);
- String date = selRes.getString(2);
- String cdate = selRes.getString(3);
- String lang = selRes.getString(4);
- String doSinglePage = selRes.getString(5);
- String title = selRes.getString(6);
- String contentXml = selRes.getString(7);
- Matcher matcher = Pattern.compile("^(\\d{4})-(\\d{2})-(\\d{2})$").matcher(date);
+ final int id = selRes.getInt(1);
+ final String date = selRes.getString(2);
+ final String cdate = selRes.getString(3);
+ final String lang = selRes.getString(4);
+ final String doSinglePage = selRes.getString(5);
+ final String title = selRes.getString(6);
+ final String contentXml = selRes.getString(7);
+ final Matcher matcher = Pattern.compile("^(\\d{4})-(\\d{2})-(\\d{2})$").matcher(date);
if ( ! matcher.matches() )
throw new IllegalArgumentException("entry "+id+" has badly formed date");
- String yearStr = matcher.group(1);
- String monthStr = matcher.group(2);
- // String dayStr = matcher.group(3);
- String numberStr = String.format("%04d",id);
- String aboutUri = weblogBaseURI
- + "#d." + date + "." + numberStr;
- String linkUri;
- if ( doSinglePage == null )
- linkUri = weblogBaseURI
- + yearStr + "-" + monthStr + ".html"
- + "#d." + date + "." + numberStr;
- else
- linkUri = weblogBaseURI
- + date + "-" + doSinglePage + ".html"
- + "#d." + date + "." + numberStr;
+ final String yearStr = matcher.group(1);
+ final String monthStr = matcher.group(2);
+ final String dayStr = matcher.group(3);
+ final String numberStr = String.format("%04d",id);
+ final WeblogLink lk = new WeblogLink(yearStr, monthStr, dayStr,
+ numberStr, "",
+ doSinglePage);
+ lk.setTypeStandard();
+ final String aboutUri = weblogBaseURI + "#" + lk.getFragment();
+ final String linkUri = lk.getTarget(weblogBaseURI);
Element li = rssDoc.createElementNS(DamlEngine.RDF_NS, "rdf:li");
itemsSeq.appendChild(li);
itemsSeq.appendChild(rssDoc.createTextNode("\n"));