Further refinements
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 20 Oct 2005 12:53:49 +0000 (12:53 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 20 Oct 2005 12:53:49 +0000 (12:53 +0000)
etc/config1.xml

index d5629a5..b768600 100644 (file)
@@ -5,27 +5,67 @@
   Each filter is invoked in a sequence (unless a filter invokes another
   sequence.. A start sequence must be determined somehow.
   -->
-<yp2>
-  <sequence name="start">
-    <filter type="frontend-net"> <!-- the Z39.50/HTTP frontend -->
+<yp2 xmlns="http://indexdata.dk/yp2/config/1">
+  <start route="id_hytg"/>
+  <filters>
+    <filter id="front_default" type="frontend-net">
+      <!-- the Z39.50/HTTP frontend -->
       <port>210</port>
     </filter>
-    <filter type="log">          <!-- apply logging always -->
+    <filter id="log_cout" type="log">          <!-- apply logging always -->
       <logfile>mylog.log</logfile>
     </filter>
-    <filter type="cond">           <!-- conditional -->
-      <invoke sequence="public">   <!-- invoke public sequence for some db -->
-            port=210 and db="public" 
-      </invoke>
-    </filter>
+  </filters>
+
+  <routes>  
+    <route id="start">
+      <filter refid="gftr"/>
+      <filter type="cond">           <!-- conditional -->
+       <if test="port=210 and db=public" route="A"/> 
+       <if test="port=210 and db=other" route="B"/> 
+        <switch>
+          <case test="blabla" route="C"/>
+          <case test="blabla2" route="C2"/>
+          <default route="C3"/>
+       </switch>
+      </filter>
+      <filter type="log">          <!-- apply logging always -->
+       <logfile>mylog.log</logfile>
+      </filter>   
     <filter name="reject">        <!-- reject .. -->
     </filter>
-  </sequence>
-  <sequence name="public">
-    <filter type="z3950-client">
-      <target>localhost:9999/A</target>
+    </route>
+    <route id="public">
+      <filter type="z3950-client">
+       <target>localhost:9999/A</target>
     </filter>
-  </sequence>
+    </route>
+    <route id="internal">
+      <filter type="z3950-client">
+       <target>localhost:9999/B</target>
+      </filter>
+    </route>
+    <route id="internal">
+      <xml:include href="file://module2.xml#filter45"/>
+      <xml:include href="file://module4.xml#filter145"/>
+    </route>
+    <route id="AB">
+      <filter type="multi">
+        <package route="A"/>
+        <package route="B"/>
+        <merge type="simple"/>
+      </filter>
+    </route>
+  </routes>
 </yp2>
 
+<!-- functions:
+    db           returns Z39.50 database(s)
+    path         HTTP path
+    HTTP-header  Any HTTP header (including content-type)
+    request-type Init,Search,HTTP,...
+    origin       IP of origin
+    port         Port
+-->
+
 <!-- observation: the logic could be controlled by a XSLT! -->