changeset 1017:8637756275e5

Added a <dc:comment> tag to place comments in the meta data templates. flys-artifacts/trunk@2463 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 04 Aug 2011 10:58:00 +0000
parents ff7b81cf9999
children d42fa223be48
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/meta-data-user.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java
diffstat 3 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Aug 04 10:24:23 2011 +0000
+++ b/flys-artifacts/ChangeLog	Thu Aug 04 10:58:00 2011 +0000
@@ -1,3 +1,11 @@
+2011-08-04  Sascha L. Teichmann <sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java:
+	  Added a <dc:comment> tag to place comments in the meta data templates.
+	  <!-- ... --> comments are copied through.
+
+	* doc/conf/meta-data-user.xml: Added a simple test.
+
 2011-08-04  Sascha L. Teichmann <sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/services/MetaDataService.java:
--- a/flys-artifacts/doc/conf/meta-data-user.xml	Thu Aug 04 10:24:23 2011 +0000
+++ b/flys-artifacts/doc/conf/meta-data-user.xml	Thu Aug 04 10:58:00 2011 +0000
@@ -1,6 +1,12 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage">
 <datacage>
-    <dc:text>IMPLEMENT ME!</dc:text>
+    <dc:comment>
+        User specific part
+        ------------------
+    </dc:comment>
+    <dc:if test="dc:contains($parameters, 'user-id')">
+        <dc:text>Current user id: ${user-id}</dc:text>
+    </dc:if>
 </datacage>
 </dc:template>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java	Thu Aug 04 10:24:23 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java	Thu Aug 04 10:58:00 2011 +0000
@@ -431,6 +431,9 @@
                     else if ("text".equals(localName)) {
                         text(parent, (Element)current);
                     }
+                    else if ("comment".equals(localName)) {
+                        // ignore comments in output
+                    }
                     else if ("convert".equals(localName)) {
                         convert(parent, (Element)current);
                     }

http://dive4elements.wald.intevation.org