Filter frontend_net honors connect-max
[metaproxy-moved-to-github.git] / xml / schema / metaproxy.rng
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   Metaproxy XML config file schemas
4   
5     Copyright (c) 2005-2008 Index Data.
6   
7     See the LICENSE file for details
8   
9   
10   The RelaxNG Compact Syntax file 'metaproxy.rnc' is the master copy.
11   
12   The RelaxNG XML Syntax and XML Schema are generated using 'trang':
13   trang metaproxy.rnc metaproxy.rng 
14   trang metaproxy.rnc metaproxy.xsd 
15   
16   Config file validation is done using 'xmllint':
17   xmllint -/-relaxng metaproxy.rng ../../../etc/config1.xml 
18   xmllint -/-schema metaproxy.xsd config-bytarget.xml
19   
20   For information on RelaxNG see http://relaxng.org 
21   see also http://books.xmlschemata.org/relaxng/
22 -->
23 <grammar xmlns:mp="http://indexdata.com/metaproxy" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
24   <start combine="choice">
25     <ref name="metaproxy"/>
26   </start>
27   <include href="retrievalinfo.rng"/>
28   <define name="any">
29     <zeroOrMore>
30       <choice>
31         <text/>
32         <element>
33           <anyName/>
34           <zeroOrMore>
35             <attribute>
36               <anyName/>
37             </attribute>
38           </zeroOrMore>
39           <ref name="any"/>
40         </element>
41       </choice>
42     </zeroOrMore>
43   </define>
44   <define name="metaproxy">
45     <element name="mp:metaproxy">
46       <attribute name="version">
47         <value>1.0</value>
48       </attribute>
49       <optional>
50         <element name="mp:dlpath">
51           <data type="string"/>
52         </element>
53       </optional>
54       <element name="mp:start">
55         <attribute name="route">
56           <data type="NCName"/>
57         </attribute>
58       </element>
59       <optional>
60         <element name="mp:filters">
61           <oneOrMore>
62             <ref name="filter"/>
63           </oneOrMore>
64         </element>
65       </optional>
66       <element name="mp:routes">
67         <oneOrMore>
68           <ref name="route"/>
69         </oneOrMore>
70       </element>
71     </element>
72   </define>
73   <define name="route">
74     <element name="mp:route">
75       <attribute name="id">
76         <data type="NCName"/>
77       </attribute>
78       <oneOrMore>
79         <ref name="filter"/>
80       </oneOrMore>
81     </element>
82   </define>
83   <define name="filter">
84     <element name="mp:filter">
85       <choice>
86         <ref name="filter_refid"/>
87         <ref name="filter_auth_simple"/>
88         <ref name="filter_backend_test"/>
89         <ref name="filter_bounce"/>
90         <ref name="filter_cql_rpn"/>
91         <ref name="filter_frontend_net"/>
92         <ref name="filter_http_file"/>
93         <ref name="filter_load_balance"/>
94         <ref name="filter_log"/>
95         <ref name="filter_multi"/>
96         <ref name="filter_query_rewrite"/>
97         <ref name="filter_record_transform"/>
98         <ref name="filter_session_shared"/>
99         <ref name="filter_sru_z3950"/>
100         <ref name="filter_virt_db"/>
101         <ref name="filter_z3950_client"/>
102         <ref name="filter_limit"/>
103       </choice>
104       <!--    | filter_zeerex_explain -->
105     </element>
106   </define>
107   <define name="filter_refid">
108     <attribute name="refid">
109       <data type="NCName"/>
110     </attribute>
111   </define>
112   <define name="filter_auth_simple">
113     <attribute name="type">
114       <value>auth_simple</value>
115     </attribute>
116     <optional>
117       <attribute name="id">
118         <data type="NCName"/>
119       </attribute>
120     </optional>
121     <optional>
122       <attribute name="name">
123         <data type="NCName"/>
124       </attribute>
125     </optional>
126     <optional>
127       <element name="mp:userRegister">
128         <data type="string"/>
129       </element>
130     </optional>
131     <optional>
132       <element name="mp:targetRegister">
133         <data type="string"/>
134       </element>
135     </optional>
136     <optional>
137       <element name="mp:discardUnauthorisedTargets">
138         <empty/>
139       </element>
140     </optional>
141   </define>
142   <define name="filter_backend_test">
143     <attribute name="type">
144       <value>backend_test</value>
145     </attribute>
146     <optional>
147       <attribute name="id">
148         <data type="NCName"/>
149       </attribute>
150     </optional>
151     <optional>
152       <attribute name="name">
153         <data type="NCName"/>
154       </attribute>
155     </optional>
156   </define>
157   <define name="filter_bounce">
158     <attribute name="type">
159       <value>bounce</value>
160     </attribute>
161     <optional>
162       <attribute name="id">
163         <data type="NCName"/>
164       </attribute>
165     </optional>
166     <optional>
167       <attribute name="name">
168         <data type="NCName"/>
169       </attribute>
170     </optional>
171   </define>
172   <define name="filter_cql_rpn">
173     <attribute name="type">
174       <value>cql_rpn</value>
175     </attribute>
176     <optional>
177       <attribute name="id">
178         <data type="NCName"/>
179       </attribute>
180     </optional>
181     <optional>
182       <attribute name="name">
183         <data type="NCName"/>
184       </attribute>
185     </optional>
186     <element name="mp:conversion">
187       <attribute name="file">
188         <data type="string"/>
189       </attribute>
190     </element>
191   </define>
192   <define name="filter_frontend_net">
193     <attribute name="type">
194       <value>frontend_net</value>
195     </attribute>
196     <optional>
197       <attribute name="id">
198         <data type="NCName"/>
199       </attribute>
200     </optional>
201     <optional>
202       <attribute name="name">
203         <data type="NCName"/>
204       </attribute>
205     </optional>
206     <optional>
207       <element name="mp:threads">
208         <data type="integer"/>
209       </element>
210     </optional>
211     <oneOrMore>
212       <element name="mp:port">
213         <data type="string"/>
214       </element>
215     </oneOrMore>
216     <optional>
217       <element name="mp:timeout">
218         <data type="integer"/>
219       </element>
220     </optional>
221     <optional>
222       <element name="mp:connect-max">
223         <data type="integer"/>
224       </element>
225     </optional>
226   </define>
227   <define name="filter_http_file">
228     <attribute name="type">
229       <value>http_file</value>
230     </attribute>
231     <optional>
232       <attribute name="id">
233         <data type="NCName"/>
234       </attribute>
235     </optional>
236     <optional>
237       <attribute name="name">
238         <data type="NCName"/>
239       </attribute>
240     </optional>
241     <element name="mp:mimetypes">
242       <data type="string"/>
243     </element>
244     <element name="mp:area">
245       <element name="mp:documentroot">
246         <data type="string"/>
247       </element>
248       <element name="mp:prefix">
249         <data type="string"/>
250       </element>
251     </element>
252   </define>
253   <define name="filter_load_balance">
254     <attribute name="type">
255       <value>load_balance</value>
256     </attribute>
257     <optional>
258       <attribute name="id">
259         <data type="NCName"/>
260       </attribute>
261     </optional>
262     <optional>
263       <attribute name="name">
264         <data type="NCName"/>
265       </attribute>
266     </optional>
267   </define>
268   <define name="filter_log">
269     <attribute name="type">
270       <value>log</value>
271     </attribute>
272     <optional>
273       <attribute name="id">
274         <data type="NCName"/>
275       </attribute>
276     </optional>
277     <optional>
278       <attribute name="name">
279         <data type="NCName"/>
280       </attribute>
281     </optional>
282     <optional>
283       <element name="mp:message">
284         <data type="string"/>
285       </element>
286     </optional>
287     <optional>
288       <element name="mp:time-format">
289         <data type="string"/>
290       </element>
291     </optional>
292     <optional>
293       <element name="mp:filename">
294         <data type="string"/>
295       </element>
296     </optional>
297     <optional>
298       <element name="mp:category">
299         <optional>
300           <attribute name="user-access">
301             <data type="boolean"/>
302           </attribute>
303         </optional>
304         <optional>
305           <attribute name="access">
306             <data type="boolean"/>
307           </attribute>
308         </optional>
309         <optional>
310           <attribute name="init-options">
311             <data type="boolean"/>
312           </attribute>
313         </optional>
314         <optional>
315           <attribute name="request-session">
316             <data type="boolean"/>
317           </attribute>
318         </optional>
319         <optional>
320           <attribute name="response-session">
321             <data type="boolean"/>
322           </attribute>
323         </optional>
324         <optional>
325           <attribute name="apdu">
326             <data type="boolean"/>
327           </attribute>
328         </optional>
329         <optional>
330           <attribute name="request-apdu">
331             <data type="boolean"/>
332           </attribute>
333         </optional>
334         <optional>
335           <attribute name="response-apdu">
336             <data type="boolean"/>
337           </attribute>
338         </optional>
339       </element>
340     </optional>
341   </define>
342   <define name="filter_multi">
343     <attribute name="type">
344       <value>multi</value>
345     </attribute>
346     <optional>
347       <attribute name="id">
348         <data type="NCName"/>
349       </attribute>
350     </optional>
351     <optional>
352       <attribute name="name">
353         <data type="NCName"/>
354       </attribute>
355     </optional>
356     <zeroOrMore>
357       <element name="mp:target">
358         <attribute name="route">
359           <data type="string"/>
360         </attribute>
361         <data type="string"/>
362       </element>
363     </zeroOrMore>
364     <optional>
365       <element name="mp:hideunavailable">
366         <empty/>
367       </element>
368     </optional>
369     <optional>
370       <element name="mp:mergetype">
371         <data type="string"/>
372       </element>
373     </optional>
374   </define>
375   <define name="filter_query_rewrite">
376     <attribute name="type">
377       <value>query_rewrite</value>
378     </attribute>
379     <optional>
380       <attribute name="id">
381         <data type="NCName"/>
382       </attribute>
383     </optional>
384     <optional>
385       <attribute name="name">
386         <data type="NCName"/>
387       </attribute>
388     </optional>
389     <element name="mp:xslt">
390       <attribute name="stylesheet">
391         <data type="string"/>
392       </attribute>
393     </element>
394   </define>
395   <define name="filter_record_transform">
396     <attribute name="type">
397       <value>record_transform</value>
398     </attribute>
399     <optional>
400       <attribute name="id">
401         <data type="NCName"/>
402       </attribute>
403     </optional>
404     <optional>
405       <attribute name="name">
406         <data type="NCName"/>
407       </attribute>
408     </optional>
409     <ref name="retrievalinfo"/>
410   </define>
411   <define name="filter_session_shared">
412     <attribute name="type">
413       <value>session_shared</value>
414     </attribute>
415     <optional>
416       <attribute name="id">
417         <data type="NCName"/>
418       </attribute>
419     </optional>
420     <optional>
421       <attribute name="name">
422         <data type="NCName"/>
423       </attribute>
424     </optional>
425     <optional>
426       <element name="mp:resultset">
427         <attribute name="max">
428           <data type="integer"/>
429         </attribute>
430         <attribute name="ttl">
431           <data type="integer"/>
432         </attribute>
433       </element>
434     </optional>
435     <optional>
436       <element name="mp:session">
437         <attribute name="ttl">
438           <data type="integer"/>
439         </attribute>
440       </element>
441     </optional>
442   </define>
443   <define name="filter_sru_z3950">
444     <attribute name="type">
445       <value>sru_z3950</value>
446     </attribute>
447     <optional>
448       <attribute name="id">
449         <data type="NCName"/>
450       </attribute>
451     </optional>
452     <optional>
453       <attribute name="name">
454         <data type="NCName"/>
455       </attribute>
456     </optional>
457     <oneOrMore>
458       <element name="mp:database">
459         <attribute name="name">
460           <data type="NCName"/>
461         </attribute>
462         <ref name="any"/>
463       </element>
464     </oneOrMore>
465   </define>
466   <define name="filter_virt_db">
467     <attribute name="type">
468       <value>virt_db</value>
469     </attribute>
470     <optional>
471       <attribute name="id">
472         <data type="NCName"/>
473       </attribute>
474     </optional>
475     <optional>
476       <attribute name="name">
477         <data type="NCName"/>
478       </attribute>
479     </optional>
480     <oneOrMore>
481       <element name="mp:virtual">
482         <optional>
483           <attribute name="route">
484             <data type="NCName"/>
485           </attribute>
486         </optional>
487         <element name="mp:database">
488           <data type="NCName"/>
489         </element>
490         <oneOrMore>
491           <element name="mp:target">
492             <data type="string"/>
493           </element>
494         </oneOrMore>
495       </element>
496     </oneOrMore>
497   </define>
498   <define name="filter_z3950_client">
499     <attribute name="type">
500       <value>z3950_client</value>
501     </attribute>
502     <optional>
503       <attribute name="id">
504         <data type="NCName"/>
505       </attribute>
506     </optional>
507     <optional>
508       <attribute name="name">
509         <data type="NCName"/>
510       </attribute>
511     </optional>
512     <optional>
513       <element name="mp:timeout">
514         <data type="integer"/>
515       </element>
516     </optional>
517     <optional>
518       <element name="mp:default_target">
519         <data type="string"/>
520       </element>
521     </optional>
522     <optional>
523       <element name="mp:force_target">
524         <data type="string"/>
525       </element>
526     </optional>
527   </define>
528   <define name="filter_limit">
529     <attribute name="type">
530       <value>limit</value>
531     </attribute>
532     <optional>
533       <element name="mp:limit">
534         <optional>
535           <attribute name="bandwidth">
536             <data type="integer"/>
537           </attribute>
538         </optional>
539         <optional>
540           <attribute name="pdu">
541             <data type="integer"/>
542           </attribute>
543         </optional>
544         <optional>
545           <attribute name="search">
546             <data type="integer"/>
547           </attribute>
548         </optional>
549         <optional>
550           <attribute name="retrieve">
551             <data type="integer"/>
552           </attribute>
553         </optional>
554       </element>
555     </optional>
556   </define>
557 </grammar>
558 <!--
559   filter_zeerex_explain =
560    attribute type { "zeerex_explain" },
561    attribute id { xsd:NCName }?,
562    attribute name { xsd:NCName }?,
563    element mp:database {  
564       attribute name { xsd:NCName },
565       any        
566    }+
567 -->