vumix/commit

extend access page with links to multiple prototypes

authorMichiel Hildebrand
Mon Apr 23 17:11:30 2012 +0200
committerMichiel Hildebrand
Mon Apr 23 17:11:30 2012 +0200
commitdf8402baff92a155db5c4b49b1f86e47e4081179
treee4c305546d61eecb529f2f8c705b618642f40f30
parentd25bc73cba0f54489aaf6980517e9101b1475b9a
Diff style: patch stat
diff --git a/applications/vumix.pl b/applications/vumix.pl
index 5d50b25..773abac 100644
--- a/applications/vumix.pl
+++ b/applications/vumix.pl
@@ -105,7 +105,8 @@ http_vumix(_Request) :-
 	reply_html_page(
 	    [ title(['Fragments'])
 	    ],
-	    [table(tbody(\html_fragments(Fragments, User)))]).
+	    [table([cellpadding(10),cellspacing(0),border(1)],
+		   tbody(\html_fragments(Fragments, User)))]).
 
 test_fragment(URI, Min) :-
 	rdf(URI, rdf:type, pprime:'TestFragment'),
@@ -120,10 +121,15 @@ html_fragments([], _) --> !.
 html_fragments([F|Fs], User) -->
 	{ fragment_label(F, Label),
 	  findall(Time, annotated_fragment(F, User, _Process, Time), Times),
-	  http_link_to_id(http_vumix_annotate, [target(F)], Link)
+	  http_link_to_id(http_yaz_player, [video(F)], Player),
+	  http_link_to_id(http_vumix_annotate, [target(F)], Annotate),
+	  http_link_to_id(http_vumix_p0, [target(F)], Suggest)
 	},
-	html(tr([td(a(href(Link), Label)),
-		 td(\html_times(Times))
+	html(tr([td([valign(top)],Label),
+		 td(\html_times(Times)),
+		 td([valign(top)],a(href(Player), 'player')),
+		 td([valign(top)],a(href(Annotate), 'annotate')),
+		 td([valign(top)],a(href(Suggest), 'annotate with suggestions'))
 		])),
 	html_fragments(Fs, User).
 
diff --git a/config-available/load_mbh_example.pl b/config-available/load_mbh_example.pl
index 8214bff..4baa80a 100644
--- a/config-available/load_mbh_example.pl
+++ b/config-available/load_mbh_example.pl
@@ -4,9 +4,13 @@
 :- use_module(library('semweb/rdf_db')).
 :- use_module(library(http/http_dispatch)).
 :- use_module(applications(vumix)).  % this defines the http_vumix http handler used below ...
+:- use_module(library(tfidf)).
+:- use_module(library(listing)).
 
-mbh_example :-
-	rdf_load(rdf('mbh_example.ttl')), % load example video and config file
+:- rdf_load(rdf('mbh_test_fragments.ttl')).
+:- rdf_load(rdf('mbh_example.ttl')). % load example video and config file
+
+/*
 	http_link_to_id(http_vumix, [target('http://semanticweb.cs.vu.nl/prestoprime/video18702'),
 				     field('http://semanticweb.cs.vu.nl/prestoprime/personAnnotation'),
 				     field('http://semanticweb.cs.vu.nl/prestoprime/placeAnnotation'),
@@ -17,6 +21,21 @@ mbh_example :-
 	http_handler(cliopatria(p0),
 		     http_redirect(moved, Location),
 		     []).
+*/
 
-:- mbh_example.
-:- rdf_load(rdf('mbh_test_fragments.ttl')).
+load_tag_rank :-
+	(   exists_file('tag_rank.pl')
+	->  compile('tag_rank.pl')
+	;   compute_tag_rank
+	).
+
+compute_tag_rank :-
+	format('compute tag ranks'),
+	tell('tag_rank.pl'),
+	(   rdf(Video,rdf:type,pprime:'TestFragment'),
+	    tag_rank(Video, RankedTagList),
+	    portray_clause(tag_rank_cache(Video, RankedTagList)),
+	    fail
+	;   told,
+	    format('tag rank finished')
+	).