annotate src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java @ 22:b1fb0d117877

adding and listing groups via html works now. no editing of group membership yet. no authentication yet.
author casties
date Thu, 20 Sep 2012 17:42:26 +0200
parents 715aa11d138b
children 9f653697437e 0731c4549065
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
1 /**
47b53ae385d1 merging old code
casties
parents:
diff changeset
2 * Implements the "annotations" uri of the Annotator API. see
47b53ae385d1 merging old code
casties
parents:
diff changeset
3 * <https://github.com/okfn/annotator/wiki/Storage>
47b53ae385d1 merging old code
casties
parents:
diff changeset
4 */
47b53ae385d1 merging old code
casties
parents:
diff changeset
5 package de.mpiwg.itgroup.annotations.restlet;
47b53ae385d1 merging old code
casties
parents:
diff changeset
6
47b53ae385d1 merging old code
casties
parents:
diff changeset
7 import java.io.IOException;
47b53ae385d1 merging old code
casties
parents:
diff changeset
8
47b53ae385d1 merging old code
casties
parents:
diff changeset
9 import org.json.JSONException;
47b53ae385d1 merging old code
casties
parents:
diff changeset
10 import org.json.JSONObject;
47b53ae385d1 merging old code
casties
parents:
diff changeset
11 import org.restlet.data.Status;
47b53ae385d1 merging old code
casties
parents:
diff changeset
12 import org.restlet.ext.json.JsonRepresentation;
47b53ae385d1 merging old code
casties
parents:
diff changeset
13 import org.restlet.representation.Representation;
47b53ae385d1 merging old code
casties
parents:
diff changeset
14 import org.restlet.resource.Delete;
47b53ae385d1 merging old code
casties
parents:
diff changeset
15 import org.restlet.resource.Get;
47b53ae385d1 merging old code
casties
parents:
diff changeset
16 import org.restlet.resource.Post;
47b53ae385d1 merging old code
casties
parents:
diff changeset
17 import org.restlet.resource.Put;
47b53ae385d1 merging old code
casties
parents:
diff changeset
18
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
19 import de.mpiwg.itgroup.annotations.Annotation;
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
20 import de.mpiwg.itgroup.annotations.Person;
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
21 import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
22
47b53ae385d1 merging old code
casties
parents:
diff changeset
23 /**
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
24 * Implements the "annotations" uri of the Annotator API. see
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
25 * <https://github.com/okfn/annotator/wiki/Storage>
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
26 *
47b53ae385d1 merging old code
casties
parents:
diff changeset
27 * @author dwinter, casties
47b53ae385d1 merging old code
casties
parents:
diff changeset
28 *
47b53ae385d1 merging old code
casties
parents:
diff changeset
29 */
47b53ae385d1 merging old code
casties
parents:
diff changeset
30 public class AnnotatorAnnotations extends AnnotatorResourceImpl {
47b53ae385d1 merging old code
casties
parents:
diff changeset
31
47b53ae385d1 merging old code
casties
parents:
diff changeset
32 protected String getAllowedMethodsForHeader() {
47b53ae385d1 merging old code
casties
parents:
diff changeset
33 return "OPTIONS,GET,POST,PUT,DELETE";
47b53ae385d1 merging old code
casties
parents:
diff changeset
34 }
47b53ae385d1 merging old code
casties
parents:
diff changeset
35
47b53ae385d1 merging old code
casties
parents:
diff changeset
36 /**
47b53ae385d1 merging old code
casties
parents:
diff changeset
37 * GET with JSON content-type.
47b53ae385d1 merging old code
casties
parents:
diff changeset
38 *
47b53ae385d1 merging old code
casties
parents:
diff changeset
39 * @param entity
47b53ae385d1 merging old code
casties
parents:
diff changeset
40 * @return
47b53ae385d1 merging old code
casties
parents:
diff changeset
41 */
47b53ae385d1 merging old code
casties
parents:
diff changeset
42 @Get("json")
47b53ae385d1 merging old code
casties
parents:
diff changeset
43 public Representation doGetJSON(Representation entity) {
47b53ae385d1 merging old code
casties
parents:
diff changeset
44 logger.debug("AnnotatorAnnotations doGetJSON!");
47b53ae385d1 merging old code
casties
parents:
diff changeset
45 setCorsHeaders();
47b53ae385d1 merging old code
casties
parents:
diff changeset
46 // id from URI /annotations/{id}
47b53ae385d1 merging old code
casties
parents:
diff changeset
47 String jsonId = (String) getRequest().getAttributes().get("id");
47b53ae385d1 merging old code
casties
parents:
diff changeset
48 String id = decodeJsonId(jsonId);
47b53ae385d1 merging old code
casties
parents:
diff changeset
49 logger.debug("annotation-id=" + id);
47b53ae385d1 merging old code
casties
parents:
diff changeset
50
22
b1fb0d117877 adding and listing groups via html works now.
casties
parents: 20
diff changeset
51 if (id == null) {
b1fb0d117877 adding and listing groups via html works now.
casties
parents: 20
diff changeset
52 // TODO: what to return without id - list all annotations?
b1fb0d117877 adding and listing groups via html works now.
casties
parents: 20
diff changeset
53 setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
b1fb0d117877 adding and listing groups via html works now.
casties
parents: 20
diff changeset
54 return null;
b1fb0d117877 adding and listing groups via html works now.
casties
parents: 20
diff changeset
55 }
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
56
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
57 // do authentication
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
58 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
59 logger.debug("request authenticated=" + authUser);
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
60
16
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
61 AnnotationStore store = getAnnotationStore();
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
62 Annotation annot = store.getAnnotationById(id);
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
63 if (annot != null) {
16
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
64 if (! annot.isActionAllowed("read", authUser, store)) {
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
65 setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!");
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
66 return null;
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
67 }
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
68 JSONObject result = createAnnotatorJson(annot, (authUser == null));
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
69 logger.debug("sending:");
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
70 logger.debug(result);
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
71 return new JsonRepresentation(result);
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
72 } else {
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
73 // not found
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
74 setStatus(Status.CLIENT_ERROR_NOT_FOUND);
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
75 return null;
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
76 }
47b53ae385d1 merging old code
casties
parents:
diff changeset
77 }
47b53ae385d1 merging old code
casties
parents:
diff changeset
78
47b53ae385d1 merging old code
casties
parents:
diff changeset
79 /**
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
80 * POST with JSON content-type. Creates a new Annotation.
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
81 *
47b53ae385d1 merging old code
casties
parents:
diff changeset
82 * @return
47b53ae385d1 merging old code
casties
parents:
diff changeset
83 */
47b53ae385d1 merging old code
casties
parents:
diff changeset
84 @Post("json")
47b53ae385d1 merging old code
casties
parents:
diff changeset
85 public Representation doPostJson(Representation entity) {
47b53ae385d1 merging old code
casties
parents:
diff changeset
86 logger.debug("AnnotatorAnnotations doPostJSON!");
47b53ae385d1 merging old code
casties
parents:
diff changeset
87 // set headers
47b53ae385d1 merging old code
casties
parents:
diff changeset
88 setCorsHeaders();
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
89
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
90 // do authentication TODO: who's allowed to create?
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
91 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
92 logger.debug("request authenticated=" + authUser);
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
93 if (authUser == null) {
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
94 setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!");
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
95 return null;
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
96 }
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
97
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
98 Annotation annot = null;
47b53ae385d1 merging old code
casties
parents:
diff changeset
99 try {
47b53ae385d1 merging old code
casties
parents:
diff changeset
100 JsonRepresentation jrep = new JsonRepresentation(entity);
47b53ae385d1 merging old code
casties
parents:
diff changeset
101 JSONObject jo = jrep.getJsonObject();
47b53ae385d1 merging old code
casties
parents:
diff changeset
102 if (jo == null) {
47b53ae385d1 merging old code
casties
parents:
diff changeset
103 setStatus(Status.SERVER_ERROR_INTERNAL);
47b53ae385d1 merging old code
casties
parents:
diff changeset
104 return null;
47b53ae385d1 merging old code
casties
parents:
diff changeset
105 }
47b53ae385d1 merging old code
casties
parents:
diff changeset
106 // make sure id is not set for POST
47b53ae385d1 merging old code
casties
parents:
diff changeset
107 jo.remove("id");
47b53ae385d1 merging old code
casties
parents:
diff changeset
108 // get Annotation object from posted JSON
47b53ae385d1 merging old code
casties
parents:
diff changeset
109 annot = createAnnotation(jo, entity);
47b53ae385d1 merging old code
casties
parents:
diff changeset
110 } catch (IOException e1) {
47b53ae385d1 merging old code
casties
parents:
diff changeset
111 setStatus(Status.SERVER_ERROR_INTERNAL);
47b53ae385d1 merging old code
casties
parents:
diff changeset
112 return null;
47b53ae385d1 merging old code
casties
parents:
diff changeset
113 } catch (JSONException e) {
47b53ae385d1 merging old code
casties
parents:
diff changeset
114 setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
47b53ae385d1 merging old code
casties
parents:
diff changeset
115 return null;
47b53ae385d1 merging old code
casties
parents:
diff changeset
116 }
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
117 if (annot == null) {
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
118 setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
47b53ae385d1 merging old code
casties
parents:
diff changeset
119 return null;
47b53ae385d1 merging old code
casties
parents:
diff changeset
120 }
47b53ae385d1 merging old code
casties
parents:
diff changeset
121 Annotation storedAnnot;
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
122 // store Annotation
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
123 storedAnnot = getAnnotationStore().storeAnnotation(annot);
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
124 /*
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
125 * according to https://github.com/okfn/annotator/wiki/Storage we should
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
126 * return 303: see other. For now we return the annotation.
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
127 */
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
128 JSONObject jo = createAnnotatorJson(storedAnnot, (authUser == null));
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
129 JsonRepresentation retRep = new JsonRepresentation(jo);
47b53ae385d1 merging old code
casties
parents:
diff changeset
130 return retRep;
47b53ae385d1 merging old code
casties
parents:
diff changeset
131 }
47b53ae385d1 merging old code
casties
parents:
diff changeset
132
47b53ae385d1 merging old code
casties
parents:
diff changeset
133 /**
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
134 * PUT with JSON content-type. Modifies an Annotation.
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
135 *
47b53ae385d1 merging old code
casties
parents:
diff changeset
136 * @param entity
47b53ae385d1 merging old code
casties
parents:
diff changeset
137 * @return
47b53ae385d1 merging old code
casties
parents:
diff changeset
138 */
47b53ae385d1 merging old code
casties
parents:
diff changeset
139 @Put("json")
47b53ae385d1 merging old code
casties
parents:
diff changeset
140 public Representation doPutJSON(Representation entity) {
47b53ae385d1 merging old code
casties
parents:
diff changeset
141 logger.debug("AnnotatorAnnotations doPutJSON!");
47b53ae385d1 merging old code
casties
parents:
diff changeset
142 setCorsHeaders();
47b53ae385d1 merging old code
casties
parents:
diff changeset
143 // id from URI /annotations/{id}
47b53ae385d1 merging old code
casties
parents:
diff changeset
144 String jsonId = (String) getRequest().getAttributes().get("id");
47b53ae385d1 merging old code
casties
parents:
diff changeset
145 String id = decodeJsonId(jsonId);
47b53ae385d1 merging old code
casties
parents:
diff changeset
146 logger.debug("annotation-id=" + id);
47b53ae385d1 merging old code
casties
parents:
diff changeset
147
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
148 // do authentication
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
149 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
150 logger.debug("request authenticated=" + authUser);
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
151
47b53ae385d1 merging old code
casties
parents:
diff changeset
152 Annotation annot = null;
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
153 AnnotationStore store = getAnnotationStore();
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
154 try {
47b53ae385d1 merging old code
casties
parents:
diff changeset
155 JsonRepresentation jrep = new JsonRepresentation(entity);
47b53ae385d1 merging old code
casties
parents:
diff changeset
156 JSONObject jo = jrep.getJsonObject();
47b53ae385d1 merging old code
casties
parents:
diff changeset
157 if (jo == null) {
47b53ae385d1 merging old code
casties
parents:
diff changeset
158 setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
47b53ae385d1 merging old code
casties
parents:
diff changeset
159 return null;
47b53ae385d1 merging old code
casties
parents:
diff changeset
160 }
47b53ae385d1 merging old code
casties
parents:
diff changeset
161 // get stored Annotation
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
162 Annotation storedAnnot = store.getAnnotationById(id);
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
163 if (storedAnnot == null) {
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
164 setStatus(Status.CLIENT_ERROR_NOT_FOUND);
47b53ae385d1 merging old code
casties
parents:
diff changeset
165 return null;
47b53ae385d1 merging old code
casties
parents:
diff changeset
166 }
16
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
167 if (! storedAnnot.isActionAllowed("update", authUser, store)) {
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
168 setStatus(Status.CLIENT_ERROR_FORBIDDEN);
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
169 return null;
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
170 }
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
171 // update from posted JSON
47b53ae385d1 merging old code
casties
parents:
diff changeset
172 annot = updateAnnotation(storedAnnot, jo, entity);
47b53ae385d1 merging old code
casties
parents:
diff changeset
173 // store Annotation
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
174 storedAnnot = store.storeAnnotation(annot);
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
175 /*
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
176 * according to https://github.com/okfn/annotator/wiki/Storage we
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
177 * should return 303: see other. but the client doesn't like it
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
178 * setStatus(Status.REDIRECTION_SEE_OTHER); // go to same URL as
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
179 * this one Reference thisUrl = this.getReference();
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
180 * this.getResponse().setLocationRef(thisUrl);
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
181 */
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
182 // return new annotation
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
183 jo = createAnnotatorJson(storedAnnot, (authUser == null));
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
184 JsonRepresentation retRep = new JsonRepresentation(jo);
47b53ae385d1 merging old code
casties
parents:
diff changeset
185 return retRep;
47b53ae385d1 merging old code
casties
parents:
diff changeset
186 } catch (JSONException e) {
47b53ae385d1 merging old code
casties
parents:
diff changeset
187 e.printStackTrace();
47b53ae385d1 merging old code
casties
parents:
diff changeset
188 setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
47b53ae385d1 merging old code
casties
parents:
diff changeset
189 } catch (IOException e) {
47b53ae385d1 merging old code
casties
parents:
diff changeset
190 e.printStackTrace();
47b53ae385d1 merging old code
casties
parents:
diff changeset
191 setStatus(Status.SERVER_ERROR_INTERNAL, "Other Error");
47b53ae385d1 merging old code
casties
parents:
diff changeset
192 }
47b53ae385d1 merging old code
casties
parents:
diff changeset
193 return null;
47b53ae385d1 merging old code
casties
parents:
diff changeset
194 }
47b53ae385d1 merging old code
casties
parents:
diff changeset
195
47b53ae385d1 merging old code
casties
parents:
diff changeset
196 /**
20
715aa11d138b fixes in permission handling: admin and delete default to creator.
casties
parents: 16
diff changeset
197 * DELETE with JSON content-type. Deletes an Annotation.
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
198 *
47b53ae385d1 merging old code
casties
parents:
diff changeset
199 * @param entity
47b53ae385d1 merging old code
casties
parents:
diff changeset
200 * @return
47b53ae385d1 merging old code
casties
parents:
diff changeset
201 */
47b53ae385d1 merging old code
casties
parents:
diff changeset
202 @Delete("json")
47b53ae385d1 merging old code
casties
parents:
diff changeset
203 public Representation doDeleteJSON(Representation entity) {
47b53ae385d1 merging old code
casties
parents:
diff changeset
204 logger.debug("AnnotatorAnnotations doDeleteJSON!");
47b53ae385d1 merging old code
casties
parents:
diff changeset
205 setCorsHeaders();
47b53ae385d1 merging old code
casties
parents:
diff changeset
206 // id from URI /annotations/{id}
47b53ae385d1 merging old code
casties
parents:
diff changeset
207 String jsonId = (String) getRequest().getAttributes().get("id");
47b53ae385d1 merging old code
casties
parents:
diff changeset
208 String id = decodeJsonId(jsonId);
47b53ae385d1 merging old code
casties
parents:
diff changeset
209 logger.debug("annotation-id=" + id);
47b53ae385d1 merging old code
casties
parents:
diff changeset
210
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
211 // do authentication
15
58357a4b86de ASSIGNED - # 249: Annotations shared in groups
casties
parents: 14
diff changeset
212 Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
213 logger.debug("request authenticated=" + authUser);
16
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
214 AnnotationStore store = getAnnotationStore();
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
215 Annotation annot = store.getAnnotationById(id);
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
216 if (annot != null) {
16
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
217 if (! annot.isActionAllowed("delete", authUser, store)) {
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
218 setStatus(Status.CLIENT_ERROR_FORBIDDEN, "Not Authorized!");
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
219 return null;
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
220 }
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
221 }
14
629e15b345aa permissions mostly work. need more server-side checking.
casties
parents: 4
diff changeset
222
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
223 // delete annotation
16
794077e6288c CLOSED - # 252: Tags for Annotations
casties
parents: 15
diff changeset
224 store.deleteById(id);
4
3599b29c393f store seems to work now :-)
casties
parents: 3
diff changeset
225 setStatus(Status.SUCCESS_NO_CONTENT);
3
47b53ae385d1 merging old code
casties
parents:
diff changeset
226 return null;
47b53ae385d1 merging old code
casties
parents:
diff changeset
227 }
47b53ae385d1 merging old code
casties
parents:
diff changeset
228
47b53ae385d1 merging old code
casties
parents:
diff changeset
229 }