3 * Stefano Zacchiroli <zack@cs.unibo.it>
4 * for the HELM Team http://helm.cs.unibo.it/
6 * This file is part of HELM, an Hypertextual, Electronic
7 * Library of Mathematics, developed at the Computer Science
8 * Department, University of Bologna, Italy.
10 * HELM is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * HELM is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with HELM; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25 * For details, see the HELM World-Wide-Web page,
26 * http://helm.cs.unibo.it/
31 exception Uwobo_failure of string;;
33 let supported_properties = [
34 "cdata-section-elements";
41 "omit-xml-declaration";
46 let is_supported_property name = List.mem name supported_properties
48 let version = "0.2.0" ;;
55 <title>UWOBO's help message</title>
58 <h1>UWOBO (version: %s)</h1>
63 Usage: <kbd>http://hostname:uwoboport/</kbd><em>command</em>
69 <b><kbd>help</kbd></b><br />
70 display this help message
73 <b><kbd>add?bind=key,uri[&bind=key,uri[&...]]</kbd></b><br />
74 load a new stylesheet, specified by <em>uri</em>, and bind it to key
78 <b><kbd>remove[?keys=key1,key2,...]</kbd></b><br />
79 unload stylesheets specified by <em>key1, key2, ...</em> or all
80 stylesheets if no key was given
83 <b><kbd>reload[?keys=key1,key2,...]</kbd></b><br />
84 reload stylesheets specified by <em>key1, key2, ...</em> or all
85 stylesheets if no key was given
88 <b><kbd>list</kbd></b><br />
89 return a list of loaded stylesheets
92 <b><kbd>apply?xmluri=uri&keys=key1,key2,...[¶m.name=value[¶m.name=value[&...]]][¶m.key.name=value[¶m.key.name=value[&...]]][&prop.name[=value][&prop.name[=value][&...]]]</kbd></b><br />
93 apply a chain of stylesheets, specified by <em>key1, key2, ...</em>, to an
94 input document, specified by <em>uri</em>.<br />
95 Additional parameters can be set for each stylesheet application: global
96 parameters (i.e. parameters passed to all stylesheets) are set using
97 <em>param.name=value</em> syntax, per stylesheet parameters are set using
98 <em>param.key.name=value</em> where <em>key</em> is the key of a loaded
100 Properties of the final chain output can be set too: valueless properties
101 can be set using <em>prop.name</em> syntax, others can be set using
102 <em>prop.name=value</em> syntax.<br />
103 Current supported properties are: %s.
109 (String.concat ", " supported_properties) (* supported properties *)
112 let pp_error = sprintf "<html><body><h1>Error: %s</h1></body></html>";;
113 let return_error msg outchan =
114 Http_daemon.respond ~body:(pp_error msg) outchan;;
115 let bad_request body outchan =
116 Http_daemon.respond_error ~code:400 ~body outchan