diff artifact-database/src/main/java/de/intevation/artifactdatabase/rest/ArtifactOutResource.java @ 40:af22d4de275c

Log RuntimeExceptions in REST calls to log4j. artifacts/trunk@112 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 23 Sep 2009 08:27:35 +0000
parents 3f03aee55c2f
children 41c225c8bd41
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/ArtifactOutResource.java	Mon Sep 21 11:56:10 2009 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/rest/ArtifactOutResource.java	Wed Sep 23 08:27:35 2009 +0000
@@ -2,9 +2,7 @@
 
 import org.apache.log4j.Logger;
 
-import org.restlet.resource.Get;  
-import org.restlet.resource.Post;
-import org.restlet.resource.ServerResource;
+import org.restlet.resource.ResourceException;
 
 import org.restlet.data.Request;
 import org.restlet.data.Response;
@@ -30,7 +28,7 @@
  * @author Sascha L. Teichmann (sascha.teichmann@intevation)
  */
 public class ArtifactOutResource
-extends      ServerResource
+extends      BaseResource
 {
     public static final String PATH = "/artifact/{uuid}/{type}";
 
@@ -41,13 +39,9 @@
 
     private static Logger logger = Logger.getLogger(ArtifactOutResource.class);
 
-    @Post
-    public Representation represent() {
-
-        Request request = getRequest();
-
-        Representation requestRepr = request.getEntity();
-
+    protected Representation innerPost(Representation requestRepr)
+    throws    ResourceException
+    {
         Document inputDocument = null;
         try {
             DomRepresentation input = new DomRepresentation(requestRepr);
@@ -63,6 +57,8 @@
         ArtifactDatabase db = (ArtifactDatabase)getContext()
             .getAttributes().get("database");
 
+        Request request = getRequest();
+
         String identifier = (String)request.getAttributes().get("uuid");
 
         if (logger.isDebugEnabled()) {

http://dive4elements.wald.intevation.org