open Printf
-(* DEBUGGING *)
-
module MQI = MQueryInterpreter
module MQIC = MQIConn
module MQGT = MQGTypes
module MQGU = MQGUtil
module MQG = MQueryGenerator
-module DB = Dbi_mysql
-
(* first of all let's initialize the Helm_registry *)
let _ =
let configuration_file = "gTopLevel.conf.xml" in
(* GLOBAL CONSTANTS *)
-let mqi_debug_fun s = debug_print ~level:2 s
-let mqi_handle = MQIC.init_if_connected ~log:mqi_debug_fun ()
-let dbh = new DB.connection ~host:"mowgli.cs.unibo.it" ~user:"helm" "mowgli"
+let mqi_handle = MQIC.init_if_connected ()
+
+let dbd =
+ Mysql.quick_connect
+ ~host:(Helm_registry.get "db.host")
+ ~user:(Helm_registry.get "db.user")
+ ~database:(Helm_registry.get "db.database")
+ ()
let xlinkns = Gdome.domString "http://www.w3.org/1999/xlink";;
let decompose_uris_choice_callback = decompose_uris_choice_callback
let mk_fresh_name_callback = mk_fresh_name_callback
let mqi_handle = mqi_handle
- let dbh = dbh
+ let dbd = dbd
end
;;
module InvokeTactics' = InvokeTactics.Make (InvokeTacticsCallbacks);;
;;
let locate_callback id =
- let uris = MetadataQuery.locate ~dbh id in
+ let uris = MetadataQuery.locate ~dbd id in
HelmLogger.log (`Msg (`T ("Locate Query: " ^ id))) ;
HelmLogger.log (`Msg (`T "Result:")) ;
List.iter (fun uri -> HelmLogger.log (`Msg (`T uri))) uris;
~packing:(vbox#pack ~expand:true ~padding:0) () in
let newinputt =
TermEditor'.term_editor
- ~dbh
+ ~dbd
~width:400 ~height:20 ~packing:scrolled_window#add
~share_environment_with:inputt ()
~isnotempty_callback:
~packing:(vbox#pack ~expand:true ~padding:0) () in
let newinputt =
TermEditor'.term_editor
- ~dbh
+ ~dbd
~width:400 ~height:20 ~packing:scrolled_window#add
~share_environment_with:inputt ()
~isnotempty_callback:
(* moved here to have visibility of the ok button *)
let newinputt =
TermEditor'.term_editor
- ~dbh
+ ~dbd
~width:400 ~height:100 ~packing:scrolled_window#add
~share_environment_with:inputt ()
~isnotempty_callback:
match !ProofEngine.goal with
| None -> ()
| Some metano ->
- let uris' = List.map fst (MetadataQuery.hint ~dbh (proof, metano)) in
+ let uris' = List.map fst (MetadataQuery.hint ~dbd (proof, metano)) in
let uri' =
user_uri_choice ~title:"Ambiguous input."
~msg: "Many lemmas can be successfully applied. Please, choose one:"
~packing:frame#add () in
let inputt =
TermEditor'.term_editor
- ~dbh
+ ~dbd
~width:400 ~height:100 ~packing:scrolled_window1#add ()
~isnotempty_callback:
(function b ->