New
authorMike Taylor <mike@indexdata.com>
Thu, 16 Feb 2006 10:43:15 +0000 (10:43 +0000)
committerMike Taylor <mike@indexdata.com>
Thu, 16 Feb 2006 10:43:15 +0000 (10:43 +0000)
etc/.cvsignore [new file with mode: 0644]
etc/Makefile [new file with mode: 0644]
etc/gfs-config.rnc [new file with mode: 0644]
etc/gfs-example.xml [new file with mode: 0644]
etc/gfs-itunes.xml [new file with mode: 0644]
etc/gfs-minimal.xml [new file with mode: 0644]

diff --git a/etc/.cvsignore b/etc/.cvsignore
new file mode 100644 (file)
index 0000000..4c42229
--- /dev/null
@@ -0,0 +1,4 @@
+gfs-config.rng
+gfs-config.xsd
+explain.xsd
+gfs-config.dtd
diff --git a/etc/Makefile b/etc/Makefile
new file mode 100644 (file)
index 0000000..0c2df91
--- /dev/null
@@ -0,0 +1,44 @@
+# $Id: Makefile,v 1.1 2006-02-16 10:43:15 mike Exp $
+
+# This doesn't actually build anything, it just tests whether the
+# configuration files here correspond with the schema.  The master
+# schema is in Relax-NG Compact (.rnc) format: this cannot be used
+# directly as xmllint does not support it; but from this, we generate
+# schemas expressed in Relax-NG XML (.rng), XML Schema (.xsd) and XML
+# DTD (.dtd), each of which is then tested.
+
+test: test-rng test-xsd test-dtd
+
+test-rng: test-rng-example test-rng-itunes test-rng-minimal
+test-rng-%: gfs-%.xml gfs-config.rng
+       xmllint --noout --relaxng gfs-config.rng $<
+
+test-xsd: test-xsd-example test-xsd-itunes test-xsd-minimal
+test-xsd-%: gfs-%.xml gfs-config.xsd
+       xmllint --noout --schema gfs-config.xsd $<
+
+test-dtd:
+       @echo "# DTD testing skipped due to lack of namespace support"
+#test-dtd: test-dtd-example test-dtd-itunes test-dtd-minimal
+test-dtd-%: gfs-%.xml gfs-config.dtd
+       xmllint --noout --dtdvalid gfs-config.dtd $<
+
+gfs-config.rng: gfs-config.rnc
+       rm -f $@
+       trang $? $@
+       chmod ugo-w $@
+
+# Trang generates "explain.xsd" as a side-effect
+gfs-config.xsd: gfs-config.rnc
+       rm -f $@ explain.xsd
+       trang $? $@
+       chmod ugo-w $@ explain.xsd
+
+gfs-config.dtd: gfs-config.rnc
+       rm -f $@
+       trang $? $@
+       chmod ugo-w $@
+
+clean:
+       rm -f gfs-config.rng gfs-config.xsd explain.xsd gfs-config.dtd 
+
diff --git a/etc/gfs-config.rnc b/etc/gfs-config.rnc
new file mode 100644 (file)
index 0000000..612ad76
--- /dev/null
@@ -0,0 +1,40 @@
+# $Id: gfs-config.rnc,v 1.1 2006-02-16 10:43:15 mike Exp $
+
+namespace explain = "http://explain.z3950.org/dtd/2.0/"
+namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
+
+yazgfs = element yazgfs { attlist.yazgfs, listen*, server+ }
+attlist.yazgfs &= empty
+listen = element listen { attlist.listen, text }
+attlist.listen &= attribute id { text }?
+server =
+  element server {
+    attlist.server, host?, directory?, config?, cql2rpn?, explain?
+  }
+attlist.server &=
+  attribute id { text }?,
+  attribute listenref { text }?
+host = element host { attlist.host, text }
+attlist.host &= empty
+directory = element directory { attlist.directory, text }
+attlist.directory &= empty
+config = element config { attlist.config, text }
+attlist.config &= empty
+cql2rpn = element cql2rpn { attlist.cql2rpn, text }
+attlist.cql2rpn &= empty
+# It's a shame that we have to include a partial ZeeRex DTD here
+explain = element explain:explain { attlist.explain, serverInfo? }
+attlist.explain &=
+  [ a:defaultValue = "false" ]
+  attribute authoritative { "true" | "false" }?,
+  attribute id { text }?
+serverInfo =
+  element explain:serverInfo { attlist.serverInfo, explainHost, port, database }
+attlist.serverInfo &= empty
+explainHost = element explain:host { attlist.explainHost, text }
+attlist.explainHost &= empty
+port = element explain:port { attlist.port, text }
+attlist.port &= empty
+database = element explain:database { attlist.database, text }
+attlist.database &= empty
+start = yazgfs
diff --git a/etc/gfs-example.xml b/etc/gfs-example.xml
new file mode 100644 (file)
index 0000000..ef4a5bc
--- /dev/null
@@ -0,0 +1,32 @@
+<!-- $Id: gfs-example.xml,v 1.1 2006-02-16 10:43:15 mike Exp $ -->
+<!--
+  This is an example YAZ GFS configuration file, copied from the
+  manual at:
+       http://www.indexdata.com/yaz/doc/server.vhosts.tkl
+-->
+<yazgfs>
+  <listen id="public">tcp:@:9900</listen>
+  <listen id="internal">unix:/var/tmp/socket</listen>
+  <server id="server1">
+    <host>server1.mydomain</host>
+    <directory>/var/www/s1</directory>
+    <config>config.cfg</config>
+  </server>
+  <server id="server2">
+    <host>server2.mydomain</host>
+    <directory>/var/www/s2</directory>
+    <config>config.cfg</config>
+    <cql2rpn>../etc/pqf.properties</cql2rpn>
+    <explain xmlns="http://explain.z3950.org/dtd/2.0/">
+      <serverInfo>
+        <host>server2.mydomain</host>
+        <port>9900</port>
+        <database>a</database>
+      </serverInfo>
+    </explain>
+  </server>
+  <server id="server3" listenref="internal">
+    <directory>/var/www/s3</directory>
+    <config>config.cfg</config>
+  </server>
+</yazgfs>
diff --git a/etc/gfs-itunes.xml b/etc/gfs-itunes.xml
new file mode 100644 (file)
index 0000000..edad1ec
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  This example GFS configuration file is copied from
+  CVSROOT/k2-portal-oai-tunes/db/yazserver.xml
+-->
+<yazgfs>
+
+  <!-- one or more ports to listen to -->
+  <listen id="tcp1234">tcp:@:1234</listen>
+
+  <!-- one or more servers bound to ports - multiple servers on same
+  ports possible -->
+  <server id="k2-oai" listenref="tcp1234">
+
+    <!-- working directory for zebra -->
+    <directory>./</directory>
+
+    <!-- ordinary config file for zebra -->
+    <config>db/zebra.cfg</config>
+
+    <!-- location of CQL-to-PQF file -->
+    <!-- see: http://www.indexdata.com/yaz/doc/tools.tkl#tools.cql.map -->
+    <cql2rpn>db/cql2pqf.txt</cql2rpn>
+
+    <!-- explain message - send in SRW Explain
+      - yes, we understand Z39.50 and SRW on the same port !! -->
+    <explain xmlns="http://explain.z3950.org/dtd/2.0/">
+      <serverInfo>
+        <host>localhost</host>
+        <port>1234</port>
+        <database>k2-oai</database>
+      </serverInfo>
+    </explain>
+
+  </server>
+
+</yazgfs>
diff --git a/etc/gfs-minimal.xml b/etc/gfs-minimal.xml
new file mode 100644 (file)
index 0000000..6dcb52d
--- /dev/null
@@ -0,0 +1,8 @@
+<!-- $Id -->
+<!-- This is the minimal GFS configuration required for SRU support -->
+<yazgfs>
+  <server>
+    <config>zebra.cfg</config>
+    <cql2rpn>../tab/pqf.properties</cql2rpn>
+  </server>
+</yazgfs>