comparison artifact-database/src/main/java/de/intevation/artifactdatabase/rest/ArtifactResource.java @ 64:8b72676698b5

Create a namespace aware document out of the request. We consider namespaces now. Adapted xpath to find action. artifacts/trunk@523 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Sat, 09 Jan 2010 16:59:00 +0000
parents 9a29899b31e5
children 48d1a9a082c2
comparison
equal deleted inserted replaced
63:824dd614e647 64:8b72676698b5
31 public class ArtifactResource 31 public class ArtifactResource
32 extends BaseResource 32 extends BaseResource
33 { 33 {
34 private static Logger logger = Logger.getLogger(ArtifactResource.class); 34 private static Logger logger = Logger.getLogger(ArtifactResource.class);
35 35
36 public static final String XPATH_ACTION = "/action/type/@name"; 36 public static final String XPATH_ACTION = "/art:action/art:type/@name";
37 37
38 public static final String PATH = "/artifact/{uuid}"; 38 public static final String PATH = "/artifact/{uuid}";
39 39
40 public static final String NO_ACTION_MESSAGE = "no action given"; 40 public static final String NO_ACTION_MESSAGE = "no action given";
41 public static final String NO_SUCH_ACTION_MESSAGE = "no such action"; 41 public static final String NO_SUCH_ACTION_MESSAGE = "no such action";
110 protected Representation innerPost(Representation requestRepr) { 110 protected Representation innerPost(Representation requestRepr) {
111 111
112 Document inputDocument = null; 112 Document inputDocument = null;
113 try { 113 try {
114 DomRepresentation input = new DomRepresentation(requestRepr); 114 DomRepresentation input = new DomRepresentation(requestRepr);
115 input.setNamespaceAware(true);
115 inputDocument = input.getDocument(); 116 inputDocument = input.getDocument();
116 } 117 }
117 catch (IOException ioe) { 118 catch (IOException ioe) {
118 logger.error(ioe.getMessage()); 119 logger.error(ioe.getMessage());
119 Response response = getResponse(); 120 Response response = getResponse();

http://dive4elements.wald.intevation.org