]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/hbugs/common/hbugs_messages.ml
- fixed helm web page url and copyright notice
[helm.git] / helm / hbugs / common / hbugs_messages.ml
index 67e739c603ad5379fe557175fbcd98b936e156f9..d0a6fe1dbad25b1d5274f25f335e3b97eb6c561d 100644 (file)
@@ -1,5 +1,7 @@
 (*
- *  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
@@ -21,7 +23,7 @@
  *  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;;
@@ -62,6 +64,8 @@ let msg_of_string' s =
   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 *)
@@ -145,6 +149,8 @@ let pp_tutor_ids =
   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) ->
@@ -205,3 +211,6 @@ let string_of_msg = function
   | 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)
+