# HG changeset patch # User casties # Date 1332501228 -3600 # Node ID 383c0fee2d37868d1067be75b14019811f80c0ac # Parent b0ef5c860464e512681f0bd881062e6e8380ab75 PUT returns annotation now. diff -r b0ef5c860464 -r 383c0fee2d37 src/de/mpiwg/itgroup/annotationManager/restlet/AnnotatorAnnotations.java --- a/src/de/mpiwg/itgroup/annotationManager/restlet/AnnotatorAnnotations.java Thu Mar 22 21:37:16 2012 +0100 +++ b/src/de/mpiwg/itgroup/annotationManager/restlet/AnnotatorAnnotations.java Fri Mar 23 12:13:48 2012 +0100 @@ -150,7 +150,10 @@ setStatus(Status.SERVER_ERROR_INTERNAL, "TripleStore Error"); return null; } - // return stored annotation + /* according to https://github.com/okfn/annotator/wiki/Storage + * we should return 303: see other. + * For now we return the annotation. + */ JSONObject jo = createAnnotatorJson(storedAnnot); JsonRepresentation retRep = new JsonRepresentation(jo); return retRep; @@ -325,26 +328,24 @@ // store Annotation storedAnnot = new Convert("file:///annotations").storeAnnotation(annot); /* according to https://github.com/okfn/annotator/wiki/Storage - * we should return 303: see other - * setStatus(Status.REDIRECTION_SEE_OTHER, "go to GET"); + * we should return 303: see other. + * For now we return the annotation. */ - setStatus(Status.SUCCESS_NO_CONTENT); + jo = createAnnotatorJson(storedAnnot); + JsonRepresentation retRep = new JsonRepresentation(jo); + return retRep; } catch (TripleStoreHandlerException e) { e.printStackTrace(); setStatus(Status.SERVER_ERROR_INTERNAL, "TripleStoreHandler Error"); - return null; } catch (TripleStoreSearchError e) { e.printStackTrace(); setStatus(Status.SERVER_ERROR_INTERNAL, "TripleStoreSearch Error"); - return null; } catch (JSONException e) { e.printStackTrace(); setStatus(Status.CLIENT_ERROR_BAD_REQUEST); - return null; } catch (IOException e) { e.printStackTrace(); setStatus(Status.SERVER_ERROR_INTERNAL, "Other Error"); - return null; } return null; }