cpack_repository/commit

Adding interactive search to the package manager

authorJan Wielemaker
Thu Dec 2 17:20:54 2010 +0100
committerJan Wielemaker
Thu Dec 2 17:20:54 2010 +0100
commitbad133062d4043b77a99ae4884477581c142a38d
tree4bb9f026a415113d98e963a93a7b8f04682bc08a
parent843b26ddfba97ea9801394abd6a68a76fcd397cf
Diff style: patch stat
diff --git a/config-available/cpack_repository.pl b/config-available/cpack_repository.pl
index 6374669..e2ab2bc 100644
--- a/config-available/cpack_repository.pl
+++ b/config-available/cpack_repository.pl
@@ -7,6 +7,9 @@
 :- use_module(library(semweb/rdf_db)).
 :- use_module(library(semweb/rdf_library)).
 
+:- use_module(applications(isearch)).
+:- use_module(library(http/http_dispatch)).
+
 /** <module> CPACK repository interface
 */
 
@@ -41,3 +44,27 @@ cliopatria:menu_item(275=current_user/cpack_my_packages, 'My CPACKs') :-
 
 user:body(user(Style), Body) -->
 	user:body(cliopatria(Style), Body).
+
+% Hijack the search-field, redirecting the queries to the interactive
+% search page.
+
+:- http_handler(cpack(isearch_literal),
+		isearch_page([ header(false),
+			       query_type(literal)
+			     ]),
+		[id(list_triples_with_literal), priority(10)]).
+:- http_handler(cpack(isearch),
+		isearch_page([ header(false)
+			     ]),
+		[id(search), priority(10)]).
+
+:- rdf_meta
+	exclude_property(r).
+
+cliopatria:facet_exclude_property(P) :-
+	exclude_property(P).
+
+exclude_property(cpack:repository).
+exclude_property(cpack:base).
+exclude_property(cpack:path).
+exclude_property(cpack:size).