Support library-type and country searches.
authorMike Taylor <mike@indexdata.com>
Thu, 29 Mar 2007 17:13:45 +0000 (17:13 +0000)
committerMike Taylor <mike@indexdata.com>
Thu, 29 Mar 2007 17:13:45 +0000 (17:13 +0000)
web/htdocs/details/find.mc
zebra/pqf.properties
zebra/zeerex2index.xsl

index bb611d2..e56bc1a 100644 (file)
@@ -1,4 +1,4 @@
-%# $Id: find.mc,v 1.10 2007-03-29 15:49:52 mike Exp $
+%# $Id: find.mc,v 1.11 2007-03-29 17:14:47 mike Exp $
 % if ($r->param("_search")) {
 %     $m->comp("found.mc");
 % } else {
        <tr>
         <th>Country</th>
        <td>
-         <select name="net.protocol" size="1">
-         <option value="">[No preference]</option>
-         <option value="z39.50">Z39.50</option>
-         <option value="sru">SRU</option>
-         <option value="srw">SRW</option>
+         <select name="zeerex.country" size="1">
+% my $options = $m->comp("country-list.mc");
+% foreach my $option (@$options) {
+         <option value="<% xml_encode(cql_quote($option)) %>"><%
+               xml_encode($option) %></option>
+% }
         </select>
         </td>
        </tr>
        <tr>
         <th>Type of Library</th>
        <td>
-         <select name="net.protocol" size="1">
-         <option value="">[No preference]</option>
-         <option value="z39.50">Z39.50</option>
-         <option value="sru">SRU</option>
-         <option value="srw">SRW</option>
+         <select name="zeerex.libType" size="1">
+% $options = $m->comp("libtype-list.mc");
+% foreach my $option (@$options) {
+         <option value="<% xml_encode($option) %>"><%
+               xml_encode($option) %></option>
+% }
         </select>
         </td>
        </tr>
index 66ba526..a1d4715 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: pqf.properties,v 1.17 2007-03-29 11:15:35 mike Exp $
+# $Id: pqf.properties,v 1.18 2007-03-29 17:14:13 mike Exp $
 #
 # Properties file to drive the YAZ CQL-to-PQF converter for Zebra.
 # This specifies the interpretation of various CQL indexes, relations,
@@ -41,6 +41,9 @@ index.zeerex.supports_relationModifier        = 1=zeerex:supports_relationModifier
 index.zeerex.supports_maskingCharacter = 1=zeerex:supports_maskingCharacter
 index.zeerex.default_contextSet                = 1=zeerex:default_contextSet
 index.zeerex.default_index             = 1=zeerex:default_index
+# Extensions
+index.zeerex.libType                   = 1=zeerex:libType 4=3
+index.zeerex.country                   = 1=zeerex:country 4=3
 
 # Relation attributes are selected according to the CQL relation by
 # looking up the "relation.<relation>" property:
index 0f3e102..89f1473 100644 (file)
@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- $Id: zeerex2index.xsl,v 1.12 2007-03-02 15:50:09 mike Exp $ -->
+<!-- $Id: zeerex2index.xsl,v 1.13 2007-03-29 17:13:45 mike Exp $ -->
 <!-- See the ZeeRex profile at http://srw.cheshire3.org/profiles/ZeeRex/ -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:z="http://indexdata.dk/zebra/xslt/1"
                 xmlns:e="http://explain.z3950.org/dtd/2.0/"
+                xmlns:i="http://indexdata.com/irspy/1.0"
                 version="1.0">
  <xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
  <xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
    </xsl:for-each>
    <!-- Many more could be added as required -->
 
+   <!-- extensions -->
+   <z:index name="zeerex:libType" type="0">
+    <xsl:value-of select="i:status/i:libraryType"/>
+   </z:index>
+   <z:index name="zeerex:country" type="0">
+    <xsl:value-of select="i:status/i:country"/>
+   </z:index>
+
   </z:record>
  </xsl:template>
 </xsl:stylesheet>