changeset 65:82f62ef25a8f

Create namespace aware documents for 'create' and 'out' targets. Adapted XPath expressions for this. artifacts/trunk@529 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 12 Jan 2010 08:42:49 +0000
parents 8b72676698b5
children 89e3de0ee05f
files ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/rest/ArtifactOutResource.java artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CreateResource.java
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jan 09 16:59:00 2010 +0000
+++ b/ChangeLog	Tue Jan 12 08:42:49 2010 +0000
@@ -1,3 +1,9 @@
+2010-01-12  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	* artifact-database/src/main/java/de/intevation/artifactdatabase/rest/ArtifactOutResource.java,
+	  artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CreateResource.java:
+	  Create document namespace aware and adapted XPath expressions for this.
+
 2010-01-09  Ingo Weinzierl <ingo.weinzierl@intevation.de>
 
 	* artifact-database/src/main/java/de/intevation/artifactdatabase/XMLUtils.java:
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/ArtifactOutResource.java	Sat Jan 09 16:59:00 2010 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/ArtifactOutResource.java	Tue Jan 12 08:42:49 2010 +0000
@@ -32,7 +32,7 @@
 {
     public static final String PATH = "/artifact/{uuid}/{type}";
 
-    public static final String XPATH_MIME_TYPE = "/action/out/mime-type/@value";
+    public static final String XPATH_MIME_TYPE = "/art:action/art:out/art:mime-type/@value";
 
     public static final MediaType DEFAULT_MIME_TYPE =
         MediaType.APPLICATION_OCTET_STREAM;
@@ -45,6 +45,7 @@
         Document inputDocument = null;
         try {
             DomRepresentation input = new DomRepresentation(requestRepr);
+            input.setNamespaceAware(true);
             inputDocument = input.getDocument();
         }
         catch (IOException ioe) {
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CreateResource.java	Sat Jan 09 16:59:00 2010 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/CreateResource.java	Tue Jan 12 08:42:49 2010 +0000
@@ -34,7 +34,7 @@
 
     public static final String PATH = "/create";
 
-    public static final String XPATH_FACTORY = "/action/factory/@name";
+    public static final String XPATH_FACTORY = "/art:action/art:factory/@name";
 
     public static final String NO_FACTORY_MESSAGE = "No factory given";
 
@@ -46,6 +46,7 @@
         Document inputDocument = null;
         try {
             DomRepresentation input = new DomRepresentation(requestRepr);
+            input.setNamespaceAware(true);
             inputDocument = input.getDocument();
         }
         catch (IOException ioe) {

http://dive4elements.wald.intevation.org