Mercurial > hg > mpdl-group
view software/mpdl-services-new/mpiwg-mpdl-cms-web/WebContent/query/index.html @ 25:e9fe3186670c default tip
letzter Stand eingecheckt
author | Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 21 May 2013 10:19:32 +0200 |
parents | |
children |
line wrap: on
line source
<html> <head> <title>MPIWG Query project</title> <script type="text/javascript"> <!-- function Browse() { var luceneQuery = document.getElementById("luceneQueryId1"); var schema1checked = document.getElementById("schema1Id").checked; var schema2checked = document.getElementById("schema2Id").checked; var schema3checked = document.getElementById("schema3Id").checked; var schema4checked = document.getElementById("schema4Id").checked; var luceneSchemaQueryStr = GetLuceneSchemaQuery(); if (schema1checked && schema2checked && schema3checked && schema4checked) luceneSchemaQueryStr = "*"; luceneQuery.value = luceneSchemaQueryStr; } function GetLuceneSchemaQuery() { var schemaFieldValue = "schemaName"; var schema1Val = document.getElementById("schema1Id").value; var schema2Val = document.getElementById("schema2Id").value; var schema3Val = document.getElementById("schema3Id").value; var schema4Val = document.getElementById("schema4Id").value; var schema1checked = document.getElementById("schema1Id").checked; var schema2checked = document.getElementById("schema2Id").checked; var schema3checked = document.getElementById("schema3Id").checked; var schema4checked = document.getElementById("schema4Id").checked; var luceneQueryStr = "+" + schemaFieldValue + ":" + "("; if (schema1checked) luceneQueryStr = luceneQueryStr + schema1Val; if (schema2checked) luceneQueryStr = luceneQueryStr + " " + schema2Val; if (schema3checked) luceneQueryStr = luceneQueryStr + " " + schema3Val; if (schema4checked) luceneQueryStr = luceneQueryStr + " " + schema4Val; luceneQueryStr = luceneQueryStr + ")"; return luceneQueryStr; } function GetLuceneBoolOp(relOp) { if (relOp == "mustContain") return "+"; else if (relOp == "mustNotContain") return "-"; else return ""; } function AttributeQuery() { var luceneQuery = document.getElementById("luceneQueryId2"); var sortBy = document.getElementById("sortById2"); var field1Val = document.getElementById("field1Id").value; var field1QueryVal = document.getElementById("field1QueryId").value; var relOp1Value = document.getElementById("relOp1Id").value; var relOp1ValueLucene = GetLuceneBoolOp(relOp1Value); var field2Val = document.getElementById("field2Id").value; var field2QueryVal = document.getElementById("field2QueryId").value; var relOp2Value = document.getElementById("relOp2Id").value; var relOp2ValueLucene = GetLuceneBoolOp(relOp2Value); var luceneQueryStr = "*:* " + relOp1ValueLucene + field1Val + ":"; // *:* so that the minus-Operator works correct when it is alone luceneQueryStr = luceneQueryStr + field1QueryVal; if (field2QueryVal != "") luceneQueryStr = luceneQueryStr + " " + relOp2ValueLucene + field2Val + ":" + field2QueryVal; var schemaQueryStr = GetLuceneSchemaQuery(); var schema1checked = document.getElementById("schema1Id").checked; var schema2checked = document.getElementById("schema2Id").checked; var schema3checked = document.getElementById("schema3Id").checked; var schema4checked = document.getElementById("schema4Id").checked; if (schema1checked && schema2checked && schema3checked && schema4checked) schemaQueryStr = ""; luceneQueryStr = luceneQueryStr + " " + schemaQueryStr; luceneQuery.value = luceneQueryStr; sortBy.value = "author"; } function FulltextQuery() { var luceneQuery = document.getElementById("luceneQueryId3"); var translateElem = document.getElementById("translateId3"); translateElem.value = "false"; var isTranslateQuery = document.getElementById("isTranslateQueryId").checked; if (isTranslateQuery) translateElem.value = "true"; var fulltextQueryFieldValue = "tokenOrig"; var isMorphQuery = document.getElementById("isMorphQueryId").checked; if (isMorphQuery) fulltextQueryFieldValue = "tokenMorph"; var fulltextQueryVal = document.getElementById("fulltextQueryId").value; var luceneQueryStr = "+" + fulltextQueryFieldValue + ":(" + fulltextQueryVal + ")"; changeIsMorph(); var schemaQueryStr = GetLuceneSchemaQuery(); var schema1checked = document.getElementById("schema1Id").checked; var schema2checked = document.getElementById("schema2Id").checked; var schema3checked = document.getElementById("schema3Id").checked; var schema4checked = document.getElementById("schema4Id").checked; if (schema1checked && schema2checked && schema3checked && schema4checked) schemaQueryStr = ""; luceneQueryStr = luceneQueryStr + " " + schemaQueryStr; luceneQuery.value = luceneQueryStr; } function changeIsMorph() { var isMorphQuery = document.getElementById("isMorphQueryId").checked; var language = document.getElementById("languageId3"); if (isMorphQuery) { var languageValue = document.getElementById("languageId").value; if (languageValue == "none") { if (language != null) language.parentNode.removeChild(language); } else if (language == null) { var queryDocumentsForm = document.getElementById("queryDocumentsId"); var languageElement = document.createElement("input"); languageElement.setAttribute("type", "hidden"); languageElement.setAttribute("name", "language"); languageElement.setAttribute("id", "languageId3"); languageElement.value = languageValue; queryDocumentsForm.appendChild(languageElement); } else if (language != null) { language.value = languageValue; } } else { if (language != null) language.parentNode.removeChild(language); } } function checkCR(event) { var keyCode = event.keyCode if (keyCode == 13) return false; } --> </script> </head> <body> <table height="60px"> <colgroup> <col width="90%"/> <col width="10%"/> </colgroup> <tr> <td align="left" valign="top"> <text style="font-weight:bold;font-size:30px">Query documents <a href="info.html"><img src="../images/info.png" valign="bottom" width="18" height="18" border="0" alt="Info Query Documents"/></a></text> </td> <td align="left" valign="top"> Release 0.5, July, 2012 </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="schema1" id="schema1Id" 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="schema2" id="schema2Id" value="echo" checked="checked"/> </td> <td> <text style="margin-left:20px;">TEI Schema</text><br/> <text style="margin-left:20px;">(since 2011)</text> </td> <td valign="top"> <text style="margin-left:1px;"></text><input type="checkbox" name="schema3" id="schema3Id" value="TEI" checked="checked"/> </td> <td> <text style="margin-left:20px;">Diverse</text><br/> <text style="margin-left:20px;">(since 2011)</text> </td> <td valign="top"> <text style="margin-left:1px;"></text><input type="checkbox" name="schema4" id="schema4Id" value="html" checked="checked"/> </td> <td valign="top"> <form name="queryDocuments" action="/mpiwg-mpdl-cms-web/query/QueryDocuments" method="get"> <input type="hidden" name="query" id="luceneQueryId1"/> <input type="hidden" name="sortBy" id="sortById1" value="author"/> <text style="margin-left:40px;"></text><button type="submit" onclick="Browse()">Browse</button> </form> </td> </tr> <tr> </tr> </table> </td> </tr> <tr> <td valign="top" height="70px"> <table> <tr> <td> <select name="field1" id="field1Id"> <option value ="author" selected="true">Author</option> <option value ="title">Title</option> <option value ="publisher">Place</option> <option value ="date">Year</option> <option value ="docId">Id</option> <option value ="language">Language</option> </select> </td> <td> <select name="relOp1" id="relOp1Id"> <option value ="mustContain" selected="true">must contain</option> <option value ="mayContain">may contain</option> <option value ="mustNotContain">does not contain</option> </select> </td> <td> <input type="text" size="40" name="field1Query" id="field1QueryId" onkeypress="return checkCR(event)"/> </td> <td valign="middle"> <form name="queryDocuments" action="/mpiwg-mpdl-cms-web/query/QueryDocuments" method="get"> <input type="hidden" name="query" id="luceneQueryId2"/> <input type="hidden" name="sortBy" id="sortById2"/> <button type="submit" onclick="AttributeQuery()">Query</button> </form> </td> </tr> <tr> <td> <select name="field2" id="field2Id"> <option value ="author">Author</option> <option value ="title" selected="true">Title</option> <option value ="publisher">Place</option> <option value ="date">Year</option> <option value ="docId">Id</option> <option value ="language">Language</option> </select> </td> <td> <select name="relOp2" id="relOp2Id"> <option value ="mustContain" selected="true">must contain</option> <option value ="mayContain">may contain</option> <option value ="mustNotContain">does not contain</option> </select> </td> <td> <input type="text" size="40" name="field2Query" id="field2QueryId" value="" onkeypress="return checkCR(event)"/> </td> </tr> </table> </td> </tr> <tr> <td valign="top" height="60px"> <table> <tr> <td> Document contains <input type="text" size="40" name="fulltextQuery" id="fulltextQueryId" onkeypress="return checkCR(event)"/> </td> <td valign="middle"> <form id="queryDocumentsId" name="queryDocuments" action="/mpiwg-mpdl-cms-web/query/QueryDocuments" method="get"> <input type="hidden" name="query" id="luceneQueryId3"/> <input type="hidden" name="language" id="languageId3"/> <input type="hidden" name="translate" id="translateId3"/> <button type="submit" onclick="FulltextQuery()">Query</button> </form> </td> </tr> </table> <table> <tr> <td valign="top"> <text style="margin-left:30px;">morphological</text> </td> <td valign="top"> <text style="margin-left:1px;"></text><input type="checkbox" name="isMorphQuery" id="isMorphQueryId" value="isMorphQuery" onchange="ChangeIsMorph()"/> </td> <td valign="top"> <text style="margin-left:3px;">language: </text> </td> <td valign="top" style="margin-left:3px;"> <text style="margin-left:1px;"></text> <select name="language" id="languageId"> <option value ="none" selected="true">None</option> <option value ="ara">Arabic</option> <option value ="zho">Chinese</option> <option value ="nld">Dutch</option> <option value ="eng">English</option> <option value ="fra">French</option> <option value ="deu">German</option> <option value ="grc">Greek</option> <option value ="ita">Italian</option> <option value ="lat">Latin</option> </select> </td> <td valign="top"> <text style="margin-left:10px;">translate</text><br/> </td> <td valign="top"> <text style="margin-left:1px;"></text><input type="checkbox" name="isTranslateQuery" id="isTranslateQueryId" value="translate"/> </td> </tr> </table> </td> </tr> </table> <hr/> <p/> See the <a href="../cms-services.html">CMS Services Page</a>, if you find a bug <a href="https://it-dev.mpiwg-berlin.mpg.de/tracs/mpdl-project-software/newticket">let us know</a> <br/>Last software update: July, 2012 </body> </html>