Mercurial > hg > AnnotationManagerN4J
comparison src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResources.java @ 91:cf44d9e1a4a7
let CORS be handled by Restlet 2.3 CorsFilter.
author | casties |
---|---|
date | Sun, 08 Feb 2015 18:09:00 +0100 |
parents | 25eb2e1df106 |
children |
comparison
equal
deleted
inserted
replaced
90:475ab3d32630 | 91:cf44d9e1a4a7 |
---|---|
46 * | 46 * |
47 * @author dwinter | 47 * @author dwinter |
48 * | 48 * |
49 */ | 49 */ |
50 public class AnnotatorResources extends AnnotatorResourceImpl { | 50 public class AnnotatorResources extends AnnotatorResourceImpl { |
51 protected String getAllowedMethodsForHeader() { | |
52 return "OPTIONS,GET"; | |
53 } | |
54 | 51 |
55 /** | 52 /** |
56 * GET with JSON content-type. | 53 * GET with JSON content-type. |
57 * Parameters: user: short user name uri: user uri | 54 * Parameters: user: short user name uri: user uri |
58 * | 55 * |
60 * @return | 57 * @return |
61 */ | 58 */ |
62 @Get("json") | 59 @Get("json") |
63 public Representation doGetJSON(Representation entity) { | 60 public Representation doGetJSON(Representation entity) { |
64 logger.fine("AnnotatorResources doGetJSON!"); | 61 logger.fine("AnnotatorResources doGetJSON!"); |
65 setCorsHeaders(); | |
66 | 62 |
67 String jsonId = (String) getRequest().getAttributes().get("id"); | 63 String jsonId = (String) getRequest().getAttributes().get("id"); |
68 if (jsonId != null) { | 64 if (jsonId != null) { |
69 // URL decode | 65 // URL decode |
70 try { | 66 try { |