Mercurial > hg > AnnotationManager
comparison src/main/java/de/mpiwg/itgroup/annotationManager/restlet/AddAndReadAnnotations.java @ 33:e5f5848892a2
new annotation model basically works.
author | casties |
---|---|
date | Thu, 31 May 2012 19:08:48 +0200 |
parents | 235b91ba8dff |
children |
comparison
equal
deleted
inserted
replaced
32:40846c0b344d | 33:e5f5848892a2 |
---|---|
91 setStatus(Status.CLIENT_ERROR_NOT_ACCEPTABLE); | 91 setStatus(Status.CLIENT_ERROR_NOT_ACCEPTABLE); |
92 return null; | 92 return null; |
93 } | 93 } |
94 | 94 |
95 // | 95 // |
96 RDFSearcher searcher = new RDFSearcher("file:///annotations"); //TODO should ge into config file | 96 RDFSearcher searcher = new RDFSearcher(NS.MPIWG_ANNOT_CTX); //TODO should ge into config file |
97 | 97 |
98 String retString="<html><body><table>"; | 98 String retString="<html><body><table>"; |
99 String lineFormat="<tr><td><a href=\"%s\">%s</a></td>" + | 99 String lineFormat="<tr><td><a href=\"%s\">%s</a></td>" + |
100 "<td><a href=\"%s\">%s</a></td><td>%s</td><td>%s</td><td><a href=\"%s\">%s</a></td><td><a href=\"%s\">%s</a></td></div>"; | 100 "<td><a href=\"%s\">%s</a></td><td>%s</td><td>%s</td><td><a href=\"%s\">%s</a></td><td><a href=\"%s\">%s</a></td></div>"; |
101 try { | 101 try { |
193 String limit=form.getFirstValue("limit"); | 193 String limit=form.getFirstValue("limit"); |
194 String offset=form.getFirstValue("offset"); | 194 String offset=form.getFirstValue("offset"); |
195 | 195 |
196 | 196 |
197 // | 197 // |
198 RDFSearcher searcher = new RDFSearcher("file:///annotations"); //TODO should ge into config file | 198 RDFSearcher searcher = new RDFSearcher(NS.MPIWG_ANNOT_CTX); //TODO should ge into config file |
199 | 199 |
200 JSONArray ja; | 200 JSONArray ja; |
201 try { | 201 try { |
202 | 202 |
203 List<Annotation> annots=searcher.searchByUriUser(uri,user,limit,offset); | 203 List<Annotation> annots=searcher.searchByUriUser(uri,user,limit,offset); |
438 } | 438 } |
439 | 439 |
440 | 440 |
441 | 441 |
442 try { | 442 try { |
443 return new Convert("file:///annotations").storeAnnotation(annot); | 443 return new Convert(NS.MPIWG_ANNOT_CTX).storeAnnotation(annot); |
444 } catch (TripleStoreStoreError e) { | 444 } catch (TripleStoreStoreError e) { |
445 e.printStackTrace(); | 445 e.printStackTrace(); |
446 setStatus(Status.SERVER_ERROR_INTERNAL, "TripleStore Error"); | 446 setStatus(Status.SERVER_ERROR_INTERNAL, "TripleStore Error"); |
447 return null; | 447 return null; |
448 } | 448 } |