X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Finterface%2FxsltProcessor.ml;h=95f1c70d59b5edc7a6a26f892d04e1eb43b52f6e;hb=f41a5585a648d57e4d8a24d664b0a5ce5d591148;hp=ec3d9fdb05c8f4c18462e2ae7a183324f414fd43;hpb=952ad2bf8ea4bea5999570f0f592f84bf30acd3f;p=helm.git diff --git a/helm/interface/xsltProcessor.ml b/helm/interface/xsltProcessor.ml index ec3d9fdb0..95f1c70d5 100644 --- a/helm/interface/xsltProcessor.ml +++ b/helm/interface/xsltProcessor.ml @@ -23,7 +23,57 @@ * http://cs.unibo.it/helm/. *) -let initialize = XsltProcessorHTTP.initialize +let initialize () = + Printf.printf "Initializing the UWOBO servlet, please wait" ; flush stdout ; + Hashtbl.iter + (fun key uri -> + let string_to_send = (Configuration.processor_url ^ "add?xsluri=" ^ Configuration.getter_url ^ "getxslt?uri=" ^ uri ^ "&key=" ^ key) + in + print_char '.' ; flush stdout ; + ClientHTTP.send string_to_send + ) + StyleConfiguration.styles ; + Printf.printf " ok\n" ; flush stdout +;; -let process = XsltProcessorHTTP.process +(* CSC: esempio per vedere se veniva calcolata bene. Rimuovere pure il commento +http://phd.cs.unibo.it:8080/helm/servlet/uwobo/apply?xmluri=http%3A//phd.cs.unibo.it%3A8081/getxml%3Furi%3Dcic%3A/Coq/Init/Datatypes/nat_ind.con&keys=C1,C2,L¶m.processorURL=http%3A//phd.cs.unibo.it%3A8080/helm/servlet/uwobo/¶m.getterURL=http%3A//phd.cs.unibo.it%3A8081/&prop.doctype-public=&prop.encoding=&prop.media-type=text/xml¶m.doctype-public=¶m.encoding=¶m.media-type=text/xml¶m.keys=C1%2CC2%2CL¶m.CICURI=cic:/Coq/Init/Datatypes/nat_ind.con¶m.naturalLanguage=yes¶m.annotations=NO + +&keys=C1,C2,L +*) + +let process uri usecache mode naturalLanguage annotations = + let uri = UriManager.string_of_uri uri in + let url = Configuration.getter_url ^ "getxml?uri=" ^ uri in + let keys = + match StyleConfiguration.key_list_of_mode_name mode with + first_key::key_list -> + first_key ^ + (List.fold_right + (fun key cmd -> "," ^ key ^ cmd) + key_list + "" + ) + | _ -> prerr_string "Warning: the list of keys for UWOBO is empty\n"; "" + in + let string_to_send = + Configuration.processor_url ^ "apply?xmluri=" ^ url ^ + "¶m.processorURL=" ^ Configuration.processor_url ^ + "¶m.getterURL=" ^ Configuration.getter_url ^ + "&prop.doctype-public=&prop.encoding=&prop.media-type=text/xml" ^ + "&keys=" ^ keys ^ + "¶m.keys=" ^ keys ^ + "¶m.CICURI=" ^ uri ^ + "¶m.naturalLanguage=" ^ naturalLanguage ^ + "¶m.annotations=" ^ annotations ^ + "¶m.doctype-public=¶m.encoding=¶m.media-type=text/xml" + in + string_to_send +;; + +(*CSC: ma questa funzione ha senso? Se si', in quale modulo?*) +(*CSC: tutti i parametri passati alla process sono quasi a caso!!! *) +let url_of_uri uri = + process uri true "cic" "yes" "YES" +;;