Changeset 75:25eb2e1df106 in AnnotationManagerN4J for src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java
r70 r75 71 71 @Get("json") 72 72 public Representation doGetJSON(Representation entity) { 73 logger. debug("AnnotatorAnnotations doGetJSON!");73 logger.fine("AnnotatorAnnotations doGetJSON!"); 74 74 setCorsHeaders(); 75 75 // id from URI /annotations/{id} … … 84 84 } 85 85 id = decodeJsonId(jsonId); 86 logger. debug("annotation-id=" + id);86 logger.fine("annotation-id=" + id); 87 87 } 88 88 89 89 // do authentication 90 90 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity)); 91 logger. debug("request authenticated=" + authUser);91 logger.fine("request authenticated=" + authUser); 92 92 93 93 if (id == null) { … … 168 168 @Post("json") 169 169 public Representation doPostJson(Representation entity) { 170 logger. debug("AnnotatorAnnotations doPostJSON!");170 logger.fine("AnnotatorAnnotations doPostJSON!"); 171 171 // set headers 172 172 setCorsHeaders(); … … 174 174 // do authentication TODO: who's allowed to create? 175 175 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity)); 176 logger. debug("request authenticated=" + authUser);176 logger.fine("request authenticated=" + authUser); 177 177 if (authUser == null) { 178 178 setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!"); … … 223 223 @Put("json") 224 224 public Representation doPutJSON(Representation entity) { 225 logger. debug("AnnotatorAnnotations doPutJSON!");225 logger.fine("AnnotatorAnnotations doPutJSON!"); 226 226 setCorsHeaders(); 227 227 // id from URI /annotations/{id} 228 228 String jsonId = (String) getRequest().getAttributes().get("id"); 229 229 String id = decodeJsonId(jsonId); 230 logger. debug("annotation-id=" + id);230 logger.fine("annotation-id=" + id); 231 231 232 232 // do authentication 233 233 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity)); 234 logger. debug("request authenticated=" + authUser);234 logger.fine("request authenticated=" + authUser); 235 235 236 236 Annotation annot = null; … … 269 269 return retRep; 270 270 } catch (JSONException e) { 271 logger. error("Error in doPutJSON",e);271 logger.severe("Error in doPutJSON: "+e); 272 272 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); 273 273 } catch (IOException e) { 274 logger. error("Error in doPutJSON",e);274 logger.severe("Error in doPutJSON: "+e); 275 275 setStatus(Status.SERVER_ERROR_INTERNAL, "Other Error"); 276 276 } … … 286 286 @Delete("json") 287 287 public Representation doDeleteJSON(Representation entity) { 288 logger. debug("AnnotatorAnnotations doDeleteJSON!");288 logger.fine("AnnotatorAnnotations doDeleteJSON!"); 289 289 setCorsHeaders(); 290 290 // id from URI /annotations/{id} 291 291 String jsonId = (String) getRequest().getAttributes().get("id"); 292 292 String id = decodeJsonId(jsonId); 293 logger. debug("annotation-id=" + id);293 logger.fine("annotation-id=" + id); 294 294 295 295 // do authentication 296 296 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity)); 297 logger. debug("request authenticated=" + authUser);297 logger.fine("request authenticated=" + authUser); 298 298 AnnotationStore store = getAnnotationStore(); 299 299 Annotation annot = store.getAnnotationById(id);
Note: See TracChangeset
for help on using the changeset viewer.