(*
- * Copyright (C) 2003, HELM Team.
+ * Copyright (C) 2003:
+ * Stefano Zacchiroli <zack@cs.unibo.it>
+ * for the HELM Team http://helm.cs.unibo.it/
*
* This file is part of HELM, an Hypertextual, Electronic
* Library of Mathematics, developed at the Computer Science
* MA 02111-1307, USA.
*
* For details, see the HELM World-Wide-Web page,
- * http://cs.unibo.it/helm/.
+ * http://helm.cs.unibo.it/
*)
open Hbugs_types;;
match root#node_type with
(* general purpose *)
+ | T_element "help" -> Help
+ | T_element "usage" -> Usage root#data
| T_element "exception" -> Exception (get_attr root "name", root#data)
(* client -> broker *)
List.fold_left (fun s id -> sprintf "%s<tutor id=\"%s\" />" s id) ""
let string_of_msg = function
+ | Help -> "<help />"
+ | Usage usage_string -> sprintf "<usage>%s</usage>" usage_string
| Exception (name, value) ->
sprintf "<exception name=\"%s\">%s</exception>" name value
| Register_client (id, url) ->
| Thanks (id, musing_id) ->
sprintf "<thanks id=\"%s\" musing_id=\"%s\" />" id musing_id
+let submit_req ~url msg =
+ msg_of_string (Hbugs_misc.http_post ~body:(string_of_msg msg) url)
+