diff software/eXist/webapp/mpdl/query.xql @ 7:5589d865af7a

Erstellung XQL/XSL Applikation
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 08 Feb 2011 15:16:46 +0100
parents
children d6f528ad5d96
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/software/eXist/webapp/mpdl/query.xql	Tue Feb 08 15:16:46 2011 +0100
@@ -0,0 +1,241 @@
+xquery version "1.0";
+
+declare namespace request="http://exist-db.org/xquery/request";
+
+let $attrQueryAuthor := "Monte"
+let $attrQueryTitle := "Mech*"
+let $ftQuery := "quantitas"
+let $ftMorphQuery := "quantitas"
+
+return
+<html>
+<head>
+<title>MPDL project</title>
+<script type="text/javascript">
+<!--
+function DateSelection() {
+  if (document.formAttrQueryResult.attribute1.selectedIndex == 3)
+    document.formAttrQueryResult.relOp1.selectedIndex = 0;
+  else 
+    document.formAttrQueryResult.relOp1.selectedIndex = 1;
+  if (document.formAttrQueryResult.attribute2.selectedIndex == 3)
+    document.formAttrQueryResult.relOp2.selectedIndex = 0;
+  else 
+    document.formAttrQueryResult.relOp2.selectedIndex = 1;
+}
+function EqualSelection() {
+  if (document.formAttrQueryResult.relOp1.selectedIndex == 0)
+    document.formAttrQueryResult.attribute1.selectedIndex = 3;
+  if (document.formAttrQueryResult.relOp1.selectedIndex == 1 && document.formAttrQueryResult.attribute1.selectedIndex == 3)
+    document.formAttrQueryResult.attribute1.selectedIndex = 0;
+  if (document.formAttrQueryResult.relOp2.selectedIndex == 0)
+    document.formAttrQueryResult.attribute2.selectedIndex = 3;
+  if (document.formAttrQueryResult.relOp2.selectedIndex == 1 && document.formAttrQueryResult.attribute2.selectedIndex == 3)
+    document.formAttrQueryResult.attribute2.selectedIndex = 0;
+}
+function checkCR(event) {
+  var keyCode = event.keyCode
+  if (keyCode == 13)
+    return false;
+}
+
+-->
+</script>
+</head>
+<body>
+  <form name="formAttrQueryResult" action="attribute-query-result.xql" method="get">
+  <input type="hidden" name="query-type" value="none" id="ietype"/>
+  <table height="60px">
+    <colgroup>
+      <col width="50%"/>
+      <col width="30%"/>
+      <col width="10%"/>
+      <col width="10%"/>
+    </colgroup>
+    <tr>
+    <td align="left" valign="top">
+      <text style="font-weight:bold;font-size:30px">MPDL prototype <a href="info.xql?info=mpdl" onclick="window.open(&quot;info.xql?info=mpdl&quot;, &quot;InfoWindow&quot;, &quot;menubar=no,width=500,height=500,toolbar=no&quot;);return false"><img src="images/info.png" valign="bottom" width="18" height="18" border="0" alt="Info MPDL"/></a></text>
+    </td>
+    <td align="left" valign="top">
+      <a href="info.xql?info=malcolm" onclick="window.open(&quot;info.xql?info=malcolm&quot;, &quot;InfoWindow&quot;, &quot;menubar=no,width=500,height=500,toolbar=no&quot;);return false">Dedicated to Dr. Malcolm Hyman</a><br/><text style="margin-left:20px;"></text>† September 4, 2009
+    </td>
+    <td align="left" valign="top">
+      <a href="http://exist-db.org"><img alt="powered by eXist" align="right" border="0" src="/resources/powered.gif"/></a>
+    </td>
+    <td align="left" valign="top">
+      <a href="http://atomic.exist-db.org/blogs/eXist/?id=urn:uuid:e17b7bb6-596e-4d8b-ab35-90bf5fef8884">Release 1.4<br/>
+      Nov, 2009</a>
+    </td>
+    </tr>
+  </table>
+  <hr/>
+  <table>
+    <tr>
+    <td valign="top" height="60px">
+      <table>
+      <tr>
+        <td valign="top"><b>Documents:</b></td>
+        <td>
+          <text style="margin-left:15px;">Archimedes DTD</text><br/>
+          <text style="margin-left:15px;">(until 2008)</text>
+        </td>
+        <td valign="top">
+          <text style="margin-left:1px;"></text><input type="checkbox" name="docbase" value="archimedes" checked="checked"/>
+        </td>
+        <td>
+          <text style="margin-left:20px;">Echo Schema</text><br/>
+          <text style="margin-left:20px;">(since 2009)</text>
+        </td>
+        <td valign="top">
+          <text style="margin-left:1px;"></text><input type="checkbox" name="docbase" value="echo" checked="checked"/>
+        </td>
+        <td valign="top"><text style="margin-left:40px;"></text><button type="submit" name="browseQuery" onclick="document.getElementById('ietype').value='browse';">Browse</button></td>
+        <td valign="top"><a href="info.xql?info=docBases" onclick="window.open(&quot;info.xql?info=docBases&quot;, &quot;InfoWindow&quot;, &quot;menubar=no,width=500,height=500,toolbar=no&quot;);return false"><img src="images/info.png" valign="bottom" width="15" height="15" border="0" alt="Info Document bases"/></a></td>
+      </tr>
+      <tr>
+      </tr>
+      </table> 
+    </td>
+    </tr>
+
+    <tr>
+    <td valign="top" height="110px">
+      <table>
+      <tr>
+      <td>
+      <select name="attribute1" onchange="DateSelection()">
+      <option value ="author" selected="true">Author</option>
+      <option value ="title">Title</option>
+      <option value ="place">Place</option>
+      <option value ="date">Year</option>
+      <option value ="language">Language</option>
+      <option value ="identifier">Identifier/Locator</option>
+      <option disabled="disabled">--Echo--</option>
+      <option value ="rights">Rights</option>
+      <option value ="license">License</option>
+      <option value ="accessRights">Access rights</option>
+      <option disabled="disabled">--Archimedes--</option>
+      <option value ="file">File name</option>
+      <option value ="translator">Translator</option>
+      <option value ="version">Version</option>
+      </select>          
+      </td>
+      <td>
+      <select name="relOp1" onchange="EqualSelection()">
+      <option value ="equal"> = </option>
+      <option value ="contains" selected="true">contains</option>
+      </select>          
+      </td>
+      <td>
+      <input type="text" size="40" name="attr-query1" value="{$attrQueryAuthor}" onkeypress="return checkCR(event)"/>
+      <button type="submit" name="attributeQuery" onclick="document.getElementById('ietype').value='attribute';">Query</button>
+      <a href="info.xql?info=attr" onclick="window.open(&quot;info.xql?info=attr&quot;, &quot;InfoWindow&quot;, &quot;menubar=no,width=500,height=500,toolbar=no&quot;);return false"><img src="images/info.png" valign="bottom" width="15" height="15" border="0" alt="Info Attribute search"/></a>
+      </td>
+      </tr>
+
+      <tr>
+      <td>
+      <table>
+      <tr>
+      <td>
+      <text style="margin-left:10px;"></text>
+      </td>
+      <td>
+      <select name="boolOp">
+      <option value ="and" selected="true">and</option>
+      <option value ="or">or</option>
+      <option value ="andNot">and not</option>
+      </select>          
+      </td>
+      </tr>
+      </table>
+      </td>
+      </tr>
+
+      <tr>
+      <td>
+      <select name="attribute2" onchange="DateSelection()">
+      <option value ="author">Author</option>
+      <option value ="title" selected="true">Title</option>
+      <option value ="place">Place</option>
+      <option value ="date">Year</option>
+      <option value ="language">Language</option>
+      <option value ="identifier">Identifier/Locator</option>
+      <option disabled="disabled">--Echo--</option>
+      <option value ="rights">Rights</option>
+      <option value ="license">License</option>
+      <option value ="accessRights">Access rights</option>
+      <option disabled="disabled">--Archimedes--</option>
+      <option value ="file">File name</option>
+      <option value ="translator">Translator</option>
+      <option value ="version">Version</option>
+      </select>          
+      </td>
+      <td>
+      <select name="relOp2" onchange="EqualSelection()">
+      <option value ="equal"> = </option>
+      <option value ="contains" selected="true">contains</option>
+      </select>          
+      </td>
+      <td>
+      <input type="text" size="40" name="attr-query2" value="{$attrQueryTitle}" onkeypress="return checkCR(event)"/>
+      </td>
+      </tr>
+      </table>
+    </td>
+    <td/>
+    </tr>
+    
+    <tr>
+    <td valign="top" height="50px">
+      <table>
+        <tr>
+        <td>
+        Document contains <input type="text" size="40" name="ft-query" value="{$ftQuery}" onkeypress="return checkCR(event)"/>
+        <button type="submit" name="fulltextQuery" onclick="document.getElementById('ietype').value='fulltext';">Query</button>
+        </td>
+        <td>
+        <a href="info.xql?info=fulltext" onclick="window.open(&quot;info.xql?info=fulltext&quot;, &quot;InfoWindow&quot;, &quot;menubar=no,width=500,height=500,toolbar=no&quot;);return false"><img src="images/info.png" valign="bottom" width="15" height="15" border="0" alt="Info fulltext search"/></a>
+        </td>
+        </tr>
+      </table>
+    </td>
+    </tr>
+    
+    <tr>
+    <td valign="top" height="50px">
+      <table>
+        <tr>
+        <td>
+        Document contains morphological <input type="text" size="40" name="ft-morph-query" value="{$ftMorphQuery}" onkeypress="return checkCR(event)"/>
+        <select name="language">
+        <option value ="ar">Arabic</option>
+        <option value ="zh">Chinese</option>
+        <option value ="nl">Dutch</option>
+        <option value ="en">English</option>
+        <option value ="fr">French</option>
+        <option value ="de">German</option>
+        <option value ="el">Greek</option>
+        <option value ="it">Italian</option>
+        <option value ="la" selected="true">Latin</option>
+        </select>
+        <button type="submit" name="fulltextMorphQuery" onclick="document.getElementById('ietype').value='fulltextMorph';">Query</button>
+        </td>
+        <td valign="bottom">
+        <a href="info.xql?info=fulltextMorph" onclick="window.open(&quot;info.xql?info=fulltextMorph&quot;, &quot;InfoWindow&quot;, &quot;menubar=no,width=500,height=500,toolbar=no&quot;);return false"><img src="images/info.png" width="15" height="15" border="0" alt="Info morphological search"/></a>
+        </td>
+        </tr>
+        <input type="hidden" name="order-by" value="author"/>
+        <input type="hidden" name="pn" value="1"/>
+      </table>
+    </td>
+    </tr>
+
+  </table> 
+  <hr/>
+  <p/>
+  See the <a href="/exist/xquery.xml">eXist XQuery documentation</a> and the <a href="query.xql?_source=yes">XQuery source</a> of this page, if you find a bug <a href="https://itgroup.mpiwg-berlin.mpg.de:8080/tracs/mpdl-project-software/newticket">let us know</a>
+  <br/>Last MPDL software update: January, 2011
+</form>
+</body>
+</html>
\ No newline at end of file