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