diff src/de/mpiwg/itgroup/annotationManager/restlet/AnnotatorSearch.java @ 17:b0ef5c860464

updating and deleting annotations works now! more cleanup.
author casties
date Thu, 22 Mar 2012 21:37:16 +0100
parents 667d98fd28bd
children
line wrap: on
line diff
--- a/src/de/mpiwg/itgroup/annotationManager/restlet/AnnotatorSearch.java	Thu Mar 22 10:54:56 2012 +0100
+++ b/src/de/mpiwg/itgroup/annotationManager/restlet/AnnotatorSearch.java	Thu Mar 22 21:37:16 2012 +0100
@@ -8,7 +8,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.log4j.Logger;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -21,7 +20,7 @@
 import org.restlet.resource.Get;
 
 import de.mpiwg.itgroup.annotationManager.Errors.TripleStoreSearchError;
-import de.mpiwg.itgroup.annotationManager.RDFHandling.Convert;
+import de.mpiwg.itgroup.annotationManager.RDFHandling.Annotation;
 import de.mpiwg.itgroup.annotationManager.RDFHandling.RDFSearcher;
 import de.mpiwg.itgroup.triplestoremanager.exceptions.TripleStoreHandlerException;
 
@@ -65,10 +64,10 @@
         JSONArray ja;
         try {
 
-            List<Convert.Annotation> annots = searcher.searchByUriUser(uri, user, limit, offset);
+            List<Annotation> annots = searcher.searchByUriUser(uri, user, limit, offset);
 
             ja = new JSONArray();
-            for (Convert.Annotation annot : annots) {
+            for (Annotation annot : annots) {
                 JSONObject jo = createAnnotatorJson(annot);
                 if (jo != null) {
                     ja.put(createAnnotatorJson(annot));
@@ -141,9 +140,9 @@
                 + "<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>";
         try {
 
-            List<Convert.Annotation> annots = searcher.searchByUriUser(uri, user, limit, offset);
+            List<Annotation> annots = searcher.searchByUriUser(uri, user, limit, offset);
 
-            for (Convert.Annotation annot : annots) {
+            for (Annotation annot : annots) {
 
                 RestServer restServer = (RestServer) getApplication();
                 String userName = restServer.getUserNameFromLdap(annot.creator);
@@ -151,11 +150,11 @@
 
                 if (annot.xpointers == null || annot.xpointers.size() == 0)
                     retString += String.format(lineFormat, userName, userName, annot.url, annot.url, annot.time, annot.text,
-                            annot.xpointer, annot.xpointer, annot.annotationUri, annot.annotationUri);
+                            annot.xpointer, annot.xpointer, annot.getAnnotationUri(), annot.getAnnotationUri());
                 else {
                     for (String xpointerString : annot.xpointers) {
                         retString += String.format(lineFormat, userName, userName, annot.url, annot.url, annot.time, annot.text,
-                                xpointerString, xpointerString, annot.annotationUri, annot.annotationUri);
+                                xpointerString, xpointerString, annot.getAnnotationUri(), annot.getAnnotationUri());
                     }
                 }