Further refinements
[metaproxy-moved-to-github.git] / etc / config1.xml
1 <?xml version="1.0"?>
2 <!-- imagined config for yp2..
3   The router system understands yp2, sequence and filter elements.
4   Everything else interpreted by filters.
5   Each filter is invoked in a sequence (unless a filter invokes another
6   sequence.. A start sequence must be determined somehow.
7   -->
8 <yp2 xmlns="http://indexdata.dk/yp2/config/1">
9   <start route="id_hytg"/>
10   <filters>
11     <filter id="front_default" type="frontend-net">
12       <!-- the Z39.50/HTTP frontend -->
13       <port>210</port>
14     </filter>
15     <filter id="log_cout" type="log">          <!-- apply logging always -->
16       <logfile>mylog.log</logfile>
17     </filter>
18   </filters>
19
20   <routes>  
21     <route id="start">
22       <filter refid="gftr"/>
23       <filter type="cond">           <!-- conditional -->
24         <if test="port=210 and db=public" route="A"/> 
25         <if test="port=210 and db=other" route="B"/> 
26         <switch>
27           <case test="blabla" route="C"/>
28           <case test="blabla2" route="C2"/>
29           <default route="C3"/>
30         </switch>
31       </filter>
32       <filter type="log">          <!-- apply logging always -->
33         <logfile>mylog.log</logfile>
34       </filter>   
35     <filter name="reject">        <!-- reject .. -->
36     </filter>
37     </route>
38     <route id="public">
39       <filter type="z3950-client">
40         <target>localhost:9999/A</target>
41     </filter>
42     </route>
43     <route id="internal">
44       <filter type="z3950-client">
45         <target>localhost:9999/B</target>
46       </filter>
47     </route>
48     <route id="internal">
49       <xml:include href="file://module2.xml#filter45"/>
50       <xml:include href="file://module4.xml#filter145"/>
51     </route>
52     <route id="AB">
53       <filter type="multi">
54         <package route="A"/>
55         <package route="B"/>
56         <merge type="simple"/>
57       </filter>
58     </route>
59   </routes>
60 </yp2>
61
62 <!-- functions:
63     db           returns Z39.50 database(s)
64     path         HTTP path
65     HTTP-header  Any HTTP header (including content-type)
66     request-type Init,Search,HTTP,...
67     origin       IP of origin
68     port         Port
69 -->
70
71 <!-- observation: the logic could be controlled by a XSLT! -->