Mercurial > hg > AnnotationManagerN4J
comparison src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResources.java @ 75:25eb2e1df106
change logging to java.util.logging.
author | casties |
---|---|
date | Fri, 21 Mar 2014 13:32:41 +0100 |
parents | 2b1e6df5e21a |
children | cf44d9e1a4a7 |
comparison
equal
deleted
inserted
replaced
74:e5ff09208c28 | 75:25eb2e1df106 |
---|---|
59 * @param entity | 59 * @param entity |
60 * @return | 60 * @return |
61 */ | 61 */ |
62 @Get("json") | 62 @Get("json") |
63 public Representation doGetJSON(Representation entity) { | 63 public Representation doGetJSON(Representation entity) { |
64 logger.debug("AnnotatorResources doGetJSON!"); | 64 logger.fine("AnnotatorResources doGetJSON!"); |
65 setCorsHeaders(); | 65 setCorsHeaders(); |
66 | 66 |
67 String jsonId = (String) getRequest().getAttributes().get("id"); | 67 String jsonId = (String) getRequest().getAttributes().get("id"); |
68 if (jsonId != null) { | 68 if (jsonId != null) { |
69 // URL decode | 69 // URL decode |
73 // this shouldn't happen | 73 // this shouldn't happen |
74 } | 74 } |
75 } | 75 } |
76 String uri = decodeJsonId(jsonId); | 76 String uri = decodeJsonId(jsonId); |
77 | 77 |
78 logger.debug("resources-id=" + uri); | 78 logger.fine("resources-id=" + uri); |
79 | 79 |
80 if (uri == null) { | 80 if (uri == null) { |
81 return getAllResources(); | 81 return getAllResources(); |
82 } else { | 82 } else { |
83 return getResource(uri); | 83 return getResource(uri); |
120 result.put("total", results.length()); | 120 result.put("total", results.length()); |
121 } catch (JSONException e) { | 121 } catch (JSONException e) { |
122 setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error"); | 122 setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error"); |
123 return null; | 123 return null; |
124 } | 124 } |
125 logger.debug("sending:"); | 125 logger.fine("sending:"); |
126 logger.debug(result); | 126 logger.fine(result.toString()); |
127 return new JsonRepresentation(result); | 127 return new JsonRepresentation(result); |
128 } | 128 } |
129 | 129 |
130 } | 130 } |