image_annotation/commit

Added option to only return body contents.

authorChris Dijkshoorn
Mon Jan 19 17:42:33 2015 +0100
committerChris Dijkshoorn
Mon Jan 19 17:42:33 2015 +0100
commit58cd8ae2877b85761b3679eb373a3a9f61104e23
tree3594288784112f4fda9267be5f2171b78b20ee17
parentcd6073e215afd3eb4d1127fc5fdd637355d9d8b5
Diff style: patch stat
diff --git a/applications/annotation.pl b/applications/annotation.pl
index cbcdf16..b94805b 100644
--- a/applications/annotation.pl
+++ b/applications/annotation.pl
@@ -158,6 +158,11 @@ http_annotation(Request) :-
 		      default(DefaultTarget),
 		      description('URI of the object to be annotated')
 		     ]),
+		  body_only(BodyOnly,
+		     [boolean,
+		      default(false),
+		      description('Indicate whether only the contents of the body should be returned')
+		     ]),
 		  ui(UI,
 		     [ default(DefaultUI),
 		       optional(true),
@@ -189,6 +194,7 @@ http_annotation(Request) :-
 	Options = [
 		   title(Title),
 		   stylesheet(Stylesheet),
+		   body_only(BodyOnly),
 		   ui(UI),
 		   targets([Target]),
 		   user(User),
@@ -220,6 +226,10 @@ get_metafields(URI, ExtraFields, Fields) :-
 %
 %	HTML page
 
+annotation_page(Options) :-
+	option(body_only(true), Options),
+	reply_html_page([], \annotation_page_body(Options)).
+
 annotation_page(Options) :-
 	reply_html_page(
 	    [ \annotation_page_header(Options) ],