# HG changeset patch # User casties # Date 1402039581 -7200 # Node ID 4e2dc67997a091c81e990ae79cc7581e6e138f16 # Parent 25eb2e1df106da305b1f59294e27ef98f4903efd save text quote from Annotator. diff -r 25eb2e1df106 -r 4e2dc67997a0 src/main/java/de/mpiwg/itgroup/annotations/Annotation.java --- a/src/main/java/de/mpiwg/itgroup/annotations/Annotation.java Fri Mar 21 13:32:41 2014 +0100 +++ b/src/main/java/de/mpiwg/itgroup/annotations/Annotation.java Fri Jun 06 09:26:21 2014 +0200 @@ -75,6 +75,10 @@ */ protected FragmentTypes fragmentType; + /** + * The selected text of the annotation target. + */ + protected String quote; /** * The Resource that is annotated e.g. a book. @@ -286,6 +290,20 @@ } /** + * @return the quote + */ + public String getQuote() { + return quote; + } + + /** + * @param quote the quote to set + */ + public void setQuote(String quote) { + this.quote = quote; + } + + /** * @return the resource */ public Resource getResource() { diff -r 25eb2e1df106 -r 4e2dc67997a0 src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java --- a/src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java Fri Mar 21 13:32:41 2014 +0100 +++ b/src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java Fri Jun 06 09:26:21 2014 +0200 @@ -519,6 +519,7 @@ annot.setUri((String) annotNode.getProperty("id", null)); annot.setBodyText((String) annotNode.getProperty("bodyText", null)); annot.setBodyUri((String) annotNode.getProperty("bodyUri", null)); + annot.setQuote((String) annotNode.getProperty("quote", null)); /* * get annotation target and resource from relation */ @@ -701,6 +702,14 @@ if (bodyUri != null) { annotNode.setProperty("bodyUri", bodyUri); } + + /* + * the annotation quote + */ + String quote = annot.getQuote(); + if (quote != null) { + annotNode.setProperty("quote", quote); + } /* * the annotation target diff -r 25eb2e1df106 -r 4e2dc67997a0 src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java --- a/src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java Fri Mar 21 13:32:41 2014 +0100 +++ b/src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java Fri Jun 06 09:26:21 2014 +0200 @@ -226,6 +226,9 @@ if (annot.getResourceUri() != null) { jo.put("resource", annot.getResourceUri()); } + if (annot.getQuote() != null) { + jo.put("quote", annot.getQuote()); + } /* * user @@ -508,6 +511,12 @@ annot.setBodyText(jo.getString("text")); } /* + * annotation quote + */ + if (jo.has("quote")) { + annot.setQuote(jo.getString("quote")); + } + /* * check authentication */ String authUser = checkAuthToken(entity);