From 3b1023c45a919f25ef38c080f2ac2c0dc5d5e7ca Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Sun, 28 Aug 2011 19:52:02 +0200 Subject: (Preliminary) handling of weblog entry selection and summary. --- org/madore/damlengine/TodoEntryElement.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'org/madore/damlengine/TodoEntryElement.java') diff --git a/org/madore/damlengine/TodoEntryElement.java b/org/madore/damlengine/TodoEntryElement.java index 8b38881..78bffd1 100644 --- a/org/madore/damlengine/TodoEntryElement.java +++ b/org/madore/damlengine/TodoEntryElement.java @@ -24,7 +24,8 @@ public final class TodoEntryElement extends TodoDefaultElement { @Override public void handleNodeOnly() { - if ( ! ( caller instanceof TodoWeblogElement ) ) + if ( ! ( caller instanceof TodoWeblogElement + || caller instanceof TodoWeblogSelectElement ) ) throw new IllegalArgumentException("entry node can only be child of weblog node"); Element div = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "div"); @@ -35,11 +36,11 @@ public final class TodoEntryElement extends TodoDefaultElement { String entryNumberStr = node.getAttributeNS(null, "number"); if ( ! Pattern.matches("^\\d{4}$", entryNumberStr) ) - throw new IllegalArgumentException("title number attribute must be of the form NNNN"); + throw new IllegalArgumentException("entry number attribute must be of the form NNNN"); String entryDateStr = node.getAttributeNS(null, "date"); Matcher entryDateMatcher = Pattern.compile("^(\\d{4})-(\\d{2})-(\\d{2})$").matcher(entryDateStr); if ( ! entryDateMatcher.matches() ) - throw new IllegalArgumentException("title date attribute must be of the form YYYY-MM-DD"); + throw new IllegalArgumentException("entry date attribute must be of the form YYYY-MM-DD"); String entryYearStr = entryDateMatcher.group(1); String entryMonthStr = entryDateMatcher.group(2); String entryDayStr = entryDateMatcher.group(3); -- cgit v1.2.3