comparison 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
comparison
equal deleted inserted replaced
23:e845310098ba 25:e9fe3186670c
1 <html>
2 <head>
3 <title>MPIWG Query project</title>
4 <script type="text/javascript">
5 <!--
6 function Browse() {
7 var luceneQuery = document.getElementById("luceneQueryId1");
8 var schema1checked = document.getElementById("schema1Id").checked;
9 var schema2checked = document.getElementById("schema2Id").checked;
10 var schema3checked = document.getElementById("schema3Id").checked;
11 var schema4checked = document.getElementById("schema4Id").checked;
12 var luceneSchemaQueryStr = GetLuceneSchemaQuery();
13 if (schema1checked && schema2checked && schema3checked && schema4checked)
14 luceneSchemaQueryStr = "*";
15 luceneQuery.value = luceneSchemaQueryStr;
16 }
17 function GetLuceneSchemaQuery() {
18 var schemaFieldValue = "schemaName";
19 var schema1Val = document.getElementById("schema1Id").value;
20 var schema2Val = document.getElementById("schema2Id").value;
21 var schema3Val = document.getElementById("schema3Id").value;
22 var schema4Val = document.getElementById("schema4Id").value;
23 var schema1checked = document.getElementById("schema1Id").checked;
24 var schema2checked = document.getElementById("schema2Id").checked;
25 var schema3checked = document.getElementById("schema3Id").checked;
26 var schema4checked = document.getElementById("schema4Id").checked;
27 var luceneQueryStr = "+" + schemaFieldValue + ":" + "(";
28 if (schema1checked)
29 luceneQueryStr = luceneQueryStr + schema1Val;
30 if (schema2checked)
31 luceneQueryStr = luceneQueryStr + " " + schema2Val;
32 if (schema3checked)
33 luceneQueryStr = luceneQueryStr + " " + schema3Val;
34 if (schema4checked)
35 luceneQueryStr = luceneQueryStr + " " + schema4Val;
36 luceneQueryStr = luceneQueryStr + ")";
37 return luceneQueryStr;
38 }
39 function GetLuceneBoolOp(relOp) {
40 if (relOp == "mustContain")
41 return "+";
42 else if (relOp == "mustNotContain")
43 return "-";
44 else
45 return "";
46 }
47 function AttributeQuery() {
48 var luceneQuery = document.getElementById("luceneQueryId2");
49 var sortBy = document.getElementById("sortById2");
50 var field1Val = document.getElementById("field1Id").value;
51 var field1QueryVal = document.getElementById("field1QueryId").value;
52 var relOp1Value = document.getElementById("relOp1Id").value;
53 var relOp1ValueLucene = GetLuceneBoolOp(relOp1Value);
54 var field2Val = document.getElementById("field2Id").value;
55 var field2QueryVal = document.getElementById("field2QueryId").value;
56 var relOp2Value = document.getElementById("relOp2Id").value;
57 var relOp2ValueLucene = GetLuceneBoolOp(relOp2Value);
58 var luceneQueryStr = "*:* " + relOp1ValueLucene + field1Val + ":"; // *:* so that the minus-Operator works correct when it is alone
59 luceneQueryStr = luceneQueryStr + field1QueryVal;
60 if (field2QueryVal != "")
61 luceneQueryStr = luceneQueryStr + " " + relOp2ValueLucene + field2Val + ":" + field2QueryVal;
62 var schemaQueryStr = GetLuceneSchemaQuery();
63 var schema1checked = document.getElementById("schema1Id").checked;
64 var schema2checked = document.getElementById("schema2Id").checked;
65 var schema3checked = document.getElementById("schema3Id").checked;
66 var schema4checked = document.getElementById("schema4Id").checked;
67 if (schema1checked && schema2checked && schema3checked && schema4checked)
68 schemaQueryStr = "";
69 luceneQueryStr = luceneQueryStr + " " + schemaQueryStr;
70 luceneQuery.value = luceneQueryStr;
71 sortBy.value = "author";
72 }
73 function FulltextQuery() {
74 var luceneQuery = document.getElementById("luceneQueryId3");
75 var translateElem = document.getElementById("translateId3");
76 translateElem.value = "false";
77 var isTranslateQuery = document.getElementById("isTranslateQueryId").checked;
78 if (isTranslateQuery)
79 translateElem.value = "true";
80 var fulltextQueryFieldValue = "tokenOrig";
81 var isMorphQuery = document.getElementById("isMorphQueryId").checked;
82 if (isMorphQuery)
83 fulltextQueryFieldValue = "tokenMorph";
84 var fulltextQueryVal = document.getElementById("fulltextQueryId").value;
85 var luceneQueryStr = "+" + fulltextQueryFieldValue + ":(" + fulltextQueryVal + ")";
86 changeIsMorph();
87 var schemaQueryStr = GetLuceneSchemaQuery();
88 var schema1checked = document.getElementById("schema1Id").checked;
89 var schema2checked = document.getElementById("schema2Id").checked;
90 var schema3checked = document.getElementById("schema3Id").checked;
91 var schema4checked = document.getElementById("schema4Id").checked;
92 if (schema1checked && schema2checked && schema3checked && schema4checked)
93 schemaQueryStr = "";
94 luceneQueryStr = luceneQueryStr + " " + schemaQueryStr;
95 luceneQuery.value = luceneQueryStr;
96 }
97 function changeIsMorph() {
98 var isMorphQuery = document.getElementById("isMorphQueryId").checked;
99 var language = document.getElementById("languageId3");
100 if (isMorphQuery) {
101 var languageValue = document.getElementById("languageId").value;
102 if (languageValue == "none") {
103 if (language != null)
104 language.parentNode.removeChild(language);
105 } else if (language == null) {
106 var queryDocumentsForm = document.getElementById("queryDocumentsId");
107 var languageElement = document.createElement("input");
108 languageElement.setAttribute("type", "hidden");
109 languageElement.setAttribute("name", "language");
110 languageElement.setAttribute("id", "languageId3");
111 languageElement.value = languageValue;
112 queryDocumentsForm.appendChild(languageElement);
113 } else if (language != null) {
114 language.value = languageValue;
115 }
116 } else {
117 if (language != null)
118 language.parentNode.removeChild(language);
119 }
120 }
121 function checkCR(event) {
122 var keyCode = event.keyCode
123 if (keyCode == 13)
124 return false;
125 }
126
127 -->
128 </script>
129 </head>
130 <body>
131 <table height="60px">
132 <colgroup>
133 <col width="90%"/>
134 <col width="10%"/>
135 </colgroup>
136 <tr>
137 <td align="left" valign="top">
138 <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>
139 </td>
140 <td align="left" valign="top">
141 Release 0.5, July, 2012
142 </td>
143 </tr>
144 </table>
145 <hr/>
146 <table>
147 <tr>
148 <td valign="top" height="60px">
149 <table>
150 <tr>
151 <td valign="top"><b>Documents:</b></td>
152 <td>
153 <text style="margin-left:15px;">Archimedes DTD</text><br/>
154 <text style="margin-left:15px;">(until 2008)</text>
155 </td>
156 <td valign="top">
157 <text style="margin-left:1px;"></text><input type="checkbox" name="schema1" id="schema1Id" value="archimedes" checked="checked"/>
158 </td>
159 <td>
160 <text style="margin-left:20px;">Echo Schema</text><br/>
161 <text style="margin-left:20px;">(since 2009)</text>
162 </td>
163 <td valign="top">
164 <text style="margin-left:1px;"></text><input type="checkbox" name="schema2" id="schema2Id" value="echo" checked="checked"/>
165 </td>
166 <td>
167 <text style="margin-left:20px;">TEI Schema</text><br/>
168 <text style="margin-left:20px;">(since 2011)</text>
169 </td>
170 <td valign="top">
171 <text style="margin-left:1px;"></text><input type="checkbox" name="schema3" id="schema3Id" value="TEI" checked="checked"/>
172 </td>
173 <td>
174 <text style="margin-left:20px;">Diverse</text><br/>
175 <text style="margin-left:20px;">(since 2011)</text>
176 </td>
177 <td valign="top">
178 <text style="margin-left:1px;"></text><input type="checkbox" name="schema4" id="schema4Id" value="html" checked="checked"/>
179 </td>
180 <td valign="top">
181 <form name="queryDocuments" action="/mpiwg-mpdl-cms-web/query/QueryDocuments" method="get">
182 <input type="hidden" name="query" id="luceneQueryId1"/>
183 <input type="hidden" name="sortBy" id="sortById1" value="author"/>
184 <text style="margin-left:40px;"></text><button type="submit" onclick="Browse()">Browse</button>
185 </form>
186 </td>
187 </tr>
188 <tr>
189 </tr>
190 </table>
191 </td>
192 </tr>
193
194 <tr>
195 <td valign="top" height="70px">
196 <table>
197 <tr>
198 <td>
199 <select name="field1" id="field1Id">
200 <option value ="author" selected="true">Author</option>
201 <option value ="title">Title</option>
202 <option value ="publisher">Place</option>
203 <option value ="date">Year</option>
204 <option value ="docId">Id</option>
205 <option value ="language">Language</option>
206 </select>
207 </td>
208 <td>
209 <select name="relOp1" id="relOp1Id">
210 <option value ="mustContain" selected="true">must contain</option>
211 <option value ="mayContain">may contain</option>
212 <option value ="mustNotContain">does not contain</option>
213 </select>
214 </td>
215 <td>
216 <input type="text" size="40" name="field1Query" id="field1QueryId" onkeypress="return checkCR(event)"/>
217 </td>
218 <td valign="middle">
219 <form name="queryDocuments" action="/mpiwg-mpdl-cms-web/query/QueryDocuments" method="get">
220 <input type="hidden" name="query" id="luceneQueryId2"/>
221 <input type="hidden" name="sortBy" id="sortById2"/>
222 <button type="submit" onclick="AttributeQuery()">Query</button>
223 </form>
224 </td>
225 </tr>
226
227 <tr>
228 <td>
229 <select name="field2" id="field2Id">
230 <option value ="author">Author</option>
231 <option value ="title" selected="true">Title</option>
232 <option value ="publisher">Place</option>
233 <option value ="date">Year</option>
234 <option value ="docId">Id</option>
235 <option value ="language">Language</option>
236 </select>
237 </td>
238 <td>
239 <select name="relOp2" id="relOp2Id">
240 <option value ="mustContain" selected="true">must contain</option>
241 <option value ="mayContain">may contain</option>
242 <option value ="mustNotContain">does not contain</option>
243 </select>
244 </td>
245 <td>
246 <input type="text" size="40" name="field2Query" id="field2QueryId" value="" onkeypress="return checkCR(event)"/>
247 </td>
248 </tr>
249 </table>
250 </td>
251 </tr>
252
253 <tr>
254 <td valign="top" height="60px">
255 <table>
256 <tr>
257 <td>
258 Document contains <input type="text" size="40" name="fulltextQuery" id="fulltextQueryId" onkeypress="return checkCR(event)"/>
259 </td>
260 <td valign="middle">
261 <form id="queryDocumentsId" name="queryDocuments" action="/mpiwg-mpdl-cms-web/query/QueryDocuments" method="get">
262 <input type="hidden" name="query" id="luceneQueryId3"/>
263 <input type="hidden" name="language" id="languageId3"/>
264 <input type="hidden" name="translate" id="translateId3"/>
265 <button type="submit" onclick="FulltextQuery()">Query</button>
266 </form>
267 </td>
268 </tr>
269 </table>
270 <table>
271 <tr>
272 <td valign="top">
273 <text style="margin-left:30px;">morphological</text>
274 </td>
275 <td valign="top">
276 <text style="margin-left:1px;"></text><input type="checkbox" name="isMorphQuery" id="isMorphQueryId" value="isMorphQuery" onchange="ChangeIsMorph()"/>
277 </td>
278 <td valign="top">
279 <text style="margin-left:3px;">language: </text>
280 </td>
281 <td valign="top" style="margin-left:3px;">
282 <text style="margin-left:1px;"></text>
283 <select name="language" id="languageId">
284 <option value ="none" selected="true">None</option>
285 <option value ="ara">Arabic</option>
286 <option value ="zho">Chinese</option>
287 <option value ="nld">Dutch</option>
288 <option value ="eng">English</option>
289 <option value ="fra">French</option>
290 <option value ="deu">German</option>
291 <option value ="grc">Greek</option>
292 <option value ="ita">Italian</option>
293 <option value ="lat">Latin</option>
294 </select>
295 </td>
296 <td valign="top">
297 <text style="margin-left:10px;">translate</text><br/>
298 </td>
299 <td valign="top">
300 <text style="margin-left:1px;"></text><input type="checkbox" name="isTranslateQuery" id="isTranslateQueryId" value="translate"/>
301 </td>
302 </tr>
303 </table>
304 </td>
305 </tr>
306
307 </table>
308 <hr/>
309 <p/>
310 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>
311 <br/>Last software update: July, 2012
312 </body>
313 </html>