summaryrefslogtreecommitdiffstats
path: root/org
diff options
context:
space:
mode:
Diffstat (limited to 'org')
-rw-r--r--org/madore/damlengine/WeblogPopulate.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org/madore/damlengine/WeblogPopulate.java b/org/madore/damlengine/WeblogPopulate.java
index c3b76b9..9b6694e 100644
--- a/org/madore/damlengine/WeblogPopulate.java
+++ b/org/madore/damlengine/WeblogPopulate.java
@@ -53,6 +53,8 @@ public final class WeblogPopulate {
= conn.prepareStatement("UPDATE entries SET (edate,mdate,lang,title,title_xml,content,sha1)=(?,DEFAULT,?,?,?::xml,?::xml,?) WHERE id=?");
final PreparedStatement updateCSt
= conn.prepareStatement("UPDATE entries SET (edate,mdate,lang,title,title_xml,content,sha1,cdate)=(?,DEFAULT,?,?,?::xml,?::xml,?,?::timestamptz) WHERE id=?");
+ final PreparedStatement checkDateSt
+ = conn.prepareStatement("SELECT to_char(cdate,'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') FROM entries WHERE id=?");
final PreparedStatement clearCatSt
= conn.prepareStatement("DELETE FROM incat WHERE id=?");
final PreparedStatement setCatSt
@@ -135,6 +137,14 @@ public final class WeblogPopulate {
insertSt.setString(8, cdate);
insertSt.executeUpdate();
}
+ if ( ! Pattern.matches("^\\d{4}-\\d{2}-\\d{2}T\\d{2}\\:\\d{2}(?:\\:\\d{2})?(?:Z|[\\+\\-]\\d{2}\\:\\d{2})$", cdate) ) {
+ checkDateSt.setInt(1, id);
+ ResultSet checkDate = checkDateSt.executeQuery();
+ checkDate.next();
+ String checkDateStr = checkDate.getString(1);
+ System.err.println("cdate for entry "+id+": "
+ +checkDateStr);
+ }
clearCatSt.setInt(1, id);
clearCatSt.executeUpdate();
for ( String cat : catList ) {
@@ -152,6 +162,7 @@ public final class WeblogPopulate {
insertCSt.close();
updateNSt.close();
updateCSt.close();
+ checkDateSt.close();
clearCatSt.close();
setCatSt.close();