Update schema for CGI filter configuration
[metaproxy-moved-to-github.git] / xml / schema / metaproxy.rnc
1 # Metaproxy XML config file schemas
2
3 #   Copyright (c) 2005-2008 Index Data.
4
5 #   See the LICENSE file for details
6
7
8 # The RelaxNG Compact Syntax file 'metaproxy.rnc' is the master copy.
9
10 # The RelaxNG XML Syntax and XML Schema are generated using 'trang':
11 # trang metaproxy.rnc metaproxy.rng 
12 # trang metaproxy.rnc metaproxy.xsd 
13
14 # Config file validation is done using 'xmllint':
15 # xmllint -/-relaxng metaproxy.rng ../../../etc/config1.xml 
16 # xmllint -/-schema metaproxy.xsd config-bytarget.xml
17
18 # For information on RelaxNG see http://relaxng.org 
19 # see also http://books.xmlschemata.org/relaxng/
20
21
22 namespace mp = "http://indexdata.com/metaproxy"
23
24 start |= metaproxy
25
26 include "retrievalinfo.rnc"
27
28 any = (text | element * { attribute * { text }*, any })*
29
30 metaproxy =
31   element mp:metaproxy {
32     attribute version { "1.0" },
33     element mp:dlpath { xsd:string }?,
34     element mp:start {
35             attribute route { xsd:NCName }
36     },
37     element mp:filters { filter+ }?,
38     element mp:routes { route+ }
39   }
40
41 route =
42   element mp:route {
43     attribute id { xsd:NCName },
44     filter+
45   }
46
47 filter =
48   element mp:filter {
49     filter_refid
50     | filter_auth_simple
51     | filter_backend_test
52     | filter_bounce
53     | filter_cgi
54     | filter_cql_rpn
55     | filter_frontend_net
56     | filter_http_file
57     | filter_limit
58     | filter_load_balance
59     | filter_log
60     | filter_multi
61     | filter_query_rewrite
62     | filter_record_transform
63     | filter_session_shared
64     | filter_sru_z3950
65     | filter_virt_db
66     | filter_z3950_client
67 #    | filter_zeerex_explain
68   }
69
70 filter_refid = attribute refid { xsd:NCName }
71
72 filter_auth_simple =
73   attribute type { "auth_simple" },
74   attribute id { xsd:NCName }?,
75   attribute name { xsd:NCName }?,
76   element mp:userRegister { xsd:string }?,
77   element mp:targetRegister { xsd:string }?,
78   element mp:discardUnauthorisedTargets { empty }?
79
80 filter_backend_test =
81   attribute type { "backend_test" },
82   attribute id { xsd:NCName }?,
83   attribute name { xsd:NCName }?
84
85 filter_bounce =
86   attribute type { "bounce" },
87   attribute id { xsd:NCName }?,
88   attribute name { xsd:NCName }?
89
90 filter_cql_rpn =
91   attribute type { "cql_rpn" },
92   attribute id { xsd:NCName }?,
93   attribute name { xsd:NCName }?,
94   element mp:conversion {
95     attribute  file { xsd:string }
96   }
97
98 filter_frontend_net =
99   attribute type { "frontend_net" },
100   attribute id { xsd:NCName }?,
101   attribute name { xsd:NCName }?,
102   element mp:threads { xsd:integer }?,
103   element mp:port { xsd:string }+,
104   element mp:timeout { xsd:integer }?,
105   element mp:connect-max { xsd:integer }?
106
107 filter_http_file =
108   attribute type { "http_file" },
109   attribute id { xsd:NCName }?,
110   attribute name { xsd:NCName }?,
111   element mp:mimetypes { xsd:string },
112   element mp:area {
113     element mp:documentroot { xsd:string },
114     element mp:prefix { xsd:string }
115   }
116
117 filter_load_balance =
118   attribute type { "load_balance" },
119   attribute id { xsd:NCName }?,
120   attribute name { xsd:NCName }?
121
122 filter_log =
123   attribute type { "log" },
124   attribute id { xsd:NCName }?,
125   attribute name { xsd:NCName }?,
126   element mp:message { xsd:string }?,
127   element mp:time-format { xsd:string }?,
128   element mp:filename { xsd:string }?,
129   element mp:category {
130     attribute user-access { xsd:boolean }?,
131     attribute access { xsd:boolean }?,
132     attribute init-options { xsd:boolean }?,
133     attribute request-session { xsd:boolean }?,
134     attribute response-session { xsd:boolean }?,
135     attribute apdu { xsd:boolean }?,
136     attribute request-apdu { xsd:boolean }?,
137     attribute response-apdu { xsd:boolean }?
138   }?
139
140 filter_multi =
141   attribute type { "multi" },
142   attribute id { xsd:NCName }?,
143   attribute name { xsd:NCName }?,
144   element mp:target {
145     attribute route { xsd:string },
146     xsd:string
147   }*,
148   element mp:hideunavailable { empty }?,
149   element mp:mergetype { xsd:string }?
150
151 filter_query_rewrite =
152   attribute type { "query_rewrite" },
153   attribute id { xsd:NCName }?,
154   attribute name { xsd:NCName }?,
155   element mp:xslt { 
156         attribute stylesheet { xsd:string }
157   }
158
159 filter_record_transform =
160   attribute type { "record_transform" },
161   attribute id { xsd:NCName }?,
162   attribute name { xsd:NCName }?,
163   retrievalinfo 
164
165 filter_session_shared =
166   attribute type { "session_shared" },
167   attribute id { xsd:NCName }?,
168   attribute name { xsd:NCName }?,
169   element mp:resultset {
170     attribute max { xsd:integer },
171     attribute ttl { xsd:integer }
172   }?,
173   element mp:session {
174     attribute ttl { xsd:integer }
175   }?
176
177 filter_sru_z3950 =
178   attribute type { "sru_z3950" },
179   attribute id { xsd:NCName }?,
180   attribute name { xsd:NCName }?,
181   element mp:database {  
182      attribute name { xsd:NCName },
183      any        
184   }*
185
186 filter_virt_db =
187   attribute type { "virt_db" },
188   attribute id { xsd:NCName }?,
189   attribute name { xsd:NCName }?,
190   element mp:pass-vhosts { xsd:boolean }?,
191   element mp:virtual {
192     attribute route { xsd:NCName }?,
193     element mp:database { xsd:string },
194     element mp:target { xsd:string }+
195   }+
196
197 filter_z3950_client =
198   attribute type { "z3950_client" },
199   attribute id { xsd:NCName }?,
200   attribute name { xsd:NCName }?,
201   element mp:timeout { xsd:integer }?,
202   element mp:default_target { xsd:string }?,
203   element mp:force_target { xsd:string }?
204
205 filter_limit =
206   attribute type { "limit" },
207   element mp:limit {
208     attribute bandwidth { xsd:integer }?,
209     attribute pdu { xsd:integer }?,
210     attribute search { xsd:integer }?,
211     attribute retrieve { xsd:integer }?
212   }?
213
214 filter_cgi =
215   attribute type { "cgi" },
216   element mp:map {
217     attribute path { xsd:string },
218     attribute exec { xsd:string }
219   }*
220
221 #filter_zeerex_explain =
222 #  attribute type { "zeerex_explain" },
223 #  attribute id { xsd:NCName }?,
224 #  attribute name { xsd:NCName }?,
225 #  element mp:database {  
226 #     attribute name { xsd:NCName },
227 #     any        
228 #  }+
229
230