Work on briefDisplay using echoed things
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 9 Jul 2014 14:52:58 +0000 (16:52 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 9 Jul 2014 14:52:58 +0000 (16:52 +0200)
Now includes link to Full Record, but that's still briefDisplay
for now.

bibframe/config.xml
bibframe/explain.xml
bibframe/xsl/briefDisplay.xsl [new file with mode: 0644]
bibframe/xsl/sru.xsl [deleted file]

index d30231f..e964193 100644 (file)
@@ -18,7 +18,6 @@
         </area>
       </filter>
       <filter type="sru_z3950">
-        <stylesheet>/xsl/sru.xsl</stylesheet>
         <database name="Default">
          <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
                      href="explain.xml"/>
index 42c1c72..5c73d6f 100644 (file)
@@ -15,9 +15,9 @@
   </serverInfo>
 
   <databaseInfo>
-    <title lang="en" primary="true">Metaproxy SRU explain record</title>
+    <title lang="en" primary="true">BIBFRAME demo</title>
     <description lang="en" primary="true">
-      Some description of this service
+      BIBFRAME demo
     </description>
     <author>Index Data, http://www.indexdata.com</author>
     <contact>Index Data, info(at)indexdata(dot)com</contact>
     <default type="retrieveSchema">dc</default>
     <default type="recordPacking">xml</default>
 
-    <setting type="stylesheet">/xsl/sru.xsl</setting>
     <!-- <setting type="maximumRecords">1000</setting> -->
     <!-- <supports type="resultSets"></supports>  -->
 
diff --git a/bibframe/xsl/briefDisplay.xsl b/bibframe/xsl/briefDisplay.xsl
new file mode 100644 (file)
index 0000000..b6b633d
--- /dev/null
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:srw="http://www.loc.gov/zing/srw/"
+               xmlns:sru="http://docs.oasis-open.org/ns/search-ws/sruResponse"
+                xmlns:dc="http://www.loc.gov/zing/srw/dcschema/v1.0/"
+                xmlns:zr="http://explain.z3950.org/dtd/2.0/"
+                xmlns:diag="http://www.loc.gov/zing/srw/diagnostic/"
+                version="1.0">
+
+  <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
+
+  <xsl:template match="text()"/>
+
+  <xsl:template match="/">
+    <xsl:call-template name="html"/>
+  </xsl:template>
+
+  <xsl:template name="html">
+    <html>
+      <head>
+        <title>
+          <xsl:value-of select="//zr:explain/zr:databaseInfo/zr:title"/>
+        </title>
+        <link href="css.css" rel="stylesheet"
+              type="text/css" media="screen, all"/>
+      </head>
+      <body>
+        <div class="body">
+          <xsl:apply-templates/>
+        </div>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template match="zr:explain">
+    <xsl:call-template name="dbinfo"/>
+    <xsl:call-template name="diagnostic"/>
+    <xsl:call-template name="searchform"/>
+  </xsl:template>
+
+  <xsl:template match="srw:searchRetrieveResponse">
+    <h2>Search Results</h2>
+    <xsl:call-template name="diagnostic"/>
+    <xsl:call-template name="displaysearch"/>
+  </xsl:template>
+
+  <xsl:template name="dbinfo">
+    <div class="dbinfo">
+      <h1><xsl:value-of select="//zr:explain/zr:databaseInfo/zr:title"/>
+      </h1>
+      <h2><xsl:value-of select="//zr:explain/zr:databaseInfo/zr:description"/>
+      </h2>
+      <h4>
+        <xsl:value-of select="//zr:explain/zr:databaseInfo/zr:author"/>
+        <br/>
+        <xsl:value-of select="//zr:explain/zr:databaseInfo/zr:history"/>
+      </h4>
+    </div>
+  </xsl:template>
+
+  <xsl:template name="searchform">
+    <div class="searchform">
+      <form name="searchform"  method="get"> <!-- action=".." -->
+        <input type="hidden" name="version" value="1.2"/>
+        <input type="hidden" name="operation" value="searchRetrieve"/>
+       <input type="hidden" name="stylesheet">
+         <xsl:attribute name="value">
+           <xsl:value-of select="//srw:echoedExplainRequest/srw:stylesheet"/>
+           <xsl:value-of select="//sru:echoedExplainRequest/sru:stylesheet"/>
+         </xsl:attribute>
+       </input>
+        <div class="query">
+          <input type="text" name="query"/>
+        </div>
+        <div class="parameters">
+          <xsl:text>startRecord: </xsl:text>
+          <input size="10" type="text" name="startRecord" value="1"/>
+          <xsl:text> maximumRecords: </xsl:text>
+          <input size="10" type="text" name="maximumRecords" value="5"/>
+          <xsl:text> recordSchema: </xsl:text>
+          <select name="recordSchema">
+          <xsl:for-each select="//zr:schemaInfo/zr:schema">
+            <option value="{@name}">
+              <xsl:value-of select="zr:title"/>
+            </option>
+          </xsl:for-each>
+          </select>
+          <xsl:text> recordPacking: </xsl:text>
+          <select name="recordPacking">
+            <option value="string">string</option>
+            <option value="xml">XML</option>
+          </select>
+
+        </div>
+
+        <div class="submit">
+          <input type="submit" value="Send Search Request"/>
+        </div>
+      </form>
+    </div>
+  </xsl:template>
+
+  <xsl:template name="indexinfo">
+     <div class="dbinfo">
+       <xsl:for-each
+          select="//zr:indexInfo/zr:index[zr:map/zr:name/@set]">
+        <xsl:variable name="index">
+          <xsl:value-of select="zr:map/zr:name/@set"/>
+          <xsl:text>.</xsl:text>
+          <xsl:value-of select="zr:map/zr:name/text()"/>
+        </xsl:variable>
+        <b><xsl:value-of select="$index"/><br/></b>
+      </xsl:for-each>
+     </div>
+  </xsl:template>
+
+
+  <xsl:template name="relationinfo">
+    <!--
+      <xsl:variable name="defrel"
+                    select="//zr:configInfo/zr:default[@type='relation']"/>
+      <b><xsl:value-of select="$defrel"/><br/></b>
+      -->
+      <xsl:for-each select="//zr:configInfo/zr:supports[@type='relation']">
+        <xsl:variable name="rel" select="text()"/>
+        <b><xsl:value-of select="$rel"/><br/></b>
+      </xsl:for-each>
+  </xsl:template>
+
+
+  <!-- diagnostics -->
+  <xsl:template name="diagnostic">
+    <xsl:for-each select="//diag:diagnostic">
+     <div class="diagnostic">
+        <!-- <xsl:value-of select="diag:uri"/> -->
+        <xsl:text> </xsl:text>
+        <xsl:value-of select="diag:message"/>
+        <xsl:text>: </xsl:text>
+        <xsl:value-of select="diag:details"/>
+      </div>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template name="displaysearch">
+    <div class="searchresults">
+      <xsl:for-each select="srw:numberOfRecords">
+        <h4>
+          <xsl:text>Number of Records: </xsl:text>
+          <xsl:value-of select="."/>
+        </h4>
+      </xsl:for-each>
+      <xsl:for-each select="srw:nextRecordPosition">
+        <h4>
+          <xsl:text>Next Record Position: </xsl:text>
+          <xsl:value-of select="."/>
+         </h4>
+      </xsl:for-each>
+
+      <xsl:for-each select="srw:records">
+        <xsl:for-each select="srw:record">
+          <div class="record">
+            <p>
+              <xsl:text>Record: </xsl:text>
+              <xsl:value-of select="srw:recordPosition"/>
+              <xsl:text> : </xsl:text>
+              <xsl:value-of select="srw:recordSchema"/>
+              <xsl:text> : </xsl:text>
+              <xsl:value-of select="srw:recordPacking"/>
+           </p>
+           <form name="fulllink" method="get">
+             <input type="hidden" name="version" value="1.2"/>
+             <input type="hidden" name="operation" value="searchRetrieve"/>
+             <input type="hidden" name="query">
+               <xsl:attribute name="value">
+                 <xsl:value-of
+                     select="//srw:echoedSearchRetrieveRequest/srw:query"/>
+               </xsl:attribute>
+             </input>
+             <input type="hidden" name="recordPacking">
+               <xsl:attribute name="value">
+                 <xsl:value-of select="srw:recordPacking"/>
+               </xsl:attribute>
+             </input>
+             <input type="hidden" name="recordSchema">
+               <xsl:attribute name="value">
+                 <xsl:value-of select="srw:recordSchema"/>
+               </xsl:attribute>
+             </input>
+             <input type="hidden" name="stylesheet" value="/xsl/briefDisplay.xsl"/>
+             <input type="hidden" name="startRecord">
+               <xsl:attribute name="value">
+                 <xsl:value-of select="srw:recordPosition"/>
+               </xsl:attribute>
+             </input>
+             <input type="hidden" name="maximumRecords" value="1"/>
+             <input type="submit">
+               <xsl:attribute name="value">
+                 <xsl:text>Full Record </xsl:text>
+                 <xsl:value-of select="srw:recordPosition"/>
+               </xsl:attribute>
+             </input>
+           </form>
+            <p>
+              <pre>
+                <xsl:value-of select="srw:recordData"/>
+              </pre>
+            </p>
+          </div>
+        </xsl:for-each>
+      </xsl:for-each>
+    </div>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/bibframe/xsl/sru.xsl b/bibframe/xsl/sru.xsl
deleted file mode 100644 (file)
index 2a0ccf1..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                xmlns:srw="http://www.loc.gov/zing/srw/"
-                xmlns:dc="http://www.loc.gov/zing/srw/dcschema/v1.0/"
-                xmlns:zr="http://explain.z3950.org/dtd/2.0/"
-                xmlns:diag="http://www.loc.gov/zing/srw/diagnostic/"
-                version="1.0">
-
-  <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
-
-  <xsl:template match="text()"/>
-
-  <xsl:template match="/">
-    <xsl:call-template name="html"/>
-  </xsl:template>
-
-  <xsl:template name="html">
-    <html>
-      <head>
-        <title>
-          <xsl:value-of select="//zr:explain/zr:databaseInfo/zr:title"/>
-        </title>
-        <link href="css.css" rel="stylesheet"
-              type="text/css" media="screen, all"/>
-      </head>
-      <body>
-        <div class="body">
-          <xsl:apply-templates/>
-        </div>
-      </body>
-    </html>
-  </xsl:template>
-
-  <xsl:template match="zr:explain">
-    <xsl:call-template name="dbinfo"/>
-    <xsl:call-template name="diagnostic"/>
-    <xsl:call-template name="indexinfo"/>
-    <xsl:call-template name="relationinfo"/>
-    <xsl:call-template name="searchform"/>
-  </xsl:template>
-
-  <xsl:template match="srw:searchRetrieveResponse">
-    <h2>Search Results</h2>
-    <xsl:call-template name="diagnostic"/>
-    <xsl:call-template name="displaysearch"/>
-  </xsl:template>
-
-  <xsl:template name="dbinfo">
-    <div class="dbinfo">
-      <h1><xsl:value-of select="//zr:explain/zr:databaseInfo/zr:title"/>
-      </h1>
-      <h2><xsl:value-of select="//zr:explain/zr:databaseInfo/zr:description"/>
-      </h2>
-      <h4>
-        <xsl:value-of select="//zr:explain/zr:databaseInfo/zr:author"/>
-        <br/>
-        <xsl:value-of select="//zr:explain/zr:databaseInfo/zr:history"/>
-      </h4>
-    </div>
-  </xsl:template>
-
-  <xsl:template name="searchform">
-    <div class="searchform">
-      <form name="searchform"  method="get"> <!-- action=".." -->
-        <input type="hidden" name="version" value="1.1"/>
-        <input type="hidden" name="operation" value="searchRetrieve"/>
-        <div class="query">
-          <input type="text" name="query"/>
-        </div>
-        <div class="parameters">
-          <xsl:text>startRecord: </xsl:text>
-          <input type="text" name="startRecord" value="1"/>
-          <xsl:text> maximumRecords: </xsl:text>
-          <input type="text" name="maximumRecords" value="5"/>
-          <xsl:text> recordSchema: </xsl:text>
-          <select name="recordSchema">
-          <xsl:for-each select="//zr:schemaInfo/zr:schema">
-            <option value="{@name}">
-              <xsl:value-of select="zr:title"/>
-            </option>
-          </xsl:for-each>
-          </select>
-          <xsl:text> recordPacking: </xsl:text>
-          <select name="recordPacking">
-            <option value="string">string</option>
-            <option value="xml">XML</option>
-          </select>
-          <xsl:text> stylesheet: </xsl:text>
-          <select name="stylesheet">
-            <option value="/xsl/sru.xsl">SRU</option>
-            <option value="">NONE</option>
-          </select>
-        </div>
-
-        <div class="submit">
-          <input type="submit" value="Send Search Request"/>
-        </div>
-      </form>
-    </div>
-  </xsl:template>
-
-  <xsl:template name="indexinfo">
-     <div class="dbinfo">
-       <xsl:for-each
-          select="//zr:indexInfo/zr:index[zr:map/zr:name/@set]">
-        <xsl:variable name="index">
-          <xsl:value-of select="zr:map/zr:name/@set"/>
-          <xsl:text>.</xsl:text>
-          <xsl:value-of select="zr:map/zr:name/text()"/>
-        </xsl:variable>
-        <b><xsl:value-of select="$index"/><br/></b>
-      </xsl:for-each>
-     </div>
-  </xsl:template>
-
-
-  <xsl:template name="relationinfo">
-    <!--
-      <xsl:variable name="defrel"
-                    select="//zr:configInfo/zr:default[@type='relation']"/>
-      <b><xsl:value-of select="$defrel"/><br/></b>
-      -->
-      <xsl:for-each select="//zr:configInfo/zr:supports[@type='relation']">
-        <xsl:variable name="rel" select="text()"/>
-        <b><xsl:value-of select="$rel"/><br/></b>
-      </xsl:for-each>
-  </xsl:template>
-
-
-  <!-- diagnostics -->
-  <xsl:template name="diagnostic">
-    <xsl:for-each select="//diag:diagnostic">
-     <div class="diagnostic">
-        <!-- <xsl:value-of select="diag:uri"/> -->
-        <xsl:text> </xsl:text>
-        <xsl:value-of select="diag:message"/>
-        <xsl:text>: </xsl:text>
-        <xsl:value-of select="diag:details"/>
-      </div>
-    </xsl:for-each>
-  </xsl:template>
-
-  <xsl:template name="displaysearch">
-    <div class="searchresults">
-      <xsl:for-each select="srw:numberOfRecords">
-        <h4>
-          <xsl:text>Number of Records: </xsl:text>
-          <xsl:value-of select="."/>
-        </h4>
-      </xsl:for-each>
-      <xsl:for-each select="srw:nextRecordPosition">
-        <h4>
-          <xsl:text>Next Record Position: </xsl:text>
-          <xsl:value-of select="."/>
-         </h4>
-      </xsl:for-each>
-
-      <xsl:for-each select="srw:records">
-        <xsl:for-each select="srw:record">
-          <div class="record">
-            <p>
-              <xsl:text>Record: </xsl:text>
-              <xsl:value-of select="srw:recordPosition"/>
-              <xsl:text> : </xsl:text>
-              <xsl:value-of select="srw:recordSchema"/>
-              <xsl:text> : </xsl:text>
-              <xsl:value-of select="srw:recordPacking"/>
-            </p>
-            <p>
-              <pre>
-                <xsl:value-of select="srw:recordData"/>
-              </pre>
-            </p>
-          </div>
-        </xsl:for-each>
-      </xsl:for-each>
-    </div>
-  </xsl:template>
-
-  <xsl:template name="displayscan">
-    <div class="scanresults">
-
-      <xsl:for-each select="srw:terms">
-        <xsl:for-each select="srw:term">
-          <div class="term">
-
-              <!-- <xsl:text>Term: </xsl:text> -->
-              <xsl:for-each select="srw:displayTerm">
-                <xsl:value-of select="."/>
-                <xsl:text> : </xsl:text>
-              </xsl:for-each>
-
-              <xsl:for-each select="srw:value">
-                <xsl:value-of select="."/>
-              </xsl:for-each>
-
-              <xsl:for-each select="srw:numberOfRecords">
-                <xsl:text> (</xsl:text>
-                <xsl:value-of select="."/>
-                <xsl:text>)</xsl:text>
-              </xsl:for-each>
-
-              <xsl:for-each select="srw:extraTermData">
-                <xsl:text> - </xsl:text>
-                <xsl:value-of select="."/>
-              </xsl:for-each>
-
-          </div>
-        </xsl:for-each>
-      </xsl:for-each>
-
-    </div>
-  </xsl:template>
-
-
-</xsl:stylesheet>