corpus_manager_cgi.ml 1.18 KB
Newer Older
Idir Lankri's avatar
Idir Lankri committed
1
(**************************************************************************)
Idir Lankri's avatar
Idir Lankri committed
2
(*                                                                        *)
Idir Lankri's avatar
Idir Lankri committed
3 4 5 6
(*                     The Sanskrit Heritage Platform                     *)
(*                                                                        *)
(*                              Idir Lankri                               *)
(*                                                                        *)
7
(* ©2018 Institut National de Recherche en Informatique et en Automatique *)
Idir Lankri's avatar
Idir Lankri committed
8 9
(**************************************************************************)

10 11 12 13
(* CGI script [manager] for corpus management, i.e. for listing and
   adding sentences of the corpus.  *)

value main =
14
  let env = Cgi.create_env (Cgi.query_string ()) in
15 16 17 18
  let corpdir = Cgi.decoded_get Params.corpus_dir "" env 
  and corpperm = Cgi.decoded_get Params.corpus_permission "" env in
  let permission = Web_corpus.permission_of_string corpperm in
  let lang =  Html.default_language in
19
  try
20
    Corpus_manager.mk_page corpdir permission
21
  with
22 23
  [ Sys_error msg -> Web.abort lang Control.sys_err_mess msg
  | _ -> Web.abort lang Control.fatal_err_mess "Unexpected anomaly"
24
  ]
25
;