1
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html>
|
2
|
<head>
|
3
|
<title>alldiffs.html</title>
|
4
|
<style>
|
5
|
span.tx {
|
6
|
font-family: monospace;
|
7
|
font-size: 12pt;
|
8
|
white-space: pre;
|
9
|
}
|
10
|
td {
|
11
|
text-height: 1em;
|
12
|
font-family: Lucida Console;
|
13
|
font-size: 8pt;
|
14
|
}
|
15
|
td#title {
|
16
|
background-color: orange;
|
17
|
color:black;
|
18
|
font-family: serif;
|
19
|
font-size: 12pt;
|
20
|
font-weight: bold;
|
21
|
}
|
22
|
#a {
|
23
|
background-color: #DDFFDD;
|
24
|
color:black;
|
25
|
}
|
26
|
#d {
|
27
|
background-color: #FFDDFF;
|
28
|
color:black;
|
29
|
}
|
30
|
#c {
|
31
|
background-color: lightblue;
|
32
|
color:black;
|
33
|
}
|
34
|
#sp {
|
35
|
width: 2px;
|
36
|
background-color: #555555;
|
37
|
color:#555555;
|
38
|
font-family: serif;
|
39
|
font-size: 6pt;
|
40
|
font-weight: normal;
|
41
|
}
|
42
|
td#sk {
|
43
|
background-color: lightgray;
|
44
|
color:black;
|
45
|
font-family: serif;
|
46
|
font-size: 12pt;
|
47
|
font-weight: bold;
|
48
|
}
|
49
|
</style>
|
50
|
</head>
|
51
|
<body>
|
52
|
<div style="background-color: #EEEEEE;"><H3><a name="src/org/ecoinformatics/seek/datasource/darwincore/DarwinCoreDataSource.java"></a>src/org/ecoinformatics/seek/datasource/darwincore/DarwinCoreDataSource.java - Revision 1.16</H3>
|
53
|
<hr></div><table BGCOLOR=White CELLPADDING=0 CELLSPACING=0 WIDTH="100%" COLS=3>
|
54
|
<COLGROUP><COL width="*"><COL width="1"><COL width="*"><THEAD>
|
55
|
<tr><td id=title><center>src/org/ecoinformatics/seek/datasource/darwincore/DarwinCoreDataSource.java,1.16</center></td><td id=sp>.</td><td id=title><center>Disk File</center></td></tr>
|
56
|
<tr><td id=sk>Skipping to line 1189</td><td id=sp>.</td><td id=sk> </td></tr>
|
57
|
<tr>
|
58
|
<td id=white>
|
59
|
<span class=tx> {</span></td>
|
60
|
<td id=sp>.</td>
|
61
|
<td id=white>
|
62
|
<span class=tx> {</span></td>
|
63
|
</tr>
|
64
|
<tr>
|
65
|
<td id=white>
|
66
|
<span class=tx> DSTableIFace table = (DSTableIFace)_darwinCoreSchema.getTables()
|
67
|
.elementAt(0); // there is only one table</span></td>
|
68
|
<td id=sp>.</td>
|
69
|
<td id=white>
|
70
|
<span class=tx> DSTableIFace table = (DSTableIFace)_darwinCoreSchema.getTables()
|
71
|
.elementAt(0); // there is only one table</span></td>
|
72
|
</tr>
|
73
|
<tr>
|
74
|
<td id=white>
|
75
|
<span class=tx> for (Enumeration e = table.getFields().elements(); e.hasMoreElem
|
76
|
ents();)</span></td>
|
77
|
<td id=sp>.</td>
|
78
|
<td id=white>
|
79
|
<span class=tx> for (Enumeration e = table.getFields().elements(); e.hasMoreElem
|
80
|
ents();)</span></td>
|
81
|
</tr>
|
82
|
<tr>
|
83
|
<td id=white>
|
84
|
<span class=tx> {</span></td>
|
85
|
<td id=sp>.</td>
|
86
|
<td id=white>
|
87
|
<span class=tx> {</span></td>
|
88
|
</tr>
|
89
|
<tr>
|
90
|
<td id=white>
|
91
|
<span class=tx> DSTableFieldIFace field = (DSTableFieldIFace)e.nextElement()
|
92
|
;</span></td>
|
93
|
<td id=sp>.</td>
|
94
|
<td id=white>
|
95
|
<span class=tx> DSTableFieldIFace field = (DSTableFieldIFace)e.nextElement()
|
96
|
;</span></td>
|
97
|
</tr>
|
98
|
<tr>
|
99
|
<td id=c>
|
100
|
<a name="change0"></a><span class=tx> queryBuf.append(" <returnfield>/" + field.getName() + "</re
|
101
|
turnfield>");</span></td>
|
102
|
<td id=sp>.</td>
|
103
|
<td id=c>
|
104
|
<span class=tx> queryBuf.append(" <returnField>/" + field.getName() + "</re
|
105
|
turnField>");</span></td>
|
106
|
</tr>
|
107
|
<tr>
|
108
|
<td id=white>
|
109
|
<span class=tx> }</span></td>
|
110
|
<td id=sp>.</td>
|
111
|
<td id=white>
|
112
|
<span class=tx> }</span></td>
|
113
|
</tr>
|
114
|
<tr>
|
115
|
<td id=white>
|
116
|
<span class=tx> } else </span></td>
|
117
|
<td id=sp>.</td>
|
118
|
<td id=white>
|
119
|
<span class=tx> } else </span></td>
|
120
|
</tr>
|
121
|
<tr>
|
122
|
<td id=white>
|
123
|
<span class=tx> {</span></td>
|
124
|
<td id=sp>.</td>
|
125
|
<td id=white>
|
126
|
<span class=tx> {</span></td>
|
127
|
</tr>
|
128
|
<tr>
|
129
|
<td id=c>
|
130
|
<a name="change1"></a><span class=tx> queryBuf.append(" <returnfield>/Species</returnfield>");</span></td>
|
131
|
<td id=sp>.</td>
|
132
|
<td id=c>
|
133
|
<span class=tx> queryBuf.append(" <returnField>/Species</returnField>");</span></td>
|
134
|
</tr>
|
135
|
<tr>
|
136
|
<td id=c>
|
137
|
<span class=tx> queryBuf.append(" <returnfield>/ScientificName</returnfield>");</span></td>
|
138
|
<td id=sp>.</td>
|
139
|
<td id=c>
|
140
|
<span class=tx> queryBuf.append(" <returnField>/ScientificName</returnField>");</span></td>
|
141
|
</tr>
|
142
|
<tr>
|
143
|
<td id=c>
|
144
|
<span class=tx> queryBuf.append(" <returnfield>/Collector</returnfield>");</span></td>
|
145
|
<td id=sp>.</td>
|
146
|
<td id=c>
|
147
|
<span class=tx> queryBuf.append(" <returnField>/Collector</returnField>");</span></td>
|
148
|
</tr>
|
149
|
<tr>
|
150
|
<td id=c>
|
151
|
<span class=tx> queryBuf.append(" <returnfield>/YearCollected</returnfield>");</span></td>
|
152
|
<td id=sp>.</td>
|
153
|
<td id=c>
|
154
|
<span class=tx> queryBuf.append(" <returnField>/YearCollected</returnField>");</span></td>
|
155
|
</tr>
|
156
|
<tr>
|
157
|
<td id=c>
|
158
|
<span class=tx> queryBuf.append(" <returnfield>/InstitutionCode</returnfield>")
|
159
|
;</span></td>
|
160
|
<td id=sp>.</td>
|
161
|
<td id=c>
|
162
|
<span class=tx> queryBuf.append(" <returnField>/InstitutionCode</returnField>")
|
163
|
;</span></td>
|
164
|
</tr>
|
165
|
<tr>
|
166
|
<td id=c>
|
167
|
<span class=tx> queryBuf.append(" <returnfield>/CollectionCode</returnfield>");</span></td>
|
168
|
<td id=sp>.</td>
|
169
|
<td id=c>
|
170
|
<span class=tx> queryBuf.append(" <returnField>/CollectionCode</returnField>");</span></td>
|
171
|
</tr>
|
172
|
<tr>
|
173
|
<td id=c>
|
174
|
<span class=tx> queryBuf.append(" <returnfield>/CatalogNumber</returnfield>");</span></td>
|
175
|
<td id=sp>.</td>
|
176
|
<td id=c>
|
177
|
<span class=tx> queryBuf.append(" <returnField>/CatalogNumber</returnField>");</span></td>
|
178
|
</tr>
|
179
|
<tr>
|
180
|
<td id=c>
|
181
|
<span class=tx> queryBuf.append(" <returnfield>/CatalogNumberText</returnfield>
|
182
|
");</span></td>
|
183
|
<td id=sp>.</td>
|
184
|
<td id=c>
|
185
|
<span class=tx> queryBuf.append(" <returnField>/CatalogNumberText</returnField>
|
186
|
");</span></td>
|
187
|
</tr>
|
188
|
<tr>
|
189
|
<td id=c>
|
190
|
<span class=tx> queryBuf.append(" <returnfield>/DecimalLatitude</returnfield>")
|
191
|
;</span></td>
|
192
|
<td id=sp>.</td>
|
193
|
<td id=c>
|
194
|
<span class=tx> queryBuf.append(" <returnField>/DecimalLatitude</returnField>")
|
195
|
;</span></td>
|
196
|
</tr>
|
197
|
<tr>
|
198
|
<td id=c>
|
199
|
<span class=tx> queryBuf.append(" <returnfield>/DecimalLongitude</returnfield>"
|
200
|
);</span></td>
|
201
|
<td id=sp>.</td>
|
202
|
<td id=c>
|
203
|
<span class=tx> queryBuf.append(" <returnField>/DecimalLongitude</returnField>"
|
204
|
);</span></td>
|
205
|
</tr>
|
206
|
<tr>
|
207
|
<td id=white>
|
208
|
<span class=tx> }</span></td>
|
209
|
<td id=sp>.</td>
|
210
|
<td id=white>
|
211
|
<span class=tx> }</span></td>
|
212
|
</tr>
|
213
|
<tr>
|
214
|
<td id=white>
|
215
|
<span class=tx> queryBuf.append(" <condition operator=\"LIKE\" concept=\"Scientific
|
216
|
Name\">" + searchStr +"</condition>");</span></td>
|
217
|
<td id=sp>.</td>
|
218
|
<td id=white>
|
219
|
<span class=tx> queryBuf.append(" <condition operator=\"LIKE\" concept=\"Scientific
|
220
|
Name\">" + searchStr +"</condition>");</span></td>
|
221
|
</tr>
|
222
|
<tr>
|
223
|
<td id=white>
|
224
|
<span class=tx> queryBuf.append("</egq:query>");</span></td>
|
225
|
<td id=sp>.</td>
|
226
|
<td id=white>
|
227
|
<span class=tx> queryBuf.append("</egq:query>");</span></td>
|
228
|
</tr>
|
229
|
<tr>
|
230
|
<td id=white>
|
231
|
<span class=tx> </span></td>
|
232
|
<td id=sp>.</td>
|
233
|
<td id=white>
|
234
|
<span class=tx> </span></td>
|
235
|
</tr>
|
236
|
<tr>
|
237
|
<td id=white>
|
238
|
<span class=tx> if (providerList.size() > 0)</span></td>
|
239
|
<td id=sp>.</td>
|
240
|
<td id=white>
|
241
|
<span class=tx> if (providerList.size() > 0)</span></td>
|
242
|
</tr>
|
243
|
<tr><td id=sk>Skipping to line 1219</td><td id=sp>.</td><td id=sk> </td></tr>
|
244
|
<tr>
|
245
|
<td id=white>
|
246
|
<span class=tx> int inx = providerStr.indexOf('?');</span></td>
|
247
|
<td id=sp>.</td>
|
248
|
<td id=white>
|
249
|
<span class=tx> int inx = providerStr.indexOf('?');</span></td>
|
250
|
</tr>
|
251
|
<tr>
|
252
|
<td id=white>
|
253
|
<span class=tx> String baseURL = providerStr.substring(0, inx);</span></td>
|
254
|
<td id=sp>.</td>
|
255
|
<td id=white>
|
256
|
<span class=tx> String baseURL = providerStr.substring(0, inx);</span></td>
|
257
|
</tr>
|
258
|
<tr>
|
259
|
<td id=white>
|
260
|
<span class=tx> inx = providerStr.lastIndexOf('=');</span></td>
|
261
|
<td id=sp>.</td>
|
262
|
<td id=white>
|
263
|
<span class=tx> inx = providerStr.lastIndexOf('=');</span></td>
|
264
|
</tr>
|
265
|
<tr>
|
266
|
<td id=white>
|
267
|
<span class=tx> String resource = providerStr.substring(inx+1, providerStr.l
|
268
|
ength()).replaceAll("%20", " ");</span></td>
|
269
|
<td id=sp>.</td>
|
270
|
<td id=white>
|
271
|
<span class=tx> String resource = providerStr.substring(inx+1, providerStr.l
|
272
|
ength()).replaceAll("%20", " ");</span></td>
|
273
|
</tr>
|
274
|
<tr>
|
275
|
<td id=white>
|
276
|
<span class=tx> //System.out.println(queryBuf.toString());</span></td>
|
277
|
<td id=sp>.</td>
|
278
|
<td id=white>
|
279
|
<span class=tx> //System.out.println(queryBuf.toString());</span></td>
|
280
|
</tr>
|
281
|
<tr>
|
282
|
<td id=a>
|
283
|
<a name="change2"></a><span class=tx> </span></td>
|
284
|
<td id=sp>.</td>
|
285
|
<td id=a>
|
286
|
<span class=tx> </span></td>
|
287
|
</tr>
|
288
|
<tr>
|
289
|
<td id=white>
|
290
|
<span class=tx> StringReader strReader = new StringReader(queryBuf.toS
|
291
|
tring());</span></td>
|
292
|
<td id=sp>.</td>
|
293
|
<td id=white>
|
294
|
<span class=tx> StringReader strReader = new StringReader(queryBuf.toS
|
295
|
tring());</span></td>
|
296
|
</tr>
|
297
|
<tr>
|
298
|
<td id=white>
|
299
|
<span class=tx> EcogridQueryParser parser = new EcogridQueryParser(strRea
|
300
|
der);</span></td>
|
301
|
<td id=sp>.</td>
|
302
|
<td id=white>
|
303
|
<span class=tx> EcogridQueryParser parser = new EcogridQueryParser(strRea
|
304
|
der);</span></td>
|
305
|
</tr>
|
306
|
<tr>
|
307
|
<td id=white>
|
308
|
<span class=tx> parser.parseXML();</span></td>
|
309
|
<td id=sp>.</td>
|
310
|
<td id=white>
|
311
|
<span class=tx> parser.parseXML();</span></td>
|
312
|
</tr>
|
313
|
<tr>
|
314
|
<td id=white>
|
315
|
<span class=tx> query = parser.getEcogridQuery();</span></td>
|
316
|
<td id=sp>.</td>
|
317
|
<td id=white>
|
318
|
<span class=tx> query = parser.getEcogridQuery();</span></td>
|
319
|
</tr>
|
320
|
<tr>
|
321
|
<td id=white>
|
322
|
<span class=tx> </span></td>
|
323
|
<td id=sp>.</td>
|
324
|
<td id=white>
|
325
|
<span class=tx> </span></td>
|
326
|
</tr>
|
327
|
</table></body></html>
|
328
|
<div style="background-color: #EEEEEE;"><H3><a name="src/org/ecoinformatics/seek/ecogrid/SearchQueryGenerator.java"></a>src/org/ecoinformatics/seek/ecogrid/SearchQueryGenerator.java - Revision 1.6</H3>
|
329
|
<hr></div><table BGCOLOR=White CELLPADDING=0 CELLSPACING=0 WIDTH="100%" COLS=3>
|
330
|
<COLGROUP><COL width="*"><COL width="1"><COL width="*"><THEAD>
|
331
|
<tr><td id=title><center>src/org/ecoinformatics/seek/ecogrid/SearchQueryGenerator.java,1.6</center></td><td id=sp>.</td><td id=title><center>Disk File</center></td></tr>
|
332
|
<tr><td id=sk>Skipping to line 30</td><td id=sp>.</td><td id=sk> </td></tr>
|
333
|
<tr>
|
334
|
<td id=white>
|
335
|
<span class=tx> * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.</span></td>
|
336
|
<td id=sp>.</td>
|
337
|
<td id=white>
|
338
|
<span class=tx> * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.</span></td>
|
339
|
</tr>
|
340
|
<tr>
|
341
|
<td id=white>
|
342
|
<span class=tx> */</span></td>
|
343
|
<td id=sp>.</td>
|
344
|
<td id=white>
|
345
|
<span class=tx> */</span></td>
|
346
|
</tr>
|
347
|
<tr>
|
348
|
<td id=white>
|
349
|
<span class=tx> </span></td>
|
350
|
<td id=sp>.</td>
|
351
|
<td id=white>
|
352
|
<span class=tx> </span></td>
|
353
|
</tr>
|
354
|
<tr>
|
355
|
<td id=white>
|
356
|
<span class=tx>package org.ecoinformatics.seek.ecogrid;</span></td>
|
357
|
<td id=sp>.</td>
|
358
|
<td id=white>
|
359
|
<span class=tx>package org.ecoinformatics.seek.ecogrid;</span></td>
|
360
|
</tr>
|
361
|
<tr>
|
362
|
<td id=white>
|
363
|
<span class=tx> </span></td>
|
364
|
<td id=sp>.</td>
|
365
|
<td id=white>
|
366
|
<span class=tx> </span></td>
|
367
|
</tr>
|
368
|
<tr>
|
369
|
<td id=white>
|
370
|
<span class=tx>import java.util.Hashtable;</span></td>
|
371
|
<td id=sp>.</td>
|
372
|
<td id=white>
|
373
|
<span class=tx>import java.util.Hashtable;</span></td>
|
374
|
</tr>
|
375
|
<tr>
|
376
|
<td id=d>
|
377
|
<a name="change0"></a><span class=tx>import java.util.Vector;</span></td>
|
378
|
<td id=sp>.</td>
|
379
|
<td id=d>
|
380
|
<span class=tx> </span></td>
|
381
|
</tr>
|
382
|
<tr>
|
383
|
<td id=white>
|
384
|
<span class=tx> </span></td>
|
385
|
<td id=sp>.</td>
|
386
|
<td id=white>
|
387
|
<span class=tx> </span></td>
|
388
|
</tr>
|
389
|
<tr>
|
390
|
<td id=white>
|
391
|
<span class=tx>import javax.xml.transform.TransformerException;</span></td>
|
392
|
<td id=sp>.</td>
|
393
|
<td id=white>
|
394
|
<span class=tx>import javax.xml.transform.TransformerException;</span></td>
|
395
|
</tr>
|
396
|
<tr>
|
397
|
<td id=white>
|
398
|
<span class=tx> </span></td>
|
399
|
<td id=sp>.</td>
|
400
|
<td id=white>
|
401
|
<span class=tx> </span></td>
|
402
|
</tr>
|
403
|
<tr>
|
404
|
<td id=white>
|
405
|
<span class=tx>import org.apache.axis.types.URI;</span></td>
|
406
|
<td id=sp>.</td>
|
407
|
<td id=white>
|
408
|
<span class=tx>import org.apache.axis.types.URI;</span></td>
|
409
|
</tr>
|
410
|
<tr>
|
411
|
<td id=c>
|
412
|
<a name="change1"></a><span class=tx>import org.apache.xpath.XPathAPI;</span></td>
|
413
|
<td id=sp>.</td>
|
414
|
<td id=c>
|
415
|
<span class=tx>import org.ecoinformatics.ecogrid.EcogridQueryParser;</span></td>
|
416
|
</tr>
|
417
|
<tr>
|
418
|
<td id=c>
|
419
|
<span class=tx>import org.ecoinformatics.ecogrid.ANDType;</span></td>
|
420
|
<td id=sp>.</td>
|
421
|
<td id=c>
|
422
|
<span class=tx> </span></td>
|
423
|
</tr>
|
424
|
<tr>
|
425
|
<td id=c>
|
426
|
<span class=tx>import org.ecoinformatics.ecogrid.ConditionType;</span></td>
|
427
|
<td id=sp>.</td>
|
428
|
<td id=c>
|
429
|
<span class=tx> </span></td>
|
430
|
</tr>
|
431
|
<tr>
|
432
|
<td id=c>
|
433
|
<span class=tx>import org.ecoinformatics.ecogrid.LimitedXPathExpression;</span></td>
|
434
|
<td id=sp>.</td>
|
435
|
<td id=c>
|
436
|
<span class=tx> </span></td>
|
437
|
</tr>
|
438
|
<tr>
|
439
|
<td id=c>
|
440
|
<span class=tx>import org.ecoinformatics.ecogrid.ORType;</span></td>
|
441
|
<td id=sp>.</td>
|
442
|
<td id=c>
|
443
|
<span class=tx> </span></td>
|
444
|
</tr>
|
445
|
<tr>
|
446
|
<td id=c>
|
447
|
<span class=tx>import org.ecoinformatics.ecogrid.OperatorType;</span></td>
|
448
|
<td id=sp>.</td>
|
449
|
<td id=c>
|
450
|
<span class=tx> </span></td>
|
451
|
</tr>
|
452
|
<tr>
|
453
|
<td id=white>
|
454
|
<span class=tx>import org.ecoinformatics.ecogrid.QueryType;</span></td>
|
455
|
<td id=sp>.</td>
|
456
|
<td id=white>
|
457
|
<span class=tx>import org.ecoinformatics.ecogrid.QueryType;</span></td>
|
458
|
</tr>
|
459
|
<tr>
|
460
|
<td id=d>
|
461
|
<a name="change2"></a><span class=tx>import org.ecoinformatics.ecogrid.QueryType_namespace;</span></td>
|
462
|
<td id=sp>.</td>
|
463
|
<td id=d>
|
464
|
<span class=tx> </span></td>
|
465
|
</tr>
|
466
|
<tr>
|
467
|
<td id=white>
|
468
|
<span class=tx>import org.ecoinformatics.seek.ecogrid.exception.InvalidEcogridQueryException;</span></td>
|
469
|
<td id=sp>.</td>
|
470
|
<td id=white>
|
471
|
<span class=tx>import org.ecoinformatics.seek.ecogrid.exception.InvalidEcogridQueryException;</span></td>
|
472
|
</tr>
|
473
|
<tr>
|
474
|
<td id=white>
|
475
|
<span class=tx>import org.ecoinformatics.util.Config;</span></td>
|
476
|
<td id=sp>.</td>
|
477
|
<td id=white>
|
478
|
<span class=tx>import org.ecoinformatics.util.Config;</span></td>
|
479
|
</tr>
|
480
|
<tr>
|
481
|
<td id=white>
|
482
|
<span class=tx>import org.ecoinformatics.util.DebugPrinter;</span></td>
|
483
|
<td id=sp>.</td>
|
484
|
<td id=white>
|
485
|
<span class=tx>import org.ecoinformatics.util.DebugPrinter;</span></td>
|
486
|
</tr>
|
487
|
<tr>
|
488
|
<td id=d>
|
489
|
<a name="change3"></a><span class=tx>import org.w3c.dom.Element;</span></td>
|
490
|
<td id=sp>.</td>
|
491
|
<td id=d>
|
492
|
<span class=tx> </span></td>
|
493
|
</tr>
|
494
|
<tr>
|
495
|
<td id=d>
|
496
|
<span class=tx>import org.w3c.dom.NamedNodeMap;</span></td>
|
497
|
<td id=sp>.</td>
|
498
|
<td id=d>
|
499
|
<span class=tx> </span></td>
|
500
|
</tr>
|
501
|
<tr>
|
502
|
<td id=white>
|
503
|
<span class=tx>import org.w3c.dom.Node;</span></td>
|
504
|
<td id=sp>.</td>
|
505
|
<td id=white>
|
506
|
<span class=tx>import org.w3c.dom.Node;</span></td>
|
507
|
</tr>
|
508
|
<tr>
|
509
|
<td id=white>
|
510
|
<span class=tx>import org.w3c.dom.NodeList;</span></td>
|
511
|
<td id=sp>.</td>
|
512
|
<td id=white>
|
513
|
<span class=tx>import org.w3c.dom.NodeList;</span></td>
|
514
|
</tr>
|
515
|
<tr>
|
516
|
<td id=white>
|
517
|
<span class=tx> </span></td>
|
518
|
<td id=sp>.</td>
|
519
|
<td id=white>
|
520
|
<span class=tx> </span></td>
|
521
|
</tr>
|
522
|
<tr>
|
523
|
<td id=white>
|
524
|
<span class=tx>/**</span></td>
|
525
|
<td id=sp>.</td>
|
526
|
<td id=white>
|
527
|
<span class=tx>/**</span></td>
|
528
|
</tr>
|
529
|
<tr>
|
530
|
<td id=white>
|
531
|
<span class=tx> * This class will read kepler configure file and get the query part from it</span></td>
|
532
|
<td id=sp>.</td>
|
533
|
<td id=white>
|
534
|
<span class=tx> * This class will read kepler configure file and get the query part from it</span></td>
|
535
|
</tr>
|
536
|
<tr><td id=sk>Skipping to line 52</td><td id=sp>.</td><td id=sk> </td></tr>
|
537
|
<tr>
|
538
|
<td id=white>
|
539
|
<span class=tx> * </span></td>
|
540
|
<td id=sp>.</td>
|
541
|
<td id=white>
|
542
|
<span class=tx> * </span></td>
|
543
|
</tr>
|
544
|
<tr>
|
545
|
<td id=white>
|
546
|
<span class=tx> */</span></td>
|
547
|
<td id=sp>.</td>
|
548
|
<td id=white>
|
549
|
<span class=tx> */</span></td>
|
550
|
</tr>
|
551
|
<tr>
|
552
|
<td id=white>
|
553
|
<span class=tx> </span></td>
|
554
|
<td id=sp>.</td>
|
555
|
<td id=white>
|
556
|
<span class=tx> </span></td>
|
557
|
</tr>
|
558
|
<tr>
|
559
|
<td id=white>
|
560
|
<span class=tx>public class SearchQueryGenerator </span></td>
|
561
|
<td id=sp>.</td>
|
562
|
<td id=white>
|
563
|
<span class=tx>public class SearchQueryGenerator </span></td>
|
564
|
</tr>
|
565
|
<tr>
|
566
|
<td id=white>
|
567
|
<span class=tx>{</span></td>
|
568
|
<td id=sp>.</td>
|
569
|
<td id=white>
|
570
|
<span class=tx>{</span></td>
|
571
|
</tr>
|
572
|
<tr>
|
573
|
<td id=c>
|
574
|
<a name="change4"></a><span class=tx> private String queryId = null;</span></td>
|
575
|
<td id=sp>.</td>
|
576
|
<td id=c>
|
577
|
<span class=tx> private String _queryId = null;</span></td>
|
578
|
</tr>
|
579
|
<tr>
|
580
|
<td id=c>
|
581
|
<span class=tx> private Hashtable replacementMap = null;</span></td>
|
582
|
<td id=sp>.</td>
|
583
|
<td id=c>
|
584
|
<span class=tx> private Hashtable _replacementMap = null;</span></td>
|
585
|
</tr>
|
586
|
<tr>
|
587
|
<td id=c>
|
588
|
<span class=tx> private QueryType query = new QueryType();</span></td>
|
589
|
<td id=sp>.</td>
|
590
|
<td id=c>
|
591
|
<span class=tx> private QueryType _query = new QueryType();</span></td>
|
592
|
</tr>
|
593
|
<tr>
|
594
|
<td id=c>
|
595
|
<span class=tx> private DebugPrinter dbg = DebugPrinter.getInstance();</span></td>
|
596
|
<td id=sp>.</td>
|
597
|
<td id=c>
|
598
|
<span class=tx> private DebugPrinter _dbg = DebugPrinter.getInstance();</span></td>
|
599
|
</tr>
|
600
|
<tr>
|
601
|
<td id=c>
|
602
|
<span class=tx> private Vector returnFieldList = new Vector();</span></td>
|
603
|
<td id=sp>.</td>
|
604
|
<td id=c>
|
605
|
<span class=tx> </span></td>
|
606
|
</tr>
|
607
|
<tr>
|
608
|
<td id=white>
|
609
|
<span class=tx> </span></td>
|
610
|
<td id=sp>.</td>
|
611
|
<td id=white>
|
612
|
<span class=tx> </span></td>
|
613
|
</tr>
|
614
|
<tr>
|
615
|
<td id=white>
|
616
|
<span class=tx> private final static String QUERYPATH = "//ecogridService/queryList/query[
|
617
|
@queryId='";</span></td>
|
618
|
<td id=sp>.</td>
|
619
|
<td id=white>
|
620
|
<span class=tx> private final static String QUERYPATH = "//ecogridService/queryList/query[
|
621
|
@queryId='";</span></td>
|
622
|
</tr>
|
623
|
<tr>
|
624
|
<td id=d>
|
625
|
<a name="change5"></a><span class=tx> private final static String NAMESPACE = "namespace";</span></td>
|
626
|
<td id=sp>.</td>
|
627
|
<td id=d>
|
628
|
<span class=tx> </span></td>
|
629
|
</tr>
|
630
|
<tr>
|
631
|
<td id=d>
|
632
|
<span class=tx> private final static String RETURNFIELD = "returnField";</span></td>
|
633
|
<td id=sp>.</td>
|
634
|
<td id=d>
|
635
|
<span class=tx> </span></td>
|
636
|
</tr>
|
637
|
<tr>
|
638
|
<td id=d>
|
639
|
<span class=tx> private final static String TITLE = "title";</span></td>
|
640
|
<td id=sp>.</td>
|
641
|
<td id=d>
|
642
|
<span class=tx> </span></td>
|
643
|
</tr>
|
644
|
<tr>
|
645
|
<td id=d>
|
646
|
<span class=tx> private final static String AND = "AND";</span></td>
|
647
|
<td id=sp>.</td>
|
648
|
<td id=d>
|
649
|
<span class=tx> </span></td>
|
650
|
</tr>
|
651
|
<tr>
|
652
|
<td id=d>
|
653
|
<span class=tx> private final static String OR = "OR";</span></td>
|
654
|
<td id=sp>.</td>
|
655
|
<td id=d>
|
656
|
<span class=tx> </span></td>
|
657
|
</tr>
|
658
|
<tr>
|
659
|
<td id=white>
|
660
|
<span class=tx> private final static String CONDITION = "condition";</span></td>
|
661
|
<td id=sp>.</td>
|
662
|
<td id=white>
|
663
|
<span class=tx> private final static String CONDITION = "condition";</span></td>
|
664
|
</tr>
|
665
|
<tr>
|
666
|
<td id=d>
|
667
|
<a name="change6"></a><span class=tx> private final static String SYSTEM = "system";</span></td>
|
668
|
<td id=sp>.</td>
|
669
|
<td id=d>
|
670
|
<span class=tx> </span></td>
|
671
|
</tr>
|
672
|
<tr>
|
673
|
<td id=d>
|
674
|
<span class=tx> private final static String OPERATOR = "operator";</span></td>
|
675
|
<td id=sp>.</td>
|
676
|
<td id=d>
|
677
|
<span class=tx> </span></td>
|
678
|
</tr>
|
679
|
<tr>
|
680
|
<td id=d>
|
681
|
<span class=tx> private final static String CONCEPT = "concept";</span></td>
|
682
|
<td id=sp>.</td>
|
683
|
<td id=d>
|
684
|
<span class=tx> </span></td>
|
685
|
</tr>
|
686
|
<tr>
|
687
|
<td id=d>
|
688
|
<span class=tx> private static final int NAMESPACEARRAYLENGTH = 1;</span></td>
|
689
|
<td id=sp>.</td>
|
690
|
<td id=d>
|
691
|
<span class=tx> </span></td>
|
692
|
</tr>
|
693
|
<tr>
|
694
|
<td id=d>
|
695
|
<span class=tx> private static final int TITLEEARRAYLENGTH = 1;</span></td>
|
696
|
<td id=sp>.</td>
|
697
|
<td id=d>
|
698
|
<span class=tx> </span></td>
|
699
|
</tr>
|
700
|
<tr>
|
701
|
<td id=white>
|
702
|
<span class=tx> </span></td>
|
703
|
<td id=sp>.</td>
|
704
|
<td id=white>
|
705
|
<span class=tx> </span></td>
|
706
|
</tr>
|
707
|
<tr>
|
708
|
<td id=white>
|
709
|
<span class=tx> /**</span></td>
|
710
|
<td id=sp>.</td>
|
711
|
<td id=white>
|
712
|
<span class=tx> /**</span></td>
|
713
|
</tr>
|
714
|
<tr>
|
715
|
<td id=white>
|
716
|
<span class=tx> * Constructor of SearchQueryGenerator</span></td>
|
717
|
<td id=sp>.</td>
|
718
|
<td id=white>
|
719
|
<span class=tx> * Constructor of SearchQueryGenerator</span></td>
|
720
|
</tr>
|
721
|
<tr>
|
722
|
<td id=white>
|
723
|
<span class=tx> * @param queryId String the queryId which will be found in config</span></td>
|
724
|
<td id=sp>.</td>
|
725
|
<td id=white>
|
726
|
<span class=tx> * @param queryId String the queryId which will be found in config</span></td>
|
727
|
</tr>
|
728
|
<tr>
|
729
|
<td id=white>
|
730
|
<span class=tx> * @param replacementMap Hashtable the hash table which contain the </span></td>
|
731
|
<td id=sp>.</td>
|
732
|
<td id=white>
|
733
|
<span class=tx> * @param replacementMap Hashtable the hash table which contain the </span></td>
|
734
|
</tr>
|
735
|
<tr><td id=sk>Skipping to line 70</td><td id=sp>.</td><td id=sk> </td></tr>
|
736
|
<tr>
|
737
|
<td id=white>
|
738
|
<span class=tx> * value - replacement</span></td>
|
739
|
<td id=sp>.</td>
|
740
|
<td id=white>
|
741
|
<span class=tx> * value - replacement</span></td>
|
742
|
</tr>
|
743
|
<tr>
|
744
|
<td id=white>
|
745
|
<span class=tx> * For example, if key is "#value#", and value is "soil". This means any</span></td>
|
746
|
<td id=sp>.</td>
|
747
|
<td id=white>
|
748
|
<span class=tx> * For example, if key is "#value#", and value is "soil". This means any</span></td>
|
749
|
</tr>
|
750
|
<tr>
|
751
|
<td id=white>
|
752
|
<span class=tx> * element and attribute in xml has value "#value#" will be replaced by soil</span></td>
|
753
|
<td id=sp>.</td>
|
754
|
<td id=white>
|
755
|
<span class=tx> * element and attribute in xml has value "#value#" will be replaced by soil</span></td>
|
756
|
</tr>
|
757
|
<tr>
|
758
|
<td id=white>
|
759
|
<span class=tx> */</span></td>
|
760
|
<td id=sp>.</td>
|
761
|
<td id=white>
|
762
|
<span class=tx> */</span></td>
|
763
|
</tr>
|
764
|
<tr>
|
765
|
<td id=c>
|
766
|
<a name="change7"></a><span class=tx> public SearchQueryGenerator(String queryId, Hashtable replacementMap)</span></td>
|
767
|
<td id=sp>.</td>
|
768
|
<td id=c>
|
769
|
<span class=tx> public SearchQueryGenerator(String queryId, </span></td>
|
770
|
</tr>
|
771
|
<tr>
|
772
|
<td id=c>
|
773
|
<span class=tx> </span></td>
|
774
|
<td id=sp>.</td>
|
775
|
<td id=c>
|
776
|
<span class=tx> Hashtable replacementMap)</span></td>
|
777
|
</tr>
|
778
|
<tr>
|
779
|
<td id=white>
|
780
|
<span class=tx> throws InvalidEcogridQueryException</span></td>
|
781
|
<td id=sp>.</td>
|
782
|
<td id=white>
|
783
|
<span class=tx> throws InvalidEcogridQueryException</span></td>
|
784
|
</tr>
|
785
|
<tr>
|
786
|
<td id=white>
|
787
|
<span class=tx> </span></td>
|
788
|
<td id=sp>.</td>
|
789
|
<td id=white>
|
790
|
<span class=tx> </span></td>
|
791
|
</tr>
|
792
|
<tr>
|
793
|
<td id=white>
|
794
|
<span class=tx> {</span></td>
|
795
|
<td id=sp>.</td>
|
796
|
<td id=white>
|
797
|
<span class=tx> {</span></td>
|
798
|
</tr>
|
799
|
<tr>
|
800
|
<td id=c>
|
801
|
<a name="change8"></a><span class=tx> this.queryId = queryId;</span></td>
|
802
|
<td id=sp>.</td>
|
803
|
<td id=c>
|
804
|
<span class=tx> _queryId = queryId;</span></td>
|
805
|
</tr>
|
806
|
<tr>
|
807
|
<td id=c>
|
808
|
<span class=tx> this.replacementMap = replacementMap;</span></td>
|
809
|
<td id=sp>.</td>
|
810
|
<td id=c>
|
811
|
<span class=tx> _replacementMap = replacementMap;</span></td>
|
812
|
</tr>
|
813
|
<tr>
|
814
|
<td id=white>
|
815
|
<span class=tx> try</span></td>
|
816
|
<td id=sp>.</td>
|
817
|
<td id=white>
|
818
|
<span class=tx> try</span></td>
|
819
|
</tr>
|
820
|
<tr>
|
821
|
<td id=white>
|
822
|
<span class=tx> {</span></td>
|
823
|
<td id=sp>.</td>
|
824
|
<td id=white>
|
825
|
<span class=tx> {</span></td>
|
826
|
</tr>
|
827
|
<tr>
|
828
|
<td id=white>
|
829
|
<span class=tx> generateQuery();</span></td>
|
830
|
<td id=sp>.</td>
|
831
|
<td id=white>
|
832
|
<span class=tx> generateQuery();</span></td>
|
833
|
</tr>
|
834
|
<tr>
|
835
|
<td id=white>
|
836
|
<span class=tx> }</span></td>
|
837
|
<td id=sp>.</td>
|
838
|
<td id=white>
|
839
|
<span class=tx> }</span></td>
|
840
|
</tr>
|
841
|
<tr>
|
842
|
<td id=white>
|
843
|
<span class=tx> catch(Exception e)</span></td>
|
844
|
<td id=sp>.</td>
|
845
|
<td id=white>
|
846
|
<span class=tx> catch(Exception e)</span></td>
|
847
|
</tr>
|
848
|
<tr><td id=sk>Skipping to line 92</td><td id=sp>.</td><td id=sk> </td></tr>
|
849
|
<tr>
|
850
|
<td id=white>
|
851
|
<span class=tx> * Method to get query which generate by this class</span></td>
|
852
|
<td id=sp>.</td>
|
853
|
<td id=white>
|
854
|
<span class=tx> * Method to get query which generate by this class</span></td>
|
855
|
</tr>
|
856
|
<tr>
|
857
|
<td id=white>
|
858
|
<span class=tx> * @return QueryType</span></td>
|
859
|
<td id=sp>.</td>
|
860
|
<td id=white>
|
861
|
<span class=tx> * @return QueryType</span></td>
|
862
|
</tr>
|
863
|
<tr>
|
864
|
<td id=white>
|
865
|
<span class=tx> */</span></td>
|
866
|
<td id=sp>.</td>
|
867
|
<td id=white>
|
868
|
<span class=tx> */</span></td>
|
869
|
</tr>
|
870
|
<tr>
|
871
|
<td id=white>
|
872
|
<span class=tx> public QueryType getQuery()</span></td>
|
873
|
<td id=sp>.</td>
|
874
|
<td id=white>
|
875
|
<span class=tx> public QueryType getQuery()</span></td>
|
876
|
</tr>
|
877
|
<tr>
|
878
|
<td id=white>
|
879
|
<span class=tx> {</span></td>
|
880
|
<td id=sp>.</td>
|
881
|
<td id=white>
|
882
|
<span class=tx> {</span></td>
|
883
|
</tr>
|
884
|
<tr>
|
885
|
<td id=c>
|
886
|
<a name="change9"></a><span class=tx> return this.query;</span></td>
|
887
|
<td id=sp>.</td>
|
888
|
<td id=c>
|
889
|
<span class=tx> return _query;</span></td>
|
890
|
</tr>
|
891
|
<tr>
|
892
|
<td id=white>
|
893
|
<span class=tx> }//getQuery</span></td>
|
894
|
<td id=sp>.</td>
|
895
|
<td id=white>
|
896
|
<span class=tx> }//getQuery</span></td>
|
897
|
</tr>
|
898
|
<tr>
|
899
|
<td id=white>
|
900
|
<span class=tx> </span></td>
|
901
|
<td id=sp>.</td>
|
902
|
<td id=white>
|
903
|
<span class=tx> </span></td>
|
904
|
</tr>
|
905
|
<tr>
|
906
|
<td id=a>
|
907
|
<a name="change10"></a><span class=tx> </span></td>
|
908
|
<td id=sp>.</td>
|
909
|
<td id=a>
|
910
|
<span class=tx> /**</span></td>
|
911
|
</tr>
|
912
|
<tr>
|
913
|
<td id=a>
|
914
|
<span class=tx> 
|
915
|
</span></td>
|
916
|
<td id=sp>.</td>
|
917
|
<td id=a>
|
918
|
<span class=tx> * Recursively walks the tree looking for Condition values inorder to subsit
|
919
|
ute in the search value</span></td>
|
920
|
</tr>
|
921
|
<tr>
|
922
|
<td id=a>
|
923
|
<span class=tx> </span></td>
|
924
|
<td id=sp>.</td>
|
925
|
<td id=a>
|
926
|
<span class=tx> * @param aNode the parent node</span></td>
|
927
|
</tr>
|
928
|
<tr>
|
929
|
<td id=a>
|
930
|
<span class=tx> 
|
931
|
</span></td>
|
932
|
<td id=sp>.</td>
|
933
|
<td id=a>
|
934
|
<span class=tx> * @param aIsChildCond indicates whether the current parent node is a Condit
|
935
|
ion node</span></td>
|
936
|
</tr>
|
937
|
<tr>
|
938
|
<td id=a>
|
939
|
<span class=tx> </span></td>
|
940
|
<td id=sp>.</td>
|
941
|
<td id=a>
|
942
|
<span class=tx> */</span></td>
|
943
|
</tr>
|
944
|
<tr>
|
945
|
<td id=a>
|
946
|
<span class=tx> </span></td>
|
947
|
<td id=sp>.</td>
|
948
|
<td id=a>
|
949
|
<span class=tx> private void mapInValue(Node aNode, boolean aIsChildCond)</span></td>
|
950
|
</tr>
|
951
|
<tr>
|
952
|
<td id=a>
|
953
|
<span class=tx> </span></td>
|
954
|
<td id=sp>.</td>
|
955
|
<td id=a>
|
956
|
<span class=tx> {</span></td>
|
957
|
</tr>
|
958
|
<tr>
|
959
|
<td id=a>
|
960
|
<span class=tx> </span></td>
|
961
|
<td id=sp>.</td>
|
962
|
<td id=a>
|
963
|
<span class=tx> NodeList childList = aNode.getChildNodes();</span></td>
|
964
|
</tr>
|
965
|
<tr>
|
966
|
<td id=a>
|
967
|
<span class=tx> </span></td>
|
968
|
<td id=sp>.</td>
|
969
|
<td id=a>
|
970
|
<span class=tx> if ( childList == null)</span></td>
|
971
|
</tr>
|
972
|
<tr>
|
973
|
<td id=a>
|
974
|
<span class=tx> </span></td>
|
975
|
<td id=sp>.</td>
|
976
|
<td id=a>
|
977
|
<span class=tx> {</span></td>
|
978
|
</tr>
|
979
|
<tr>
|
980
|
<td id=a>
|
981
|
<span class=tx> </span></td>
|
982
|
<td id=sp>.</td>
|
983
|
<td id=a>
|
984
|
<span class=tx> return;</span></td>
|
985
|
</tr>
|
986
|
<tr>
|
987
|
<td id=a>
|
988
|
<span class=tx> </span></td>
|
989
|
<td id=sp>.</td>
|
990
|
<td id=a>
|
991
|
<span class=tx> }</span></td>
|
992
|
</tr>
|
993
|
<tr>
|
994
|
<td id=a>
|
995
|
<span class=tx> </span></td>
|
996
|
<td id=sp>.</td>
|
997
|
<td id=a>
|
998
|
<span class=tx> </span></td>
|
999
|
</tr>
|
1000
|
<tr>
|
1001
|
<td id=a>
|
1002
|
<span class=tx> </span></td>
|
1003
|
<td id=sp>.</td>
|
1004
|
<td id=a>
|
1005
|
<span class=tx> // go through every child element</span></td>
|
1006
|
</tr>
|
1007
|
<tr>
|
1008
|
<td id=a>
|
1009
|
<span class=tx> </span></td>
|
1010
|
<td id=sp>.</td>
|
1011
|
<td id=a>
|
1012
|
<span class=tx> int length = childList.getLength();</span></td>
|
1013
|
</tr>
|
1014
|
<tr>
|
1015
|
<td id=a>
|
1016
|
<span class=tx> </span></td>
|
1017
|
<td id=sp>.</td>
|
1018
|
<td id=a>
|
1019
|
<span class=tx> for (int i=0; i<length; i++)</span></td>
|
1020
|
</tr>
|
1021
|
<tr>
|
1022
|
<td id=a>
|
1023
|
<span class=tx> </span></td>
|
1024
|
<td id=sp>.</td>
|
1025
|
<td id=a>
|
1026
|
<span class=tx> {</span></td>
|
1027
|
</tr>
|
1028
|
<tr>
|
1029
|
<td id=a>
|
1030
|
<span class=tx> </span></td>
|
1031
|
<td id=sp>.</td>
|
1032
|
<td id=a>
|
1033
|
<span class=tx> Node kid = childList.item(i);</span></td>
|
1034
|
</tr>
|
1035
|
<tr>
|
1036
|
<td id=a>
|
1037
|
<span class=tx> </span></td>
|
1038
|
<td id=sp>.</td>
|
1039
|
<td id=a>
|
1040
|
<span class=tx> if (kid.getNodeName().equals(CONDITION) || aIsChildCond)</span></td>
|
1041
|
</tr>
|
1042
|
<tr>
|
1043
|
<td id=a>
|
1044
|
<span class=tx> </span></td>
|
1045
|
<td id=sp>.</td>
|
1046
|
<td id=a>
|
1047
|
<span class=tx> {</span></td>
|
1048
|
</tr>
|
1049
|
<tr>
|
1050
|
<td id=a>
|
1051
|
<span class=tx> </span></td>
|
1052
|
<td id=sp>.</td>
|
1053
|
<td id=a>
|
1054
|
<span class=tx> String value = kid.getNodeValue();</span></td>
|
1055
|
</tr>
|
1056
|
<tr>
|
1057
|
<td id=a>
|
1058
|
<span class=tx> 
|
1059
|
</span></td>
|
1060
|
<td id=sp>.</td>
|
1061
|
<td id=a>
|
1062
|
<span class=tx> // replace the value by search value if this value in replacementMap</span></td>
|
1063
|
</tr>
|
1064
|
<tr>
|
1065
|
<td id=a>
|
1066
|
<span class=tx> </span></td>
|
1067
|
<td id=sp>.</td>
|
1068
|
<td id=a>
|
1069
|
<span class=tx> if (value != null && _replacementMap.containsKey(value))</span></td>
|
1070
|
</tr>
|
1071
|
<tr>
|
1072
|
<td id=a>
|
1073
|
<span class=tx> </span></td>
|
1074
|
<td id=sp>.</td>
|
1075
|
<td id=a>
|
1076
|
<span class=tx> {</span></td>
|
1077
|
</tr>
|
1078
|
<tr>
|
1079
|
<td id=a>
|
1080
|
<span class=tx> </span></td>
|
1081
|
<td id=sp>.</td>
|
1082
|
<td id=a>
|
1083
|
<span class=tx> value = (String)_replacementMap.get(value);</span></td>
|
1084
|
</tr>
|
1085
|
<tr>
|
1086
|
<td id=a>
|
1087
|
<span class=tx> </span></td>
|
1088
|
<td id=sp>.</td>
|
1089
|
<td id=a>
|
1090
|
<span class=tx> kid.setNodeValue(value);</span></td>
|
1091
|
</tr>
|
1092
|
<tr>
|
1093
|
<td id=a>
|
1094
|
<span class=tx> </span></td>
|
1095
|
<td id=sp>.</td>
|
1096
|
<td id=a>
|
1097
|
<span class=tx> } </span></td>
|
1098
|
</tr>
|
1099
|
<tr>
|
1100
|
<td id=a>
|
1101
|
<span class=tx> </span></td>
|
1102
|
<td id=sp>.</td>
|
1103
|
<td id=a>
|
1104
|
<span class=tx> else </span></td>
|
1105
|
</tr>
|
1106
|
<tr>
|
1107
|
<td id=a>
|
1108
|
<span class=tx> </span></td>
|
1109
|
<td id=sp>.</td>
|
1110
|
<td id=a>
|
1111
|
<span class=tx> {</span></td>
|
1112
|
</tr>
|
1113
|
<tr>
|
1114
|
<td id=a>
|
1115
|
<span class=tx> </span></td>
|
1116
|
<td id=sp>.</td>
|
1117
|
<td id=a>
|
1118
|
<span class=tx> mapInValue(kid, true);</span></td>
|
1119
|
</tr>
|
1120
|
<tr>
|
1121
|
<td id=a>
|
1122
|
<span class=tx> </span></td>
|
1123
|
<td id=sp>.</td>
|
1124
|
<td id=a>
|
1125
|
<span class=tx> }</span></td>
|
1126
|
</tr>
|
1127
|
<tr>
|
1128
|
<td id=a>
|
1129
|
<span class=tx> </span></td>
|
1130
|
<td id=sp>.</td>
|
1131
|
<td id=a>
|
1132
|
<span class=tx> }</span></td>
|
1133
|
</tr>
|
1134
|
<tr>
|
1135
|
<td id=a>
|
1136
|
<span class=tx> </span></td>
|
1137
|
<td id=sp>.</td>
|
1138
|
<td id=a>
|
1139
|
<span class=tx> else</span></td>
|
1140
|
</tr>
|
1141
|
<tr>
|
1142
|
<td id=a>
|
1143
|
<span class=tx> </span></td>
|
1144
|
<td id=sp>.</td>
|
1145
|
<td id=a>
|
1146
|
<span class=tx> {</span></td>
|
1147
|
</tr>
|
1148
|
<tr>
|
1149
|
<td id=a>
|
1150
|
<span class=tx> </span></td>
|
1151
|
<td id=sp>.</td>
|
1152
|
<td id=a>
|
1153
|
<span class=tx> mapInValue(kid, false);</span></td>
|
1154
|
</tr>
|
1155
|
<tr>
|
1156
|
<td id=a>
|
1157
|
<span class=tx> </span></td>
|
1158
|
<td id=sp>.</td>
|
1159
|
<td id=a>
|
1160
|
<span class=tx> }</span></td>
|
1161
|
</tr>
|
1162
|
<tr>
|
1163
|
<td id=a>
|
1164
|
<span class=tx> </span></td>
|
1165
|
<td id=sp>.</td>
|
1166
|
<td id=a>
|
1167
|
<span class=tx> }</span></td>
|
1168
|
</tr>
|
1169
|
<tr>
|
1170
|
<td id=a>
|
1171
|
<span class=tx> </span></td>
|
1172
|
<td id=sp>.</td>
|
1173
|
<td id=a>
|
1174
|
<span class=tx> }</span></td>
|
1175
|
</tr>
|
1176
|
<tr>
|
1177
|
<td id=a>
|
1178
|
<span class=tx> </span></td>
|
1179
|
<td id=sp>.</td>
|
1180
|
<td id=a>
|
1181
|
<span class=tx> </span></td>
|
1182
|
</tr>
|
1183
|
<tr>
|
1184
|
<td id=white>
|
1185
|
<span class=tx> /*</span></td>
|
1186
|
<td id=sp>.</td>
|
1187
|
<td id=white>
|
1188
|
<span class=tx> /*</span></td>
|
1189
|
</tr>
|
1190
|
<tr>
|
1191
|
<td id=white>
|
1192
|
<span class=tx> * Method to read config file and generate a query(It will chose the first o
|
1193
|
ne</span></td>
|
1194
|
<td id=sp>.</td>
|
1195
|
<td id=white>
|
1196
|
<span class=tx> * Method to read config file and generate a query(It will chose the first o
|
1197
|
ne</span></td>
|
1198
|
</tr>
|
1199
|
<tr>
|
1200
|
<td id=white>
|
1201
|
<span class=tx> * if it has more than one in configure file)</span></td>
|
1202
|
<td id=sp>.</td>
|
1203
|
<td id=white>
|
1204
|
<span class=tx> * if it has more than one in configure file)</span></td>
|
1205
|
</tr>
|
1206
|
<tr>
|
1207
|
<td id=white>
|
1208
|
<span class=tx> */</span></td>
|
1209
|
<td id=sp>.</td>
|
1210
|
<td id=white>
|
1211
|
<span class=tx> */</span></td>
|
1212
|
</tr>
|
1213
|
<tr>
|
1214
|
<td id=white>
|
1215
|
<span class=tx> private void generateQuery() throws URI.MalformedURIException, </span></td>
|
1216
|
<td id=sp>.</td>
|
1217
|
<td id=white>
|
1218
|
<span class=tx> private void generateQuery() throws URI.MalformedURIException, </span></td>
|
1219
|
</tr>
|
1220
|
<tr><td id=sk>Skipping to line 145</td><td id=sp>.</td><td id=sk> </td></tr>
|
1221
|
<tr>
|
1222
|
<td id=white>
|
1223
|
<span class=tx> InvalidEcogridQueryException</span></td>
|
1224
|
<td id=sp>.</td>
|
1225
|
<td id=white>
|
1226
|
<span class=tx> InvalidEcogridQueryException</span></td>
|
1227
|
</tr>
|
1228
|
<tr>
|
1229
|
<td id=white>
|
1230
|
<span class=tx> {</span></td>
|
1231
|
<td id=sp>.</td>
|
1232
|
<td id=white>
|
1233
|
<span class=tx> {</span></td>
|
1234
|
</tr>
|
1235
|
<tr>
|
1236
|
<td id=c>
|
1237
|
<a name="change11"></a><span class=tx> String xpath = QUERYPATH + queryId+ "']";</span></td>
|
1238
|
<td id=sp>.</td>
|
1239
|
<td id=c>
|
1240
|
<span class=tx> String xpath = QUERYPATH + _queryId+ "']";</span></td>
|
1241
|
</tr>
|
1242
|
<tr>
|
1243
|
<td id=white>
|
1244
|
<span class=tx> Node queryNode = null;</span></td>
|
1245
|
<td id=sp>.</td>
|
1246
|
<td id=white>
|
1247
|
<span class=tx> Node queryNode = null;</span></td>
|
1248
|
</tr>
|
1249
|
<tr>
|
1250
|
<td id=c>
|
1251
|
<a name="change12"></a><span class=tx> NodeList list = Config.getNodeListFromPath(xpath);</span></td>
|
1252
|
<td id=sp>.</td>
|
1253
|
<td id=c>
|
1254
|
<span class=tx> NodeList list = Config.getNodeListFromPath(xpath);</span></td>
|
1255
|
</tr>
|
1256
|
<tr>
|
1257
|
<td id=white>
|
1258
|
<span class=tx> if (list == null)</span></td>
|
1259
|
<td id=sp>.</td>
|
1260
|
<td id=white>
|
1261
|
<span class=tx> if (list == null)</span></td>
|
1262
|
</tr>
|
1263
|
<tr>
|
1264
|
<td id=white>
|
1265
|
<span class=tx> {</span></td>
|
1266
|
<td id=sp>.</td>
|
1267
|
<td id=white>
|
1268
|
<span class=tx> {</span></td>
|
1269
|
</tr>
|
1270
|
<tr>
|
1271
|
<td id=white>
|
1272
|
<span class=tx> return;</span></td>
|
1273
|
<td id=sp>.</td>
|
1274
|
<td id=white>
|
1275
|
<span class=tx> return;</span></td>
|
1276
|
</tr>
|
1277
|
<tr>
|
1278
|
<td id=white>
|
1279
|
<span class=tx> }</span></td>
|
1280
|
<td id=sp>.</td>
|
1281
|
<td id=white>
|
1282
|
<span class=tx> }</span></td>
|
1283
|
</tr>
|
1284
|
<tr>
|
1285
|
<td id=a>
|
1286
|
<a name="change13"></a><span class=tx> </span></td>
|
1287
|
<td id=sp>.</td>
|
1288
|
<td id=a>
|
1289
|
<span class=tx> </span></td>
|
1290
|
</tr>
|
1291
|
<tr>
|
1292
|
<td id=white>
|
1293
|
<span class=tx> // chose first query</span></td>
|
1294
|
<td id=sp>.</td>
|
1295
|
<td id=white>
|
1296
|
<span class=tx> // chose first query</span></td>
|
1297
|
</tr>
|
1298
|
<tr>
|
1299
|
<td id=white>
|
1300
|
<span class=tx> queryNode = list.item(0);</span></td>
|
1301
|
<td id=sp>.</td>
|
1302
|
<td id=white>
|
1303
|
<span class=tx> queryNode = list.item(0);</span></td>
|
1304
|
</tr>
|
1305
|
<tr>
|
1306
|
<td id=d>
|
1307
|
<a name="change14"></a><span class=tx> //set query attributes</span></td>
|
1308
|
<td id=sp>.</td>
|
1309
|
<td id=d>
|
1310
|
<span class=tx> </span></td>
|
1311
|
</tr>
|
1312
|
<tr>
|
1313
|
<td id=d>
|
1314
|
<span class=tx> setQuerySystem(queryNode);</span></td>
|
1315
|
<td id=sp>.</td>
|
1316
|
<td id=d>
|
1317
|
<span class=tx> </span></td>
|
1318
|
</tr>
|
1319
|
<tr>
|
1320
|
<td id=d>
|
1321
|
<span class=tx> setQueryId();</span></td>
|
1322
|
<td id=sp>.</td>
|
1323
|
<td id=d>
|
1324
|
<span class=tx> </span></td>
|
1325
|
</tr>
|
1326
|
<tr>
|
1327
|
<td id=d>
|
1328
|
<span class=tx> </span></td>
|
1329
|
<td id=sp>.</td>
|
1330
|
<td id=d>
|
1331
|
<span class=tx> </span></td>
|
1332
|
</tr>
|
1333
|
<tr>
|
1334
|
<td id=white>
|
1335
|
<span class=tx> NodeList queryChildrenList = queryNode.getChildNodes();</span></td>
|
1336
|
<td id=sp>.</td>
|
1337
|
<td id=white>
|
1338
|
<span class=tx> NodeList queryChildrenList = queryNode.getChildNodes();</span></td>
|
1339
|
</tr>
|
1340
|
<tr>
|
1341
|
<td id=white>
|
1342
|
<span class=tx> if ( queryChildrenList == null)</span></td>
|
1343
|
<td id=sp>.</td>
|
1344
|
<td id=white>
|
1345
|
<span class=tx> if ( queryChildrenList == null)</span></td>
|
1346
|
</tr>
|
1347
|
<tr>
|
1348
|
<td id=white>
|
1349
|
<span class=tx> {</span></td>
|
1350
|
<td id=sp>.</td>
|
1351
|
<td id=white>
|
1352
|
<span class=tx> {</span></td>
|
1353
|
</tr>
|
1354
|
<tr>
|
1355
|
<td id=white>
|
1356
|
<span class=tx> return;</span></td>
|
1357
|
<td id=sp>.</td>
|
1358
|
<td id=white>
|
1359
|
<span class=tx> return;</span></td>
|
1360
|
</tr>
|
1361
|
<tr>
|
1362
|
<td id=white>
|
1363
|
<span class=tx> }</span></td>
|
1364
|
<td id=sp>.</td>
|
1365
|
<td id=white>
|
1366
|
<span class=tx> }</span></td>
|
1367
|
</tr>
|
1368
|
<tr>
|
1369
|
<td id=c>
|
1370
|
<a name="change15"></a><span class=tx> int length = queryChildrenList.getLength();</span></td>
|
1371
|
<td id=sp>.</td>
|
1372
|
<td id=c>
|
1373
|
<span class=tx> mapInValue(queryNode, false);</span></td>
|
1374
|
</tr>
|
1375
|
<tr>
|
1376
|
<td id=c>
|
1377
|
<span class=tx> // go through every child element</span></td>
|
1378
|
<td id=sp>.</td>
|
1379
|
<td id=c>
|
1380
|
<span class=tx> </span></td>
|
1381
|
</tr>
|
1382
|
<tr>
|
1383
|
<td id=c>
|
1384
|
<span class=tx> for (int i=0; i<length; i++)</span></td>
|
1385
|
<td id=sp>.</td>
|
1386
|
<td id=c>
|
1387
|
<span class=tx> </span></td>
|
1388
|
</tr>
|
1389
|
<tr>
|
1390
|
<td id=c>
|
1391
|
<span class=tx> {</span></td>
|
1392
|
<td id=sp>.</td>
|
1393
|
<td id=c>
|
1394
|
<span class=tx> </span></td>
|
1395
|
</tr>
|
1396
|
<tr>
|
1397
|
<td id=c>
|
1398
|
<span class=tx> Node kid = queryChildrenList.item(i);</span></td>
|
1399
|
<td id=sp>.</td>
|
1400
|
<td id=c>
|
1401
|
<span class=tx> </span></td>
|
1402
|
</tr>
|
1403
|
<tr>
|
1404
|
<td id=c>
|
1405
|
<span class=tx> if (kid !=null && kid.getNodeType() ==Node.ELEMENT_NODE)</span></td>
|
1406
|
<td id=sp>.</td>
|
1407
|
<td id=c>
|
1408
|
<span class=tx> </span></td>
|
1409
|
</tr>
|
1410
|
<tr>
|
1411
|
<td id=c>
|
1412
|
<span class=tx> {</span></td>
|
1413
|
<td id=sp>.</td>
|
1414
|
<td id=c>
|
1415
|
<span class=tx> </span></td>
|
1416
|
</tr>
|
1417
|
<tr>
|
1418
|
<td id=c>
|
1419
|
<span class=tx> if (kid.getNodeName() != null && kid.getNodeName().equals(NAMESPACE))</span></td>
|
1420
|
<td id=sp>.</td>
|
1421
|
<td id=c>
|
1422
|
<span class=tx> </span></td>
|
1423
|
</tr>
|
1424
|
<tr>
|
1425
|
<td id=c>
|
1426
|
<span class=tx> {</span></td>
|
1427
|
<td id=sp>.</td>
|
1428
|
<td id=c>
|
1429
|
<span class=tx> </span></td>
|
1430
|
</tr>
|
1431
|
<tr>
|
1432
|
<td id=c>
|
1433
|
<span class=tx> setQueryNamespace(kid);</span></td>
|
1434
|
<td id=sp>.</td>
|
1435
|
<td id=c>
|
1436
|
<span class=tx> </span></td>
|
1437
|
</tr>
|
1438
|
<tr>
|
1439
|
<td id=c>
|
1440
|
<span class=tx> }//namespace</span></td>
|
1441
|
<td id=sp>.</td>
|
1442
|
<td id=c>
|
1443
|
<span class=tx> </span></td>
|
1444
|
</tr>
|
1445
|
<tr>
|
1446
|
<td id=c>
|
1447
|
<span class=tx> else if (kid.getNodeName() != null && kid.getNodeName().equals(TITLE))</span></td>
|
1448
|
<td id=sp>.</td>
|
1449
|
<td id=c>
|
1450
|
<span class=tx> 
|
1451
|
</span></td>
|
1452
|
</tr>
|
1453
|
<tr>
|
1454
|
<td id=c>
|
1455
|
<span class=tx> {</span></td>
|
1456
|
<td id=sp>.</td>
|
1457
|
<td id=c>
|
1458
|
<span class=tx> </span></td>
|
1459
|
</tr>
|
1460
|
<tr>
|
1461
|
<td id=c>
|
1462
|
<span class=tx> setQueryTitle(kid);</span></td>
|
1463
|
<td id=sp>.</td>
|
1464
|
<td id=c>
|
1465
|
<span class=tx> </span></td>
|
1466
|
</tr>
|
1467
|
<tr>
|
1468
|
<td id=c>
|
1469
|
<span class=tx> }//title</span></td>
|
1470
|
<td id=sp>.</td>
|
1471
|
<td id=c>
|
1472
|
<span class=tx> </span></td>
|
1473
|
</tr>
|
1474
|
<tr>
|
1475
|
<td id=c>
|
1476
|
<span class=tx> else if (kid.getNodeName() != null && kid.getNodeName().equals(RETURNF
|
1477
|
IELD))</span></td>
|
1478
|
<td id=sp>.</td>
|
1479
|
<td id=c>
|
1480
|
<span class=tx> 
|
1481
|
</span></td>
|
1482
|
</tr>
|
1483
|
<tr>
|
1484
|
<td id=c>
|
1485
|
<span class=tx> {</span></td>
|
1486
|
<td id=sp>.</td>
|
1487
|
<td id=c>
|
1488
|
<span class=tx> </span></td>
|
1489
|
</tr>
|
1490
|
<tr>
|
1491
|
<td id=c>
|
1492
|
<span class=tx> putReturnFieldIntoVector(kid);</span></td>
|
1493
|
<td id=sp>.</td>
|
1494
|
<td id=c>
|
1495
|
<span class=tx> </span></td>
|
1496
|
</tr>
|
1497
|
<tr>
|
1498
|
<td id=c>
|
1499
|
<span class=tx> }//returnfield</span></td>
|
1500
|
<td id=sp>.</td>
|
1501
|
<td id=c>
|
1502
|
<span class=tx> </span></td>
|
1503
|
</tr>
|
1504
|
<tr>
|
1505
|
<td id=c>
|
1506
|
<span class=tx> else if (kid.getNodeName() != null && kid.getNodeName().equals(AND))</span></td>
|
1507
|
<td id=sp>.</td>
|
1508
|
<td id=c>
|
1509
|
<span class=tx> </span></td>
|
1510
|
</tr>
|
1511
|
<tr>
|
1512
|
<td id=c>
|
1513
|
<span class=tx> {</span></td>
|
1514
|
<td id=sp>.</td>
|
1515
|
<td id=c>
|
1516
|
<span class=tx> </span></td>
|
1517
|
</tr>
|
1518
|
<tr>
|
1519
|
<td id=c>
|
1520
|
<span class=tx> ANDType topAnd = new ANDType();</span></td>
|
1521
|
<td id=sp>.</td>
|
1522
|
<td id=c>
|
1523
|
<span class=tx> </span></td>
|
1524
|
</tr>
|
1525
|
<tr>
|
1526
|
<td id=c>
|
1527
|
<span class=tx> setQueryANDType(kid,topAnd);</span></td>
|
1528
|
<td id=sp>.</td>
|
1529
|
<td id=c>
|
1530
|
<span class=tx> </span></td>
|
1531
|
</tr>
|
1532
|
<tr>
|
1533
|
<td id=c>
|
1534
|
<span class=tx> dbg.print("In top AND", 2);</span></td>
|
1535
|
<td id=sp>.</td>
|
1536
|
<td id=c>
|
1537
|
<span class=tx> </span></td>
|
1538
|
</tr>
|
1539
|
<tr>
|
1540
|
<td id=c>
|
1541
|
<span class=tx> query.setAND(topAnd);</span></td>
|
1542
|
<td id=sp>.</td>
|
1543
|
<td id=c>
|
1544
|
<span class=tx> </span></td>
|
1545
|
</tr>
|
1546
|
<tr>
|
1547
|
<td id=c>
|
1548
|
<span class=tx> }//AND</span></td>
|
1549
|
<td id=sp>.</td>
|
1550
|
<td id=c>
|
1551
|
<span class=tx> </span></td>
|
1552
|
</tr>
|
1553
|
<tr>
|
1554
|
<td id=c>
|
1555
|
<span class=tx> else if (kid.getNodeName() != null && kid.getNodeName().equals(OR))</span></td>
|
1556
|
<td id=sp>.</td>
|
1557
|
<td id=c>
|
1558
|
<span class=tx> </span></td>
|
1559
|
</tr>
|
1560
|
<tr>
|
1561
|
<td id=c>
|
1562
|
<span class=tx> {</span></td>
|
1563
|
<td id=sp>.</td>
|
1564
|
<td id=c>
|
1565
|
<span class=tx> </span></td>
|
1566
|
</tr>
|
1567
|
<tr>
|
1568
|
<td id=c>
|
1569
|
<span class=tx> ORType topOr = new ORType();</span></td>
|
1570
|
<td id=sp>.</td>
|
1571
|
<td id=c>
|
1572
|
<span class=tx> </span></td>
|
1573
|
</tr>
|
1574
|
<tr>
|
1575
|
<td id=c>
|
1576
|
<span class=tx> setQueryORType(kid, topOr);</span></td>
|
1577
|
<td id=sp>.</td>
|
1578
|
<td id=c>
|
1579
|
<span class=tx> </span></td>
|
1580
|
</tr>
|
1581
|
<tr>
|
1582
|
<td id=c>
|
1583
|
<span class=tx> dbg.print("In top OR", 2);</span></td>
|
1584
|
<td id=sp>.</td>
|
1585
|
<td id=c>
|
1586
|
<span class=tx> </span></td>
|
1587
|
</tr>
|
1588
|
<tr>
|
1589
|
<td id=c>
|
1590
|
<span class=tx> query.setOR(topOr);</span></td>
|
1591
|
<td id=sp>.</td>
|
1592
|
<td id=c>
|
1593
|
<span class=tx> </span></td>
|
1594
|
</tr>
|
1595
|
<tr>
|
1596
|
<td id=c>
|
1597
|
<span class=tx> }//OR</span></td>
|
1598
|
<td id=sp>.</td>
|
1599
|
<td id=c>
|
1600
|
<span class=tx> </span></td>
|
1601
|
</tr>
|
1602
|
<tr>
|
1603
|
<td id=c>
|
1604
|
<span class=tx> else if (kid.getNodeName() != null && kid.getNodeName().equals(CONDITI
|
1605
|
ON))</span></td>
|
1606
|
<td id=sp>.</td>
|
1607
|
<td id=c>
|
1608
|
<span class=tx> 
|
1609
|
</span></td>
|
1610
|
</tr>
|
1611
|
<tr>
|
1612
|
<td id=c>
|
1613
|
<span class=tx> {</span></td>
|
1614
|
<td id=sp>.</td>
|
1615
|
<td id=c>
|
1616
|
<span class=tx> </span></td>
|
1617
|
</tr>
|
1618
|
<tr>
|
1619
|
<td id=c>
|
1620
|
<span class=tx> ConditionType topCondition = setQueryConditionType(kid);</span></td>
|
1621
|
<td id=sp>.</td>
|
1622
|
<td id=c>
|
1623
|
<span class=tx> </span></td>
|
1624
|
</tr>
|
1625
|
<tr>
|
1626
|
<td id=c>
|
1627
|
<span class=tx> dbg.print("In top condtion", 2);</span></td>
|
1628
|
<td id=sp>.</td>
|
1629
|
<td id=c>
|
1630
|
<span class=tx> </span></td>
|
1631
|
</tr>
|
1632
|
<tr>
|
1633
|
<td id=c>
|
1634
|
<span class=tx> query.setCondition(topCondition);</span></td>
|
1635
|
<td id=sp>.</td>
|
1636
|
<td id=c>
|
1637
|
<span class=tx> </span></td>
|
1638
|
</tr>
|
1639
|
<tr>
|
1640
|
<td id=c>
|
1641
|
<span class=tx> }//condition</span></td>
|
1642
|
<td id=sp>.</td>
|
1643
|
<td id=c>
|
1644
|
<span class=tx> </span></td>
|
1645
|
</tr>
|
1646
|
<tr>
|
1647
|
<td id=c>
|
1648
|
<span class=tx> }//if</span></td>
|
1649
|
<td id=sp>.</td>
|
1650
|
<td id=c>
|
1651
|
<span class=tx> </span></td>
|
1652
|
</tr>
|
1653
|
<tr>
|
1654
|
<td id=c>
|
1655
|
<span class=tx> }//for</span></td>
|
1656
|
<td id=sp>.</td>
|
1657
|
<td id=c>
|
1658
|
<span class=tx> </span></td>
|
1659
|
</tr>
|
1660
|
<tr>
|
1661
|
<td id=c>
|
1662
|
<span class=tx> //put vector of return fields into array and set it to query</span></td>
|
1663
|
<td id=sp>.</td>
|
1664
|
<td id=c>
|
1665
|
<span class=tx> </span></td>
|
1666
|
</tr>
|
1667
|
<tr>
|
1668
|
<td id=c>
|
1669
|
<span class=tx> setQueryReturnField();</span></td>
|
1670
|
<td id=sp>.</td>
|
1671
|
<td id=c>
|
1672
|
<span class=tx> </span></td>
|
1673
|
</tr>
|
1674
|
<tr>
|
1675
|
<td id=c>
|
1676
|
<span class=tx> }//generateQuery</span></td>
|
1677
|
<td id=sp>.</td>
|
1678
|
<td id=c>
|
1679
|
<span class=tx> </span></td>
|
1680
|
</tr>
|
1681
|
<tr>
|
1682
|
<td id=c>
|
1683
|
<span class=tx> </span></td>
|
1684
|
<td id=sp>.</td>
|
1685
|
<td id=c>
|
1686
|
<span class=tx> </span></td>
|
1687
|
</tr>
|
1688
|
<tr>
|
1689
|
<td id=c>
|
1690
|
<span class=tx> /*</span></td>
|
1691
|
<td id=sp>.</td>
|
1692
|
<td id=c>
|
1693
|
<span class=tx> </span></td>
|
1694
|
</tr>
|
1695
|
<tr>
|
1696
|
<td id=c>
|
1697
|
<span class=tx> * Method to set query namesapce</span></td>
|
1698
|
<td id=sp>.</td>
|
1699
|
<td id=c>
|
1700
|
<span class=tx> </span></td>
|
1701
|
</tr>
|
1702
|
<tr>
|
1703
|
<td id=c>
|
1704
|
<span class=tx> */</span></td>
|
1705
|
<td id=sp>.</td>
|
1706
|
<td id=c>
|
1707
|
<span class=tx> </span></td>
|
1708
|
</tr>
|
1709
|
<tr>
|
1710
|
<td id=c>
|
1711
|
<span class=tx> private void setQueryNamespace(Node node) throws URI.MalformedURIException</span></td>
|
1712
|
<td id=sp>.</td>
|
1713
|
<td id=c>
|
1714
|
<span class=tx> </span></td>
|
1715
|
</tr>
|
1716
|
<tr>
|
1717
|
<td id=c>
|
1718
|
<span class=tx> {</span></td>
|
1719
|
<td id=sp>.</td>
|
1720
|
<td id=c>
|
1721
|
<span class=tx> </span></td>
|
1722
|
</tr>
|
1723
|
<tr>
|
1724
|
<td id=c>
|
1725
|
<span class=tx> Node value = node.getFirstChild();</span></td>
|
1726
|
<td id=sp>.</td>
|
1727
|
<td id=c>
|
1728
|
<span class=tx> </span></td>
|
1729
|
</tr>
|
1730
|
<tr>
|
1731
|
<td id=c>
|
1732
|
<span class=tx> if (value.getNodeType() == Node.TEXT_NODE)</span></td>
|
1733
|
<td id=sp>.</td>
|
1734
|
<td id=c>
|
1735
|
<span class=tx> </span></td>
|
1736
|
</tr>
|
1737
|
<tr>
|
1738
|
<td id=c>
|
1739
|
<span class=tx> {</span></td>
|
1740
|
<td id=sp>.</td>
|
1741
|
<td id=c>
|
1742
|
<span class=tx> </span></td>
|
1743
|
</tr>
|
1744
|
<tr>
|
1745
|
<td id=c>
|
1746
|
<span class=tx> String namespaceStr = value.getNodeValue();</span></td>
|
1747
|
<td id=sp>.</td>
|
1748
|
<td id=c>
|
1749
|
<span class=tx> </span></td>
|
1750
|
</tr>
|
1751
|
<tr>
|
1752
|
<td id=c>
|
1753
|
<span class=tx> URI namespaceURI = new URI(namespaceStr);</span></td>
|
1754
|
<td id=sp>.</td>
|
1755
|
<td id=c>
|
1756
|
<span class=tx> </span></td>
|
1757
|
</tr>
|
1758
|
<tr>
|
1759
|
<td id=c>
|
1760
|
<span class=tx> dbg.print("The ecogrid query search namespace is " + </span></td>
|
1761
|
<td id=sp>.</td>
|
1762
|
<td id=c>
|
1763
|
<span class=tx> </span></td>
|
1764
|
</tr>
|
1765
|
<tr>
|
1766
|
<td id=c>
|
1767
|
<span class=tx> namespaceURI.toString(), 2);</span></td>
|
1768
|
<td id=sp>.</td>
|
1769
|
<td id=c>
|
1770
|
<span class=tx> </span></td>
|
1771
|
</tr>
|
1772
|
<tr>
|
1773
|
<td id=c>
|
1774
|
<span class=tx> QueryType_namespace namespaceQuery = new QueryType_namespace(namespaceUR
|
1775
|
I);</span></td>
|
1776
|
<td id=sp>.</td>
|
1777
|
<td id=c>
|
1778
|
<span class=tx> 
|
1779
|
</span></td>
|
1780
|
</tr>
|
1781
|
<tr>
|
1782
|
<td id=c>
|
1783
|
<span class=tx> QueryType_namespace[] namespaceArray = </span></td>
|
1784
|
<td id=sp>.</td>
|
1785
|
<td id=c>
|
1786
|
<span class=tx> </span></td>
|
1787
|
</tr>
|
1788
|
<tr>
|
1789
|
<td id=c>
|
1790
|
<span class=tx> new QueryType_namespace[NAMESPACEARRAYLENGTH
|
1791
|
];</span></td>
|
1792
|
<td id=sp>.</td>
|
1793
|
<td id=c>
|
1794
|
<span class=tx> 
|
1795
|
</span></td>
|
1796
|
</tr>
|
1797
|
<tr>
|
1798
|
<td id=c>
|
1799
|
<span class=tx> namespaceArray[0]= namespaceQuery;</span></td>
|
1800
|
<td id=sp>.</td>
|
1801
|
<td id=c>
|
1802
|
<span class=tx> </span></td>
|
1803
|
</tr>
|
1804
|
<tr>
|
1805
|
<td id=c>
|
1806
|
<span class=tx> query.setNamespace(namespaceArray);</span></td>
|
1807
|
<td id=sp>.</td>
|
1808
|
<td id=c>
|
1809
|
<span class=tx> </span></td>
|
1810
|
</tr>
|
1811
|
<tr>
|
1812
|
<td id=c>
|
1813
|
<span class=tx> }//if</span></td>
|
1814
|
<td id=sp>.</td>
|
1815
|
<td id=c>
|
1816
|
<span class=tx> </span></td>
|
1817
|
</tr>
|
1818
|
<tr>
|
1819
|
<td id=c>
|
1820
|
<span class=tx> }//setQuerynamespace</span></td>
|
1821
|
<td id=sp>.</td>
|
1822
|
<td id=c>
|
1823
|
<span class=tx> </span></td>
|
1824
|
</tr>
|
1825
|
<tr>
|
1826
|
<td id=c>
|
1827
|
<span class=tx> </span></td>
|
1828
|
<td id=sp>.</td>
|
1829
|
<td id=c>
|
1830
|
<span class=tx> </span></td>
|
1831
|
</tr>
|
1832
|
<tr>
|
1833
|
<td id=c>
|
1834
|
<span class=tx> /*</span></td>
|
1835
|
<td id=sp>.</td>
|
1836
|
<td id=c>
|
1837
|
<span class=tx> </span></td>
|
1838
|
</tr>
|
1839
|
<tr>
|
1840
|
<td id=c>
|
1841
|
<span class=tx> * Method to set query system</span></td>
|
1842
|
<td id=sp>.</td>
|
1843
|
<td id=c>
|
1844
|
<span class=tx> </span></td>
|
1845
|
</tr>
|
1846
|
<tr>
|
1847
|
<td id=c>
|
1848
|
<span class=tx> */</span></td>
|
1849
|
<td id=sp>.</td>
|
1850
|
<td id=c>
|
1851
|
<span class=tx> </span></td>
|
1852
|
</tr>
|
1853
|
<tr>
|
1854
|
<td id=c>
|
1855
|
<span class=tx> private void setQuerySystem(Node node) throws URI.MalformedURIException </span></td>
|
1856
|
<td id=sp>.</td>
|
1857
|
<td id=c>
|
1858
|
<span class=tx> </span></td>
|
1859
|
</tr>
|
1860
|
<tr>
|
1861
|
<td id=c>
|
1862
|
<span class=tx> {</span></td>
|
1863
|
<td id=sp>.</td>
|
1864
|
<td id=c>
|
1865
|
<span class=tx> </span></td>
|
1866
|
</tr>
|
1867
|
<tr>
|
1868
|
<td id=c>
|
1869
|
<span class=tx> NamedNodeMap attributes = node.getAttributes();</span></td>
|
1870
|
<td id=sp>.</td>
|
1871
|
<td id=c>
|
1872
|
<span class=tx> </span></td>
|
1873
|
</tr>
|
1874
|
<tr>
|
1875
|
<td id=c>
|
1876
|
<span class=tx> Node system = attributes.getNamedItem(SYSTEM);</span></td>
|
1877
|
<td id=sp>.</td>
|
1878
|
<td id=c>
|
1879
|
<span class=tx> </span></td>
|
1880
|
</tr>
|
1881
|
<tr>
|
1882
|
<td id=c>
|
1883
|
<span class=tx> String systemStr = system.getNodeValue();</span></td>
|
1884
|
<td id=sp>.</td>
|
1885
|
<td id=c>
|
1886
|
<span class=tx> </span></td>
|
1887
|
</tr>
|
1888
|
<tr>
|
1889
|
<td id=c>
|
1890
|
<span class=tx> URI systemURI = null;</span></td>
|
1891
|
<td id=sp>.</td>
|
1892
|
<td id=c>
|
1893
|
<span class=tx> </span></td>
|
1894
|
</tr>
|
1895
|
<tr>
|
1896
|
<td id=c>
|
1897
|
<span class=tx> systemURI = new URI(systemStr);</span></td>
|
1898
|
<td id=sp>.</td>
|
1899
|
<td id=c>
|
1900
|
<span class=tx> </span></td>
|
1901
|
</tr>
|
1902
|
<tr>
|
1903
|
<td id=c>
|
1904
|
<span class=tx> dbg.print("The ecogrid query system is " + systemURI.toString(), 2);</span></td>
|
1905
|
<td id=sp>.</td>
|
1906
|
<td id=c>
|
1907
|
<span class=tx> </span></td>
|
1908
|
</tr>
|
1909
|
<tr>
|
1910
|
<td id=c>
|
1911
|
<span class=tx> query.setSystem(systemURI);</span></td>
|
1912
|
<td id=sp>.</td>
|
1913
|
<td id=c>
|
1914
|
<span class=tx> </span></td>
|
1915
|
</tr>
|
1916
|
<tr>
|
1917
|
<td id=c>
|
1918
|
<span class=tx> }//setQuerySystem</span></td>
|
1919
|
<td id=sp>.</td>
|
1920
|
<td id=c>
|
1921
|
<span class=tx> </span></td>
|
1922
|
</tr>
|
1923
|
<tr>
|
1924
|
<td id=c>
|
1925
|
<span class=tx> </span></td>
|
1926
|
<td id=sp>.</td>
|
1927
|
<td id=c>
|
1928
|
<span class=tx> </span></td>
|
1929
|
</tr>
|
1930
|
<tr>
|
1931
|
<td id=c>
|
1932
|
<span class=tx> /* </span></td>
|
1933
|
<td id=sp>.</td>
|
1934
|
<td id=c>
|
1935
|
<span class=tx> </span></td>
|
1936
|
</tr>
|
1937
|
<tr>
|
1938
|
<td id=c>
|
1939
|
<span class=tx> * Method to set query title</span></td>
|
1940
|
<td id=sp>.</td>
|
1941
|
<td id=c>
|
1942
|
<span class=tx> </span></td>
|
1943
|
</tr>
|
1944
|
<tr>
|
1945
|
<td id=c>
|
1946
|
<span class=tx> */</span></td>
|
1947
|
<td id=sp>.</td>
|
1948
|
<td id=c>
|
1949
|
<span class=tx> </span></td>
|
1950
|
</tr>
|
1951
|
<tr>
|
1952
|
<td id=c>
|
1953
|
<span class=tx> private void setQueryTitle(Node node)</span></td>
|
1954
|
<td id=sp>.</td>
|
1955
|
<td id=c>
|
1956
|
<span class=tx> </span></td>
|
1957
|
</tr>
|
1958
|
<tr>
|
1959
|
<td id=c>
|
1960
|
<span class=tx> {</span></td>
|
1961
|
<td id=sp>.</td>
|
1962
|
<td id=c>
|
1963
|
<span class=tx> </span></td>
|
1964
|
</tr>
|
1965
|
<tr>
|
1966
|
<td id=c>
|
1967
|
<span class=tx> Node value = node.getFirstChild();</span></td>
|
1968
|
<td id=sp>.</td>
|
1969
|
<td id=c>
|
1970
|
<span class=tx> </span></td>
|
1971
|
</tr>
|
1972
|
<tr>
|
1973
|
<td id=c>
|
1974
|
<span class=tx> if (value.getNodeType() == Node.TEXT_NODE)</span></td>
|
1975
|
<td id=sp>.</td>
|
1976
|
<td id=c>
|
1977
|
<span class=tx> </span></td>
|
1978
|
</tr>
|
1979
|
<tr>
|
1980
|
<td id=c>
|
1981
|
<span class=tx> {</span></td>
|
1982
|
<td id=sp>.</td>
|
1983
|
<td id=c>
|
1984
|
<span class=tx> </span></td>
|
1985
|
</tr>
|
1986
|
<tr>
|
1987
|
<td id=c>
|
1988
|
<span class=tx> String queryTitle = value.getNodeValue();</span></td>
|
1989
|
<td id=sp>.</td>
|
1990
|
<td id=c>
|
1991
|
<span class=tx> </span></td>
|
1992
|
</tr>
|
1993
|
<tr>
|
1994
|
<td id=c>
|
1995
|
<span class=tx> dbg.print("The ecogrid query title is "+ queryTitle, 2);</span></td>
|
1996
|
<td id=sp>.</td>
|
1997
|
<td id=c>
|
1998
|
<span class=tx> </span></td>
|
1999
|
</tr>
|
2000
|
<tr>
|
2001
|
<td id=c>
|
2002
|
<span class=tx> String [] queryTitleArray = new String[TITLEEARRAYLENGTH];</span></td>
|
2003
|
<td id=sp>.</td>
|
2004
|
<td id=c>
|
2005
|
<span class=tx> </span></td>
|
2006
|
</tr>
|
2007
|
<tr>
|
2008
|
<td id=c>
|
2009
|
<span class=tx> queryTitleArray[0] = queryTitle;</span></td>
|
2010
|
<td id=sp>.</td>
|
2011
|
<td id=c>
|
2012
|
<span class=tx> </span></td>
|
2013
|
</tr>
|
2014
|
<tr>
|
2015
|
<td id=c>
|
2016
|
<span class=tx> query.setTitle(queryTitleArray);</span></td>
|
2017
|
<td id=sp>.</td>
|
2018
|
<td id=c>
|
2019
|
<span class=tx> </span></td>
|
2020
|
</tr>
|
2021
|
<tr>
|
2022
|
<td id=c>
|
2023
|
<span class=tx> }//if</span></td>
|
2024
|
<td id=sp>.</td>
|
2025
|
<td id=c>
|
2026
|
<span class=tx> </span></td>
|
2027
|
</tr>
|
2028
|
<tr>
|
2029
|
<td id=c>
|
2030
|
<span class=tx> }//setQueryTitle</span></td>
|
2031
|
<td id=sp>.</td>
|
2032
|
<td id=c>
|
2033
|
<span class=tx> </span></td>
|
2034
|
</tr>
|
2035
|
<tr>
|
2036
|
<td id=c>
|
2037
|
<span class=tx> </span></td>
|
2038
|
<td id=sp>.</td>
|
2039
|
<td id=c>
|
2040
|
<span class=tx> </span></td>
|
2041
|
</tr>
|
2042
|
<tr>
|
2043
|
<td id=c>
|
2044
|
<span class=tx> /*</span></td>
|
2045
|
<td id=sp>.</td>
|
2046
|
<td id=c>
|
2047
|
<span class=tx> </span></td>
|
2048
|
</tr>
|
2049
|
<tr>
|
2050
|
<td id=c>
|
2051
|
<span class=tx> * Method to set query id</span></td>
|
2052
|
<td id=sp>.</td>
|
2053
|
<td id=c>
|
2054
|
<span class=tx> </span></td>
|
2055
|
</tr>
|
2056
|
<tr>
|
2057
|
<td id=c>
|
2058
|
<span class=tx> */</span></td>
|
2059
|
<td id=sp>.</td>
|
2060
|
<td id=c>
|
2061
|
<span class=tx> </span></td>
|
2062
|
</tr>
|
2063
|
<tr>
|
2064
|
<td id=c>
|
2065
|
<span class=tx> private void setQueryId()</span></td>
|
2066
|
<td id=sp>.</td>
|
2067
|
<td id=c>
|
2068
|
<span class=tx> </span></td>
|
2069
|
</tr>
|
2070
|
<tr>
|
2071
|
<td id=c>
|
2072
|
<span class=tx> {</span></td>
|
2073
|
<td id=sp>.</td>
|
2074
|
<td id=c>
|
2075
|
<span class=tx> </span></td>
|
2076
|
</tr>
|
2077
|
<tr>
|
2078
|
<td id=c>
|
2079
|
<span class=tx> query.setQueryId(queryId);</span></td>
|
2080
|
<td id=sp>.</td>
|
2081
|
<td id=c>
|
2082
|
<span class=tx> </span></td>
|
2083
|
</tr>
|
2084
|
<tr>
|
2085
|
<td id=c>
|
2086
|
<span class=tx> }//setQueryId</span></td>
|
2087
|
<td id=sp>.</td>
|
2088
|
<td id=c>
|
2089
|
<span class=tx> </span></td>
|
2090
|
</tr>
|
2091
|
<tr>
|
2092
|
<td id=c>
|
2093
|
<span class=tx> </span></td>
|
2094
|
<td id=sp>.</td>
|
2095
|
<td id=c>
|
2096
|
<span class=tx> </span></td>
|
2097
|
</tr>
|
2098
|
<tr>
|
2099
|
<td id=c>
|
2100
|
<span class=tx> </span></td>
|
2101
|
<td id=sp>.</td>
|
2102
|
<td id=c>
|
2103
|
<span class=tx> </span></td>
|
2104
|
</tr>
|
2105
|
<tr>
|
2106
|
<td id=c>
|
2107
|
<span class=tx> /*</span></td>
|
2108
|
<td id=sp>.</td>
|
2109
|
<td id=c>
|
2110
|
<span class=tx> </span></td>
|
2111
|
</tr>
|
2112
|
<tr>
|
2113
|
<td id=c>
|
2114
|
<span class=tx> * Put one return field to a vector</span></td>
|
2115
|
<td id=sp>.</td>
|
2116
|
<td id=c>
|
2117
|
<span class=tx> </span></td>
|
2118
|
</tr>
|
2119
|
<tr>
|
2120
|
<td id=c>
|
2121
|
<span class=tx> */</span></td>
|
2122
|
<td id=sp>.</td>
|
2123
|
<td id=c>
|
2124
|
<span class=tx> </span></td>
|
2125
|
</tr>
|
2126
|
<tr>
|
2127
|
<td id=c>
|
2128
|
<span class=tx> private void putReturnFieldIntoVector(Node node)</span></td>
|
2129
|
<td id=sp>.</td>
|
2130
|
<td id=c>
|
2131
|
<span class=tx> </span></td>
|
2132
|
</tr>
|
2133
|
<tr>
|
2134
|
<td id=c>
|
2135
|
<span class=tx> {</span></td>
|
2136
|
<td id=sp>.</td>
|
2137
|
<td id=c>
|
2138
|
<span class=tx> </span></td>
|
2139
|
</tr>
|
2140
|
<tr>
|
2141
|
<td id=c>
|
2142
|
<span class=tx> Node value = node.getFirstChild();</span></td>
|
2143
|
<td id=sp>.</td>
|
2144
|
<td id=c>
|
2145
|
<span class=tx> </span></td>
|
2146
|
</tr>
|
2147
|
<tr>
|
2148
|
<td id=c>
|
2149
|
<span class=tx> if (value.getNodeType() == Node.TEXT_NODE)</span></td>
|
2150
|
<td id=sp>.</td>
|
2151
|
<td id=c>
|
2152
|
<span class=tx> </span></td>
|
2153
|
</tr>
|
2154
|
<tr>
|
2155
|
<td id=c>
|
2156
|
<span class=tx> {</span></td>
|
2157
|
<td id=sp>.</td>
|
2158
|
<td id=c>
|
2159
|
<span class=tx> </span></td>
|
2160
|
</tr>
|
2161
|
<tr>
|
2162
|
<td id=c>
|
2163
|
<span class=tx> String returnField = value.getNodeValue();</span></td>
|
2164
|
<td id=sp>.</td>
|
2165
|
<td id=c>
|
2166
|
<span class=tx> </span></td>
|
2167
|
</tr>
|
2168
|
<tr>
|
2169
|
<td id=c>
|
2170
|
<span class=tx> dbg.print("The return ecogrid query is "+ returnField, 2);</span></td>
|
2171
|
<td id=sp>.</td>
|
2172
|
<td id=c>
|
2173
|
<span class=tx> </span></td>
|
2174
|
</tr>
|
2175
|
<tr>
|
2176
|
<td id=c>
|
2177
|
<span class=tx> if (returnField != null && !returnField.trim().equals(""))</span></td>
|
2178
|
<td id=sp>.</td>
|
2179
|
<td id=c>
|
2180
|
<span class=tx> </span></td>
|
2181
|
</tr>
|
2182
|
<tr>
|
2183
|
<td id=c>
|
2184
|
<span class=tx> {</span></td>
|
2185
|
<td id=sp>.</td>
|
2186
|
<td id=c>
|
2187
|
<span class=tx> </span></td>
|
2188
|
</tr>
|
2189
|
<tr>
|
2190
|
<td id=c>
|
2191
|
<span class=tx> returnField = returnField.trim();</span></td>
|
2192
|
<td id=sp>.</td>
|
2193
|
<td id=c>
|
2194
|
<span class=tx> </span></td>
|
2195
|
</tr>
|
2196
|
<tr>
|
2197
|
<td id=c>
|
2198
|
<span class=tx> dbg.print("The return ecogrid query is "+ returnField, 2);</span></td>
|
2199
|
<td id=sp>.</td>
|
2200
|
<td id=c>
|
2201
|
<span class=tx> </span></td>
|
2202
|
</tr>
|
2203
|
<tr>
|
2204
|
<td id=c>
|
2205
|
<span class=tx> returnFieldList.addElement(returnField);</span></td>
|
2206
|
<td id=sp>.</td>
|
2207
|
<td id=c>
|
2208
|
<span class=tx> </span></td>
|
2209
|
</tr>
|
2210
|
<tr>
|
2211
|
<td id=c>
|
2212
|
<span class=tx> }</span></td>
|
2213
|
<td id=sp>.</td>
|
2214
|
<td id=c>
|
2215
|
<span class=tx> </span></td>
|
2216
|
</tr>
|
2217
|
<tr>
|
2218
|
<td id=c>
|
2219
|
<span class=tx> }//if</span></td>
|
2220
|
<td id=sp>.</td>
|
2221
|
<td id=c>
|
2222
|
<span class=tx> </span></td>
|
2223
|
</tr>
|
2224
|
<tr>
|
2225
|
<td id=c>
|
2226
|
<span class=tx> </span></td>
|
2227
|
<td id=sp>.</td>
|
2228
|
<td id=c>
|
2229
|
<span class=tx> </span></td>
|
2230
|
</tr>
|
2231
|
<tr>
|
2232
|
<td id=c>
|
2233
|
<span class=tx> }//putReturnFieldIntoVector</span></td>
|
2234
|
<td id=sp>.</td>
|
2235
|
<td id=c>
|
2236
|
<span class=tx> </span></td>
|
2237
|
</tr>
|
2238
|
<tr>
|
2239
|
<td id=c>
|
2240
|
<span class=tx> /*</span></td>
|
2241
|
<td id=sp>.</td>
|
2242
|
<td id=c>
|
2243
|
<span class=tx> </span></td>
|
2244
|
</tr>
|
2245
|
<tr>
|
2246
|
<td id=c>
|
2247
|
<span class=tx> * Method to transfer a return field actor a array and set the array to quer
|
2248
|
y</span></td>
|
2249
|
<td id=sp>.</td>
|
2250
|
<td id=c>
|
2251
|
<span class=tx> 
|
2252
|
</span></td>
|
2253
|
</tr>
|
2254
|
<tr>
|
2255
|
<td id=c>
|
2256
|
<span class=tx> */</span></td>
|
2257
|
<td id=sp>.</td>
|
2258
|
<td id=c>
|
2259
|
<span class=tx> </span></td>
|
2260
|
</tr>
|
2261
|
<tr>
|
2262
|
<td id=c>
|
2263
|
<span class=tx> private void setQueryReturnField()</span></td>
|
2264
|
<td id=sp>.</td>
|
2265
|
<td id=c>
|
2266
|
<span class=tx> </span></td>
|
2267
|
</tr>
|
2268
|
<tr>
|
2269
|
<td id=c>
|
2270
|
<span class=tx> {</span></td>
|
2271
|
<td id=sp>.</td>
|
2272
|
<td id=c>
|
2273
|
<span class=tx> </span></td>
|
2274
|
</tr>
|
2275
|
<tr>
|
2276
|
<td id=c>
|
2277
|
<span class=tx> if (returnFieldList != null)</span></td>
|
2278
|
<td id=sp>.</td>
|
2279
|
<td id=c>
|
2280
|
<span class=tx> </span></td>
|
2281
|
</tr>
|
2282
|
<tr>
|
2283
|
<td id=c>
|
2284
|
<span class=tx> {</span></td>
|
2285
|
<td id=sp>.</td>
|
2286
|
<td id=c>
|
2287
|
<span class=tx> </span></td>
|
2288
|
</tr>
|
2289
|
<tr>
|
2290
|
<td id=c>
|
2291
|
<span class=tx> int size = returnFieldList.size();</span></td>
|
2292
|
<td id=sp>.</td>
|
2293
|
<td id=c>
|
2294
|
<span class=tx> </span></td>
|
2295
|
</tr>
|
2296
|
<tr>
|
2297
|
<td id=c>
|
2298
|
<span class=tx> String[] returnFieldArray = new String[size];</span></td>
|
2299
|
<td id=sp>.</td>
|
2300
|
<td id=c>
|
2301
|
<span class=tx> </span></td>
|
2302
|
</tr>
|
2303
|
<tr>
|
2304
|
<td id=c>
|
2305
|
<span class=tx> for (int i=0; i<size; i++)</span></td>
|
2306
|
<td id=sp>.</td>
|
2307
|
<td id=c>
|
2308
|
<span class=tx> </span></td>
|
2309
|
</tr>
|
2310
|
<tr>
|
2311
|
<td id=c>
|
2312
|
<span class=tx> {</span></td>
|
2313
|
<td id=sp>.</td>
|
2314
|
<td id=c>
|
2315
|
<span class=tx> </span></td>
|
2316
|
</tr>
|
2317
|
<tr>
|
2318
|
<td id=c>
|
2319
|
<span class=tx> returnFieldArray[i] = (String)returnFieldList.elementAt(i);</span></td>
|
2320
|
<td id=sp>.</td>
|
2321
|
<td id=c>
|
2322
|
<span class=tx> </span></td>
|
2323
|
</tr>
|
2324
|
<tr>
|
2325
|
<td id=c>
|
2326
|
<span class=tx> }</span></td>
|
2327
|
<td id=sp>.</td>
|
2328
|
<td id=c>
|
2329
|
<span class=tx> </span></td>
|
2330
|
</tr>
|
2331
|
<tr>
|
2332
|
<td id=c>
|
2333
|
<span class=tx> query.setReturnfield(returnFieldArray);</span></td>
|
2334
|
<td id=sp>.</td>
|
2335
|
<td id=c>
|
2336
|
<span class=tx> </span></td>
|
2337
|
</tr>
|
2338
|
<tr>
|
2339
|
<td id=c>
|
2340
|
<span class=tx> }</span></td>
|
2341
|
<td id=sp>.</td>
|
2342
|
<td id=c>
|
2343
|
<span class=tx> </span></td>
|
2344
|
</tr>
|
2345
|
<tr>
|
2346
|
<td id=c>
|
2347
|
<span class=tx> }//setQueryReturnField</span></td>
|
2348
|
<td id=sp>.</td>
|
2349
|
<td id=c>
|
2350
|
<span class=tx> </span></td>
|
2351
|
</tr>
|
2352
|
<tr>
|
2353
|
<td id=c>
|
2354
|
<span class=tx> </span></td>
|
2355
|
<td id=sp>.</td>
|
2356
|
<td id=c>
|
2357
|
<span class=tx> </span></td>
|
2358
|
</tr>
|
2359
|
<tr>
|
2360
|
<td id=c>
|
2361
|
<span class=tx> /*</span></td>
|
2362
|
<td id=sp>.</td>
|
2363
|
<td id=c>
|
2364
|
<span class=tx> </span></td>
|
2365
|
</tr>
|
2366
|
<tr>
|
2367
|
<td id=c>
|
2368
|
<span class=tx> * Method to set AND type to query</span></td>
|
2369
|
<td id=sp>.</td>
|
2370
|
<td id=c>
|
2371
|
<span class=tx> </span></td>
|
2372
|
</tr>
|
2373
|
<tr>
|
2374
|
<td id=c>
|
2375
|
<span class=tx> */</span></td>
|
2376
|
<td id=sp>.</td>
|
2377
|
<td id=c>
|
2378
|
<span class=tx> </span></td>
|
2379
|
</tr>
|
2380
|
<tr>
|
2381
|
<td id=c>
|
2382
|
<span class=tx> private void setQueryANDType(Node node, ANDType and) </span></td>
|
2383
|
<td id=sp>.</td>
|
2384
|
<td id=c>
|
2385
|
<span class=tx> </span></td>
|
2386
|
</tr>
|
2387
|
<tr>
|
2388
|
<td id=c>
|
2389
|
<span class=tx> throws TransformerException, InvalidEcogridQueryException</span></td>
|
2390
|
<td id=sp>.</td>
|
2391
|
<td id=c>
|
2392
|
<span class=tx> 
|
2393
|
</span></td>
|
2394
|
</tr>
|
2395
|
<tr>
|
2396
|
<td id=c>
|
2397
|
<span class=tx> {</span></td>
|
2398
|
<td id=sp>.</td>
|
2399
|
<td id=c>
|
2400
|
<span class=tx> </span></td>
|
2401
|
</tr>
|
2402
|
<tr>
|
2403
|
<td id=c>
|
2404
|
<span class=tx> dbg.print("In AND", 2);</span></td>
|
2405
|
<td id=sp>.</td>
|
2406
|
<td id=c>
|
2407
|
<span class=tx> </span></td>
|
2408
|
</tr>
|
2409
|
<tr>
|
2410
|
<td id=c>
|
2411
|
<span class=tx> setType(node, and, null);</span></td>
|
2412
|
<td id=sp>.</td>
|
2413
|
<td id=c>
|
2414
|
<span class=tx> </span></td>
|
2415
|
</tr>
|
2416
|
<tr>
|
2417
|
<td id=c>
|
2418
|
<span class=tx> }//setQueryANDType</span></td>
|
2419
|
<td id=sp>.</td>
|
2420
|
<td id=c>
|
2421
|
<span class=tx> </span></td>
|
2422
|
</tr>
|
2423
|
<tr>
|
2424
|
<td id=c>
|
2425
|
<span class=tx> </span></td>
|
2426
|
<td id=sp>.</td>
|
2427
|
<td id=c>
|
2428
|
<span class=tx> </span></td>
|
2429
|
</tr>
|
2430
|
<tr>
|
2431
|
<td id=c>
|
2432
|
<span class=tx> /*</span></td>
|
2433
|
<td id=sp>.</td>
|
2434
|
<td id=c>
|
2435
|
<span class=tx> </span></td>
|
2436
|
</tr>
|
2437
|
<tr>
|
2438
|
<td id=c>
|
2439
|
<span class=tx> * Method to set OR type to query</span></td>
|
2440
|
<td id=sp>.</td>
|
2441
|
<td id=c>
|
2442
|
<span class=tx> </span></td>
|
2443
|
</tr>
|
2444
|
<tr>
|
2445
|
<td id=c>
|
2446
|
<span class=tx> */</span></td>
|
2447
|
<td id=sp>.</td>
|
2448
|
<td id=c>
|
2449
|
<span class=tx> </span></td>
|
2450
|
</tr>
|
2451
|
<tr>
|
2452
|
<td id=c>
|
2453
|
<span class=tx> private void setQueryORType(Node node, ORType or) </span></td>
|
2454
|
<td id=sp>.</td>
|
2455
|
<td id=c>
|
2456
|
<span class=tx> </span></td>
|
2457
|
</tr>
|
2458
|
<tr>
|
2459
|
<td id=c>
|
2460
|
<span class=tx> throws TransformerException, InvalidEcogridQueryException</span></td>
|
2461
|
<td id=sp>.</td>
|
2462
|
<td id=c>
|
2463
|
<span class=tx> 
|
2464
|
</span></td>
|
2465
|
</tr>
|
2466
|
<tr>
|
2467
|
<td id=c>
|
2468
|
<span class=tx> {</span></td>
|
2469
|
<td id=sp>.</td>
|
2470
|
<td id=c>
|
2471
|
<span class=tx> </span></td>
|
2472
|
</tr>
|
2473
|
<tr>
|
2474
|
<td id=c>
|
2475
|
<span class=tx> dbg.print("In OR", 2);</span></td>
|
2476
|
<td id=sp>.</td>
|
2477
|
<td id=c>
|
2478
|
<span class=tx> </span></td>
|
2479
|
</tr>
|
2480
|
<tr>
|
2481
|
<td id=c>
|
2482
|
<span class=tx> setType(node, null, or);</span></td>
|
2483
|
<td id=sp>.</td>
|
2484
|
<td id=c>
|
2485
|
<span class=tx> </span></td>
|
2486
|
</tr>
|
2487
|
<tr>
|
2488
|
<td id=c>
|
2489
|
<span class=tx> }//setQueryORType</span></td>
|
2490
|
<td id=sp>.</td>
|
2491
|
<td id=c>
|
2492
|
<span class=tx> </span></td>
|
2493
|
</tr>
|
2494
|
<tr>
|
2495
|
<td id=c>
|
2496
|
<span class=tx> </span></td>
|
2497
|
<td id=sp>.</td>
|
2498
|
<td id=c>
|
2499
|
<span class=tx> </span></td>
|
2500
|
</tr>
|
2501
|
<tr>
|
2502
|
<td id=c>
|
2503
|
<span class=tx> /*</span></td>
|
2504
|
<td id=sp>.</td>
|
2505
|
<td id=c>
|
2506
|
<span class=tx> </span></td>
|
2507
|
</tr>
|
2508
|
<tr>
|
2509
|
<td id=c>
|
2510
|
<span class=tx> * Method can handle both OR and AND</span></td>
|
2511
|
<td id=sp>.</td>
|
2512
|
<td id=c>
|
2513
|
<span class=tx> </span></td>
|
2514
|
</tr>
|
2515
|
<tr>
|
2516
|
<td id=c>
|
2517
|
<span class=tx> */</span></td>
|
2518
|
<td id=sp>.</td>
|
2519
|
<td id=c>
|
2520
|
<span class=tx> </span></td>
|
2521
|
</tr>
|
2522
|
<tr>
|
2523
|
<td id=c>
|
2524
|
<span class=tx> private void setType(Node node, ANDType and, ORType or) </span></td>
|
2525
|
<td id=sp>.</td>
|
2526
|
<td id=c>
|
2527
|
<span class=tx> </span></td>
|
2528
|
</tr>
|
2529
|
<tr>
|
2530
|
<td id=c>
|
2531
|
<span class=tx> throws TransformerException, InvalidEcogridQueryException</span></td>
|
2532
|
<td id=sp>.</td>
|
2533
|
<td id=c>
|
2534
|
<span class=tx> </span></td>
|
2535
|
</tr>
|
2536
|
<tr>
|
2537
|
<td id=c>
|
2538
|
<span class=tx> {</span></td>
|
2539
|
<td id=sp>.</td>
|
2540
|
<td id=c>
|
2541
|
<span class=tx> </span></td>
|
2542
|
</tr>
|
2543
|
<tr>
|
2544
|
<td id=c>
|
2545
|
<span class=tx> //make sure parameter works</span></td>
|
2546
|
<td id=sp>.</td>
|
2547
|
<td id=c>
|
2548
|
<span class=tx> </span></td>
|
2549
|
</tr>
|
2550
|
<tr>
|
2551
|
<td id=c>
|
2552
|
<span class=tx> if (node == null)</span></td>
|
2553
|
<td id=sp>.</td>
|
2554
|
<td id=c>
|
2555
|
<span class=tx> </span></td>
|
2556
|
</tr>
|
2557
|
<tr>
|
2558
|
<td id=c>
|
2559
|
<span class=tx> {</span></td>
|
2560
|
<td id=sp>.</td>
|
2561
|
<td id=c>
|
2562
|
<span class=tx> </span></td>
|
2563
|
</tr>
|
2564
|
<tr>
|
2565
|
<td id=c>
|
2566
|
<span class=tx> return;</span></td>
|
2567
|
<td id=sp>.</td>
|
2568
|
<td id=c>
|
2569
|
<span class=tx> </span></td>
|
2570
|
</tr>
|
2571
|
<tr>
|
2572
|
<td id=c>
|
2573
|
<span class=tx> }</span></td>
|
2574
|
<td id=sp>.</td>
|
2575
|
<td id=c>
|
2576
|
<span class=tx> </span></td>
|
2577
|
</tr>
|
2578
|
<tr>
|
2579
|
<td id=c>
|
2580
|
<span class=tx> NodeList andList = XPathAPI.selectNodeList(node, AND);</span></td>
|
2581
|
<td id=sp>.</td>
|
2582
|
<td id=c>
|
2583
|
<span class=tx> </span></td>
|
2584
|
</tr>
|
2585
|
<tr>
|
2586
|
<td id=c>
|
2587
|
<span class=tx> NodeList orList = XPathAPI.selectNodeList(node, OR);</span></td>
|
2588
|
<td id=sp>.</td>
|
2589
|
<td id=c>
|
2590
|
<span class=tx> </span></td>
|
2591
|
</tr>
|
2592
|
<tr>
|
2593
|
<td id=c>
|
2594
|
<span class=tx> NodeList conList = XPathAPI.selectNodeList(node, CONDITION);</span></td>
|
2595
|
<td id=sp>.</td>
|
2596
|
<td id=c>
|
2597
|
<span class=tx> </span></td>
|
2598
|
</tr>
|
2599
|
<tr>
|
2600
|
<td id=c>
|
2601
|
<span class=tx> int andLength = andList.getLength();</span></td>
|
2602
|
<td id=sp>.</td>
|
2603
|
<td id=c>
|
2604
|
<span class=tx> </span></td>
|
2605
|
</tr>
|
2606
|
<tr>
|
2607
|
<td id=c>
|
2608
|
<span class=tx> int orLength = orList.getLength();</span></td>
|
2609
|
<td id=sp>.</td>
|
2610
|
<td id=c>
|
2611
|
<span class=tx> </span></td>
|
2612
|
</tr>
|
2613
|
<tr>
|
2614
|
<td id=c>
|
2615
|
<span class=tx> int conLength = conList.getLength();</span></td>
|
2616
|
<td id=sp>.</td>
|
2617
|
<td id=c>
|
2618
|
<span class=tx> </span></td>
|
2619
|
</tr>
|
2620
|
<tr>
|
2621
|
<td id=c>
|
2622
|
<span class=tx> // and type children</span></td>
|
2623
|
<td id=sp>.</td>
|
2624
|
<td id=c>
|
2625
|
<span class=tx> </span></td>
|
2626
|
</tr>
|
2627
|
<tr>
|
2628
|
<td id=c>
|
2629
|
<span class=tx> if (andLength != 0)</span></td>
|
2630
|
<td id=sp>.</td>
|
2631
|
<td id=c>
|
2632
|
<span class=tx> </span></td>
|
2633
|
</tr>
|
2634
|
<tr>
|
2635
|
<td id=c>
|
2636
|
<span class=tx> {</span></td>
|
2637
|
<td id=sp>.</td>
|
2638
|
<td id=c>
|
2639
|
<span class=tx> </span></td>
|
2640
|
</tr>
|
2641
|
<tr>
|
2642
|
<td id=c>
|
2643
|
<span class=tx> ANDType[] andArray = new ANDType[andLength];</span></td>
|
2644
|
<td id=sp>.</td>
|
2645
|
<td id=c>
|
2646
|
<span class=tx> </span></td>
|
2647
|
</tr>
|
2648
|
<tr>
|
2649
|
<td id=c>
|
2650
|
<span class=tx> // get and type children</span></td>
|
2651
|
<td id=sp>.</td>
|
2652
|
<td id=c>
|
2653
|
<span class=tx> </span></td>
|
2654
|
</tr>
|
2655
|
<tr>
|
2656
|
<td id=c>
|
2657
|
<span class=tx> for ( int i=0; i<andLength; i++)</span></td>
|
2658
|
<td id=sp>.</td>
|
2659
|
<td id=c>
|
2660
|
<span class=tx> </span></td>
|
2661
|
</tr>
|
2662
|
<tr>
|
2663
|
<td id=c>
|
2664
|
<span class=tx> {</span></td>
|
2665
|
<td id=sp>.</td>
|
2666
|
<td id=c>
|
2667
|
<span class=tx> </span></td>
|
2668
|
</tr>
|
2669
|
<tr>
|
2670
|
<td id=c>
|
2671
|
<span class=tx> ANDType andChild = new ANDType();</span></td>
|
2672
|
<td id=sp>.</td>
|
2673
|
<td id=c>
|
2674
|
<span class=tx> </span></td>
|
2675
|
</tr>
|
2676
|
<tr>
|
2677
|
<td id=c>
|
2678
|
<span class=tx> andArray[i] = andChild;</span></td>
|
2679
|
<td id=sp>.</td>
|
2680
|
<td id=c>
|
2681
|
<span class=tx> </span></td>
|
2682
|
</tr>
|
2683
|
<tr>
|
2684
|
<td id=c>
|
2685
|
<span class=tx> Node childNode = andList.item(i);</span></td>
|
2686
|
<td id=sp>.</td>
|
2687
|
<td id=c>
|
2688
|
<span class=tx> </span></td>
|
2689
|
</tr>
|
2690
|
<tr>
|
2691
|
<td id=c>
|
2692
|
<span class=tx> // call handleANDype again</span></td>
|
2693
|
<td id=sp>.</td>
|
2694
|
<td id=c>
|
2695
|
<span class=tx> </span></td>
|
2696
|
</tr>
|
2697
|
<tr>
|
2698
|
<td id=c>
|
2699
|
<span class=tx> setType(childNode, andChild, null);//make usre or type is null</span></td>
|
2700
|
<td id=sp>.</td>
|
2701
|
<td id=c>
|
2702
|
<span class=tx> </span></td>
|
2703
|
</tr>
|
2704
|
<tr>
|
2705
|
<td id=c>
|
2706
|
<span class=tx> }</span></td>
|
2707
|
<td id=sp>.</td>
|
2708
|
<td id=c>
|
2709
|
<span class=tx> </span></td>
|
2710
|
</tr>
|
2711
|
<tr>
|
2712
|
<td id=c>
|
2713
|
<span class=tx> //set children to parent</span></td>
|
2714
|
<td id=sp>.</td>
|
2715
|
<td id=c>
|
2716
|
<span class=tx> </span></td>
|
2717
|
</tr>
|
2718
|
<tr>
|
2719
|
<td id=c>
|
2720
|
<span class=tx> if (and != null)</span></td>
|
2721
|
<td id=sp>.</td>
|
2722
|
<td id=c>
|
2723
|
<span class=tx> </span></td>
|
2724
|
</tr>
|
2725
|
<tr>
|
2726
|
<td id=c>
|
2727
|
<span class=tx> {</span></td>
|
2728
|
<td id=sp>.</td>
|
2729
|
<td id=c>
|
2730
|
<span class=tx> </span></td>
|
2731
|
</tr>
|
2732
|
<tr>
|
2733
|
<td id=c>
|
2734
|
<span class=tx> and.setAND(andArray);</span></td>
|
2735
|
<td id=sp>.</td>
|
2736
|
<td id=c>
|
2737
|
<span class=tx> </span></td>
|
2738
|
</tr>
|
2739
|
<tr>
|
2740
|
<td id=c>
|
2741
|
<span class=tx> }</span></td>
|
2742
|
<td id=sp>.</td>
|
2743
|
<td id=c>
|
2744
|
<span class=tx> </span></td>
|
2745
|
</tr>
|
2746
|
<tr>
|
2747
|
<td id=c>
|
2748
|
<span class=tx> else if (or != null)</span></td>
|
2749
|
<td id=sp>.</td>
|
2750
|
<td id=c>
|
2751
|
<span class=tx> </span></td>
|
2752
|
</tr>
|
2753
|
<tr>
|
2754
|
<td id=c>
|
2755
|
<span class=tx> {</span></td>
|
2756
|
<td id=sp>.</td>
|
2757
|
<td id=c>
|
2758
|
<span class=tx> </span></td>
|
2759
|
</tr>
|
2760
|
<tr>
|
2761
|
<td id=c>
|
2762
|
<span class=tx> or.setAND(andArray);</span></td>
|
2763
|
<td id=sp>.</td>
|
2764
|
<td id=c>
|
2765
|
<span class=tx> </span></td>
|
2766
|
</tr>
|
2767
|
<tr>
|
2768
|
<td id=c>
|
2769
|
<span class=tx> }</span></td>
|
2770
|
<td id=sp>.</td>
|
2771
|
<td id=c>
|
2772
|
<span class=tx> </span></td>
|
2773
|
</tr>
|
2774
|
<tr>
|
2775
|
<td id=c>
|
2776
|
<span class=tx> }</span></td>
|
2777
|
<td id=sp>.</td>
|
2778
|
<td id=c>
|
2779
|
<span class=tx> </span></td>
|
2780
|
</tr>
|
2781
|
<tr>
|
2782
|
<td id=c>
|
2783
|
<span class=tx> //or type children</span></td>
|
2784
|
<td id=sp>.</td>
|
2785
|
<td id=c>
|
2786
|
<span class=tx> </span></td>
|
2787
|
</tr>
|
2788
|
<tr>
|
2789
|
<td id=c>
|
2790
|
<span class=tx> if (orLength != 0)</span></td>
|
2791
|
<td id=sp>.</td>
|
2792
|
<td id=c>
|
2793
|
<span class=tx> </span></td>
|
2794
|
</tr>
|
2795
|
<tr>
|
2796
|
<td id=c>
|
2797
|
<span class=tx> {</span></td>
|
2798
|
<td id=sp>.</td>
|
2799
|
<td id=c>
|
2800
|
<span class=tx> </span></td>
|
2801
|
</tr>
|
2802
|
<tr>
|
2803
|
<td id=c>
|
2804
|
<span class=tx> ORType[] orArray = new ORType[orLength];</span></td>
|
2805
|
<td id=sp>.</td>
|
2806
|
<td id=c>
|
2807
|
<span class=tx> </span></td>
|
2808
|
</tr>
|
2809
|
<tr>
|
2810
|
<td id=c>
|
2811
|
<span class=tx> // get or type children</span></td>
|
2812
|
<td id=sp>.</td>
|
2813
|
<td id=c>
|
2814
|
<span class=tx> </span></td>
|
2815
|
</tr>
|
2816
|
<tr>
|
2817
|
<td id=c>
|
2818
|
<span class=tx> for ( int i=0; i< orLength; i++)</span></td>
|
2819
|
<td id=sp>.</td>
|
2820
|
<td id=c>
|
2821
|
<span class=tx> </span></td>
|
2822
|
</tr>
|
2823
|
<tr>
|
2824
|
<td id=c>
|
2825
|
<span class=tx> {</span></td>
|
2826
|
<td id=sp>.</td>
|
2827
|
<td id=c>
|
2828
|
<span class=tx> </span></td>
|
2829
|
</tr>
|
2830
|
<tr>
|
2831
|
<td id=c>
|
2832
|
<span class=tx> ORType orChild = new ORType();</span></td>
|
2833
|
<td id=sp>.</td>
|
2834
|
<td id=c>
|
2835
|
<span class=tx> </span></td>
|
2836
|
</tr>
|
2837
|
<tr>
|
2838
|
<td id=c>
|
2839
|
<span class=tx> orArray[i] = orChild;</span></td>
|
2840
|
<td id=sp>.</td>
|
2841
|
<td id=c>
|
2842
|
<span class=tx> </span></td>
|
2843
|
</tr>
|
2844
|
<tr>
|
2845
|
<td id=c>
|
2846
|
<span class=tx> Node childNode = orList.item(i);</span></td>
|
2847
|
<td id=sp>.</td>
|
2848
|
<td id=c>
|
2849
|
<span class=tx> </span></td>
|
2850
|
</tr>
|
2851
|
<tr>
|
2852
|
<td id=c>
|
2853
|
<span class=tx> setType(childNode, null, orChild);//make sure ANDType is null</span></td>
|
2854
|
<td id=sp>.</td>
|
2855
|
<td id=c>
|
2856
|
<span class=tx> </span></td>
|
2857
|
</tr>
|
2858
|
<tr>
|
2859
|
<td id=c>
|
2860
|
<span class=tx> }</span></td>
|
2861
|
<td id=sp>.</td>
|
2862
|
<td id=c>
|
2863
|
<span class=tx> </span></td>
|
2864
|
</tr>
|
2865
|
<tr>
|
2866
|
<td id=c>
|
2867
|
<span class=tx> if (and !=null)</span></td>
|
2868
|
<td id=sp>.</td>
|
2869
|
<td id=c>
|
2870
|
<span class=tx> </span></td>
|
2871
|
</tr>
|
2872
|
<tr>
|
2873
|
<td id=c>
|
2874
|
<span class=tx> {</span></td>
|
2875
|
<td id=sp>.</td>
|
2876
|
<td id=c>
|
2877
|
<span class=tx> </span></td>
|
2878
|
</tr>
|
2879
|
<tr>
|
2880
|
<td id=c>
|
2881
|
<span class=tx> and.setOR(orArray);</span></td>
|
2882
|
<td id=sp>.</td>
|
2883
|
<td id=c>
|
2884
|
<span class=tx> </span></td>
|
2885
|
</tr>
|
2886
|
<tr>
|
2887
|
<td id=c>
|
2888
|
<span class=tx> }</span></td>
|
2889
|
<td id=sp>.</td>
|
2890
|
<td id=c>
|
2891
|
<span class=tx> </span></td>
|
2892
|
</tr>
|
2893
|
<tr>
|
2894
|
<td id=c>
|
2895
|
<span class=tx> else if (or != null)</span></td>
|
2896
|
<td id=sp>.</td>
|
2897
|
<td id=c>
|
2898
|
<span class=tx> </span></td>
|
2899
|
</tr>
|
2900
|
<tr>
|
2901
|
<td id=c>
|
2902
|
<span class=tx> {</span></td>
|
2903
|
<td id=sp>.</td>
|
2904
|
<td id=c>
|
2905
|
<span class=tx> </span></td>
|
2906
|
</tr>
|
2907
|
<tr>
|
2908
|
<td id=c>
|
2909
|
<span class=tx> or.setOR(orArray);</span></td>
|
2910
|
<td id=sp>.</td>
|
2911
|
<td id=c>
|
2912
|
<span class=tx> </span></td>
|
2913
|
</tr>
|
2914
|
<tr>
|
2915
|
<td id=c>
|
2916
|
<span class=tx> }</span></td>
|
2917
|
<td id=sp>.</td>
|
2918
|
<td id=c>
|
2919
|
<span class=tx> </span></td>
|
2920
|
</tr>
|
2921
|
<tr>
|
2922
|
<td id=c>
|
2923
|
<span class=tx> </span></td>
|
2924
|
<td id=sp>.</td>
|
2925
|
<td id=c>
|
2926
|
<span class=tx> </span></td>
|
2927
|
</tr>
|
2928
|
<tr>
|
2929
|
<td id=c>
|
2930
|
<span class=tx> }</span></td>
|
2931
|
<td id=sp>.</td>
|
2932
|
<td id=c>
|
2933
|
<span class=tx> </span></td>
|
2934
|
</tr>
|
2935
|
<tr>
|
2936
|
<td id=c>
|
2937
|
<span class=tx> // conditiontype</span></td>
|
2938
|
<td id=sp>.</td>
|
2939
|
<td id=c>
|
2940
|
<span class=tx> </span></td>
|
2941
|
</tr>
|
2942
|
<tr>
|
2943
|
<td id=c>
|
2944
|
<span class=tx> if ( conLength != 0 )</span></td>
|
2945
|
<td id=sp>.</td>
|
2946
|
<td id=c>
|
2947
|
<span class=tx> </span></td>
|
2948
|
</tr>
|
2949
|
<tr>
|
2950
|
<td id=c>
|
2951
|
<span class=tx> {</span></td>
|
2952
|
<td id=sp>.</td>
|
2953
|
<td id=c>
|
2954
|
<span class=tx> </span></td>
|
2955
|
</tr>
|
2956
|
<tr>
|
2957
|
<td id=c>
|
2958
|
<span class=tx> ConditionType[] conditionArray = new ConditionType[conLength];</span></td>
|
2959
|
<td id=sp>.</td>
|
2960
|
<td id=c>
|
2961
|
<span class=tx> </span></td>
|
2962
|
</tr>
|
2963
|
<tr>
|
2964
|
<td id=c>
|
2965
|
<span class=tx> for ( int i=0; i< conLength; i++)</span></td>
|
2966
|
<td id=sp>.</td>
|
2967
|
<td id=c>
|
2968
|
<span class=tx> </span></td>
|
2969
|
</tr>
|
2970
|
<tr>
|
2971
|
<td id=c>
|
2972
|
<span class=tx> {</span></td>
|
2973
|
<td id=sp>.</td>
|
2974
|
<td id=c>
|
2975
|
<span class=tx> </span></td>
|
2976
|
</tr>
|
2977
|
<tr>
|
2978
|
<td id=c>
|
2979
|
<span class=tx> Node childNode = conList.item(i);</span></td>
|
2980
|
<td id=sp>.</td>
|
2981
|
<td id=c>
|
2982
|
<span class=tx> </span></td>
|
2983
|
</tr>
|
2984
|
<tr>
|
2985
|
<td id=c>
|
2986
|
<span class=tx> ConditionType condition = setQueryConditionType(childNode);</span></td>
|
2987
|
<td id=sp>.</td>
|
2988
|
<td id=c>
|
2989
|
<span class=tx> </span></td>
|
2990
|
</tr>
|
2991
|
<tr>
|
2992
|
<td id=c>
|
2993
|
<span class=tx> conditionArray[i] = condition;</span></td>
|
2994
|
<td id=sp>.</td>
|
2995
|
<td id=c>
|
2996
|
<span class=tx> </span></td>
|
2997
|
</tr>
|
2998
|
<tr>
|
2999
|
<td id=c>
|
3000
|
<span class=tx> }//for</span></td>
|
3001
|
<td id=sp>.</td>
|
3002
|
<td id=c>
|
3003
|
<span class=tx> </span></td>
|
3004
|
</tr>
|
3005
|
<tr>
|
3006
|
<td id=c>
|
3007
|
<span class=tx> if (and !=null)</span></td>
|
3008
|
<td id=sp>.</td>
|
3009
|
<td id=c>
|
3010
|
<span class=tx> </span></td>
|
3011
|
</tr>
|
3012
|
<tr>
|
3013
|
<td id=c>
|
3014
|
<span class=tx> {</span></td>
|
3015
|
<td id=sp>.</td>
|
3016
|
<td id=c>
|
3017
|
<span class=tx> </span></td>
|
3018
|
</tr>
|
3019
|
<tr>
|
3020
|
<td id=c>
|
3021
|
<span class=tx> and.setCondition(conditionArray);</span></td>
|
3022
|
<td id=sp>.</td>
|
3023
|
<td id=c>
|
3024
|
<span class=tx> </span></td>
|
3025
|
</tr>
|
3026
|
<tr>
|
3027
|
<td id=c>
|
3028
|
<span class=tx> }</span></td>
|
3029
|
<td id=sp>.</td>
|
3030
|
<td id=c>
|
3031
|
<span class=tx> </span></td>
|
3032
|
</tr>
|
3033
|
<tr>
|
3034
|
<td id=c>
|
3035
|
<span class=tx> else if (or != null)</span></td>
|
3036
|
<td id=sp>.</td>
|
3037
|
<td id=c>
|
3038
|
<span class=tx> </span></td>
|
3039
|
</tr>
|
3040
|
<tr>
|
3041
|
<td id=c>
|
3042
|
<span class=tx> {</span></td>
|
3043
|
<td id=sp>.</td>
|
3044
|
<td id=c>
|
3045
|
<span class=tx> </span></td>
|
3046
|
</tr>
|
3047
|
<tr>
|
3048
|
<td id=c>
|
3049
|
<span class=tx> or.setCondition(conditionArray);</span></td>
|
3050
|
<td id=sp>.</td>
|
3051
|
<td id=c>
|
3052
|
<span class=tx> </span></td>
|
3053
|
</tr>
|
3054
|
<tr>
|
3055
|
<td id=c>
|
3056
|
<span class=tx> }</span></td>
|
3057
|
<td id=sp>.</td>
|
3058
|
<td id=c>
|
3059
|
<span class=tx> </span></td>
|
3060
|
</tr>
|
3061
|
<tr>
|
3062
|
<td id=c>
|
3063
|
<span class=tx> }//if</span></td>
|
3064
|
<td id=sp>.</td>
|
3065
|
<td id=c>
|
3066
|
<span class=tx> </span></td>
|
3067
|
</tr>
|
3068
|
<tr>
|
3069
|
<td id=c>
|
3070
|
<span class=tx> </span></td>
|
3071
|
<td id=sp>.</td>
|
3072
|
<td id=c>
|
3073
|
<span class=tx> </span></td>
|
3074
|
</tr>
|
3075
|
<tr>
|
3076
|
<td id=c>
|
3077
|
<span class=tx> }//setType</span></td>
|
3078
|
<td id=sp>.</td>
|
3079
|
<td id=c>
|
3080
|
<span class=tx> </span></td>
|
3081
|
</tr>
|
3082
|
<tr>
|
3083
|
<td id=c>
|
3084
|
<span class=tx> </span></td>
|
3085
|
<td id=sp>.</td>
|
3086
|
<td id=c>
|
3087
|
<span class=tx> </span></td>
|
3088
|
</tr>
|
3089
|
<tr>
|
3090
|
<td id=c>
|
3091
|
<span class=tx> /*</span></td>
|
3092
|
<td id=sp>.</td>
|
3093
|
<td id=c>
|
3094
|
<span class=tx> </span></td>
|
3095
|
</tr>
|
3096
|
<tr>
|
3097
|
<td id=c>
|
3098
|
<span class=tx> * Method to set Condition type to query</span></td>
|
3099
|
<td id=sp>.</td>
|
3100
|
<td id=c>
|
3101
|
<span class=tx> </span></td>
|
3102
|
</tr>
|
3103
|
<tr>
|
3104
|
<td id=c>
|
3105
|
<span class=tx> */</span></td>
|
3106
|
<td id=sp>.</td>
|
3107
|
<td id=c>
|
3108
|
<span class=tx> </span></td>
|
3109
|
</tr>
|
3110
|
<tr>
|
3111
|
<td id=c>
|
3112
|
<span class=tx> private ConditionType setQueryConditionType(Node node) throws InvalidEcogrid
|
3113
|
QueryException</span></td>
|
3114
|
<td id=sp>.</td>
|
3115
|
<td id=c>
|
3116
|
<span class=tx> 
|
3117
|
</span></td>
|
3118
|
</tr>
|
3119
|
<tr>
|
3120
|
<td id=c>
|
3121
|
<span class=tx> {</span></td>
|
3122
|
<td id=sp>.</td>
|
3123
|
<td id=c>
|
3124
|
<span class=tx> </span></td>
|
3125
|
</tr>
|
3126
|
<tr>
|
3127
|
<td id=c>
|
3128
|
<span class=tx> ConditionType condition = null;</span></td>
|
3129
|
<td id=sp>.</td>
|
3130
|
<td id=c>
|
3131
|
<span class=tx> </span></td>
|
3132
|
</tr>
|
3133
|
<tr>
|
3134
|
<td id=c>
|
3135
|
<span class=tx> dbg.print("In condition type", 2);</span></td>
|
3136
|
<td id=sp>.</td>
|
3137
|
<td id=c>
|
3138
|
<span class=tx> </span></td>
|
3139
|
</tr>
|
3140
|
<tr>
|
3141
|
<td id=c>
|
3142
|
<span class=tx> Element coditionElement = (Element) node;</span></td>
|
3143
|
<td id=sp>.</td>
|
3144
|
<td id=c>
|
3145
|
<span class=tx> </span></td>
|
3146
|
</tr>
|
3147
|
<tr>
|
3148
|
<td id=c>
|
3149
|
<span class=tx> // get attribute operator from node</span></td>
|
3150
|
<td id=sp>.</td>
|
3151
|
<td id=c>
|
3152
|
<span class=tx> </span></td>
|
3153
|
</tr>
|
3154
|
<tr>
|
3155
|
<td id=c>
|
3156
|
<span class=tx> String operatorString = coditionElement.getAttribute(OPERATOR);</span></td>
|
3157
|
<td id=sp>.</td>
|
3158
|
<td id=c>
|
3159
|
<span class=tx> </span></td>
|
3160
|
</tr>
|
3161
|
<tr>
|
3162
|
<td id=c>
|
3163
|
<span class=tx> dbg.print("operator string is "+ operatorString, 2);</span></td>
|
3164
|
<td id=sp>.</td>
|
3165
|
<td id=c>
|
3166
|
<span class=tx> </span></td>
|
3167
|
</tr>
|
3168
|
<tr>
|
3169
|
<td id=c>
|
3170
|
<span class=tx> // get attribute concept</span></td>
|
3171
|
<td id=sp>.</td>
|
3172
|
<td id=c>
|
3173
|
<span class=tx> </span></td>
|
3174
|
</tr>
|
3175
|
<tr>
|
3176
|
<td id=c>
|
3177
|
<span class=tx> String conceptString = coditionElement.getAttribute(CONCEPT);</span></td>
|
3178
|
<td id=sp>.</td>
|
3179
|
<td id=c>
|
3180
|
<span class=tx> </span></td>
|
3181
|
</tr>
|
3182
|
<tr>
|
3183
|
<td id=c>
|
3184
|
<span class=tx> dbg.print("concept string is "+ conceptString, 2);</span></td>
|
3185
|
<td id=sp>.</td>
|
3186
|
<td id=c>
|
3187
|
<span class=tx> </span></td>
|
3188
|
</tr>
|
3189
|
<tr>
|
3190
|
<td id=c>
|
3191
|
<span class=tx> // get element value</span></td>
|
3192
|
<td id=sp>.</td>
|
3193
|
<td id=c>
|
3194
|
<span class=tx> </span></td>
|
3195
|
</tr>
|
3196
|
<tr>
|
3197
|
<td id=c>
|
3198
|
<span class=tx> String value = coditionElement.getFirstChild().getNodeValue();</span></td>
|
3199
|
<td id=sp>.</td>
|
3200
|
<td id=c>
|
3201
|
<span class=tx> </span></td>
|
3202
|
</tr>
|
3203
|
<tr>
|
3204
|
<td id=c>
|
3205
|
<span class=tx> dbg.print("value string is "+ value, 2);</span></td>
|
3206
|
<td id=sp>.</td>
|
3207
|
<td id=c>
|
3208
|
<span class=tx> </span></td>
|
3209
|
</tr>
|
3210
|
<tr>
|
3211
|
<td id=c>
|
3212
|
<span class=tx> condition = generateConditionType(conceptString, operatorString, value);</span></td>
|
3213
|
<td id=sp>.</td>
|
3214
|
<td id=c>
|
3215
|
<span class=tx> </span></td>
|
3216
|
</tr>
|
3217
|
<tr>
|
3218
|
<td id=c>
|
3219
|
<span class=tx> return condition;</span></td>
|
3220
|
<td id=sp>.</td>
|
3221
|
<td id=c>
|
3222
|
<span class=tx> </span></td>
|
3223
|
</tr>
|
3224
|
<tr>
|
3225
|
<td id=c>
|
3226
|
<span class=tx> }//setConditionType</span></td>
|
3227
|
<td id=sp>.</td>
|
3228
|
<td id=c>
|
3229
|
<span class=tx> </span></td>
|
3230
|
</tr>
|
3231
|
<tr>
|
3232
|
<td id=c>
|
3233
|
<span class=tx> </span></td>
|
3234
|
<td id=sp>.</td>
|
3235
|
<td id=c>
|
3236
|
<span class=tx> </span></td>
|
3237
|
</tr>
|
3238
|
<tr>
|
3239
|
<td id=c>
|
3240
|
<span class=tx> /*</span></td>
|
3241
|
<td id=sp>.</td>
|
3242
|
<td id=c>
|
3243
|
<span class=tx> </span></td>
|
3244
|
</tr>
|
3245
|
<tr>
|
3246
|
<td id=c>
|
3247
|
<span class=tx> * Generate a condition type base on concept, operator, value</span></td>
|
3248
|
<td id=sp>.</td>
|
3249
|
<td id=c>
|
3250
|
<span class=tx> </span></td>
|
3251
|
</tr>
|
3252
|
<tr>
|
3253
|
<td id=c>
|
3254
|
<span class=tx> */</span></td>
|
3255
|
<td id=sp>.</td>
|
3256
|
<td id=c>
|
3257
|
<span class=tx> </span></td>
|
3258
|
</tr>
|
3259
|
<tr>
|
3260
|
<td id=c>
|
3261
|
<span class=tx> private ConditionType generateConditionType(String concept,</span></td>
|
3262
|
<td id=sp>.</td>
|
3263
|
<td id=c>
|
3264
|
<span class=tx> </span></td>
|
3265
|
</tr>
|
3266
|
<tr>
|
3267
|
<td id=c>
|
3268
|
<span class=tx> String operator, String value)</span></td>
|
3269
|
<td id=sp>.</td>
|
3270
|
<td id=c>
|
3271
|
<span class=tx> </span></td>
|
3272
|
</tr>
|
3273
|
<tr>
|
3274
|
<td id=c>
|
3275
|
<span class=tx> throws InvalidEcogridQueryException</span></td>
|
3276
|
<td id=sp>.</td>
|
3277
|
<td id=c>
|
3278
|
<span class=tx> </span></td>
|
3279
|
</tr>
|
3280
|
<tr>
|
3281
|
<td id=c>
|
3282
|
<span class=tx> {</span></td>
|
3283
|
<td id=sp>.</td>
|
3284
|
<td id=c>
|
3285
|
<span class=tx> </span></td>
|
3286
|
</tr>
|
3287
|
<tr>
|
3288
|
<td id=c>
|
3289
|
<span class=tx> // check the parameters</span></td>
|
3290
|
<td id=sp>.</td>
|
3291
|
<td id=c>
|
3292
|
<span class=tx> </span></td>
|
3293
|
</tr>
|
3294
|
<tr>
|
3295
|
<td id=c>
|
3296
|
<span class=tx> if ( concept == null || concept.trim().equals(""))</span></td>
|
3297
|
<td id=sp>.</td>
|
3298
|
<td id=c>
|
3299
|
<span class=tx> </span></td>
|
3300
|
</tr>
|
3301
|
<tr>
|
3302
|
<td id=c>
|
3303
|
<span class=tx> {</span></td>
|
3304
|
<td id=sp>.</td>
|
3305
|
<td id=c>
|
3306
|
<span class=tx> </span></td>
|
3307
|
</tr>
|
3308
|
<tr>
|
3309
|
<td id=c>
|
3310
|
<span class=tx> throw new InvalidEcogridQueryException("Should set up concept value in "
|
3311
|
+</span></td>
|
3312
|
<td id=sp>.</td>
|
3313
|
<td id=c>
|
3314
|
<span class=tx> 
|
3315
|
</span></td>
|
3316
|
</tr>
|
3317
|
<tr>
|
3318
|
<td id=c>
|
3319
|
<span class=tx> "condition type in ecogrid query");</span></td>
|
3320
|
<td id=sp>.</td>
|
3321
|
<td id=c>
|
3322
|
<span class=tx> </span></td>
|
3323
|
</tr>
|
3324
|
<tr>
|
3325
|
<td id=c>
|
3326
|
<span class=tx> }</span></td>
|
3327
|
<td id=sp>.</td>
|
3328
|
<td id=c>
|
3329
|
<span class=tx> </span></td>
|
3330
|
</tr>
|
3331
|
<tr>
|
3332
|
<td id=c>
|
3333
|
<span class=tx> else if (operator == null || operator.trim().equals(""))</span></td>
|
3334
|
<td id=sp>.</td>
|
3335
|
<td id=c>
|
3336
|
<span class=tx> </span></td>
|
3337
|
</tr>
|
3338
|
<tr>
|
3339
|
<td id=c>
|
3340
|
<span class=tx> {</span></td>
|
3341
|
<td id=sp>.</td>
|
3342
|
<td id=c>
|
3343
|
<span class=tx> </span></td>
|
3344
|
</tr>
|
3345
|
<tr>
|
3346
|
<td id=c>
|
3347
|
<span class=tx> throw new InvalidEcogridQueryException("Should set up operator value in
|
3348
|
"+</span></td>
|
3349
|
<td id=sp>.</td>
|
3350
|
<td id=c>
|
3351
|
<span class=tx> 
|
3352
|
</span></td>
|
3353
|
</tr>
|
3354
|
<tr>
|
3355
|
<td id=c>
|
3356
|
<span class=tx> "condition type in ecogrid query");</span></td>
|
3357
|
<td id=sp>.</td>
|
3358
|
<td id=c>
|
3359
|
<span class=tx> </span></td>
|
3360
|
</tr>
|
3361
|
<tr>
|
3362
|
<td id=c>
|
3363
|
<span class=tx> }</span></td>
|
3364
|
<td id=sp>.</td>
|
3365
|
<td id=c>
|
3366
|
<span class=tx> </span></td>
|
3367
|
</tr>
|
3368
|
<tr>
|
3369
|
<td id=c>
|
3370
|
<span class=tx> else if (value == null || value.trim().equals(""))</span></td>
|
3371
|
<td id=sp>.</td>
|
3372
|
<td id=c>
|
3373
|
<span class=tx> </span></td>
|
3374
|
</tr>
|
3375
|
<tr>
|
3376
|
<td id=c>
|
3377
|
<span class=tx> {</span></td>
|
3378
|
<td id=sp>.</td>
|
3379
|
<td id=c>
|
3380
|
<span class=tx> </span></td>
|
3381
|
</tr>
|
3382
|
<tr>
|
3383
|
<td id=c>
|
3384
|
<span class=tx> throw new InvalidEcogridQueryException("Should set up search value in "
|
3385
|
+</span></td>
|
3386
|
<td id=sp>.</td>
|
3387
|
<td id=c>
|
3388
|
<span class=tx> 
|
3389
|
</span></td>
|
3390
|
</tr>
|
3391
|
<tr>
|
3392
|
<td id=c>
|
3393
|
<span class=tx> "condition type in ecogrid query");</span></td>
|
3394
|
<td id=sp>.</td>
|
3395
|
<td id=c>
|
3396
|
<span class=tx> </span></td>
|
3397
|
</tr>
|
3398
|
<tr>
|
3399
|
<td id=c>
|
3400
|
<span class=tx> }</span></td>
|
3401
|
<td id=sp>.</td>
|
3402
|
<td id=c>
|
3403
|
<span class=tx> </span></td>
|
3404
|
</tr>
|
3405
|
<tr><td id=sk>Skipping to line 163</td><td id=sp>.</td><td id=sk> </td></tr>
|
3406
|
<tr>
|
3407
|
<td id=white>
|
3408
|
<span class=tx> </span></td>
|
3409
|
<td id=sp>.</td>
|
3410
|
<td id=white>
|
3411
|
<span class=tx> </span></td>
|
3412
|
</tr>
|
3413
|
<tr>
|
3414
|
<td id=c>
|
3415
|
<a name="change16"></a><span class=tx> // replace the value by search value if this value in replacementMap</span></td>
|
3416
|
<td id=sp>.</td>
|
3417
|
<td id=c>
|
3418
|
<span class=tx> try {</span></td>
|
3419
|
</tr>
|
3420
|
<tr>
|
3421
|
<td id=c>
|
3422
|
<span class=tx> if(replacementMap.containsKey(value))</span></td>
|
3423
|
<td id=sp>.</td>
|
3424
|
<td id=c>
|
3425
|
<span class=tx> EcogridQueryParser queryParser = new EcogridQueryParser(queryNode);</span></td>
|
3426
|
</tr>
|
3427
|
<tr>
|
3428
|
<td id=c>
|
3429
|
<span class=tx> {</span></td>
|
3430
|
<td id=sp>.</td>
|
3431
|
<td id=c>
|
3432
|
<span class=tx> queryParser.parseXML();</span></td>
|
3433
|
</tr>
|
3434
|
<tr>
|
3435
|
<td id=c>
|
3436
|
<span class=tx> dbg.print("replace " + value + " by ", 2 );</span></td>
|
3437
|
<td id=sp>.</td>
|
3438
|
<td id=c>
|
3439
|
<span class=tx> _query = queryParser.getEcogridQuery();</span></td>
|
3440
|
</tr>
|
3441
|
<tr>
|
3442
|
<td id=c>
|
3443
|
<span class=tx> value = (String)replacementMap.get(value);</span></td>
|
3444
|
<td id=sp>.</td>
|
3445
|
<td id=c>
|
3446
|
<span class=tx> //System.out.println(EcogridQueryTransformer.toXMLString(query));</span></td>
|
3447
|
</tr>
|
3448
|
<tr>
|
3449
|
<td id=c>
|
3450
|
<span class=tx> dbg.print(" new value "+ value, 2);</span></td>
|
3451
|
<td id=sp>.</td>
|
3452
|
<td id=c>
|
3453
|
<span class=tx> } catch (Exception e)</span></td>
|
3454
|
</tr>
|
3455
|
<tr>
|
3456
|
<td id=c>
|
3457
|
<span class=tx> </span></td>
|
3458
|
<td id=sp>.</td>
|
3459
|
<td id=c>
|
3460
|
<span class=tx> {</span></td>
|
3461
|
</tr>
|
3462
|
<tr>
|
3463
|
<td id=c>
|
3464
|
<span class=tx> </span></td>
|
3465
|
<td id=sp>.</td>
|
3466
|
<td id=c>
|
3467
|
<span class=tx> System.err.println(e);</span></td>
|
3468
|
</tr>
|
3469
|
<tr>
|
3470
|
<td id=white>
|
3471
|
<span class=tx> }</span></td>
|
3472
|
<td id=sp>.</td>
|
3473
|
<td id=white>
|
3474
|
<span class=tx> }</span></td>
|
3475
|
</tr>
|
3476
|
<tr>
|
3477
|
<td id=d>
|
3478
|
<a name="change17"></a><span class=tx> </span></td>
|
3479
|
<td id=sp>.</td>
|
3480
|
<td id=d>
|
3481
|
<span class=tx> </span></td>
|
3482
|
</tr>
|
3483
|
<tr>
|
3484
|
<td id=d>
|
3485
|
<span class=tx> // set up the limitedPathExpression (xpath)</span></td>
|
3486
|
<td id=sp>.</td>
|
3487
|
<td id=d>
|
3488
|
<span class=tx> </span></td>
|
3489
|
</tr>
|
3490
|
<tr>
|
3491
|
<td id=d>
|
3492
|
<span class=tx> LimitedXPathExpression path = new LimitedXPathExpression(concept);</span></td>
|
3493
|
<td id=sp>.</td>
|
3494
|
<td id=d>
|
3495
|
<span class=tx> </span></td>
|
3496
|
</tr>
|
3497
|
<tr>
|
3498
|
<td id=white>
|
3499
|
<span class=tx> </span></td>
|
3500
|
<td id=sp>.</td>
|
3501
|
<td id=white>
|
3502
|
<span class=tx> </span></td>
|
3503
|
</tr>
|
3504
|
<tr>
|
3505
|
<td id=c>
|
3506
|
<a name="change18"></a><span class=tx> // set up the operator</span></td>
|
3507
|
<td id=sp>.</td>
|
3508
|
<td id=c>
|
3509
|
<span class=tx>-</span></td>
|
3510
|
</tr>
|
3511
|
<tr>
|
3512
|
<td id=c>
|
3513
|
<span class=tx> OperatorType operatorType = null;</span></td>
|
3514
|
<td id=sp>.</td>
|
3515
|
<td id=c>
|
3516
|
<span class=tx> } // generateQuery</span></td>
|
3517
|
</tr>
|
3518
|
<tr>
|
3519
|
<td id=c>
|
3520
|
<span class=tx> try</span></td>
|
3521
|
<td id=sp>.</td>
|
3522
|
<td id=c>
|
3523
|
<span class=tx> </span></td>
|
3524
|
</tr>
|
3525
|
<tr>
|
3526
|
<td id=c>
|
3527
|
<span class=tx> {</span></td>
|
3528
|
<td id=sp>.</td>
|
3529
|
<td id=c>
|
3530
|
<span class=tx> </span></td>
|
3531
|
</tr>
|
3532
|
<tr>
|
3533
|
<td id=c>
|
3534
|
<span class=tx> operatorType = OperatorType.fromString(operator);</span></td>
|
3535
|
<td id=sp>.</td>
|
3536
|
<td id=c>
|
3537
|
<span class=tx> </span></td>
|
3538
|
</tr>
|
3539
|
<tr>
|
3540
|
<td id=c>
|
3541
|
<span class=tx> }</span></td>
|
3542
|
<td id=sp>.</td>
|
3543
|
<td id=c>
|
3544
|
<span class=tx> </span></td>
|
3545
|
</tr>
|
3546
|
<tr>
|
3547
|
<td id=c>
|
3548
|
<span class=tx> catch(IllegalStateException e)</span></td>
|
3549
|
<td id=sp>.</td>
|
3550
|
<td id=c>
|
3551
|
<span class=tx> </span></td>
|
3552
|
</tr>
|
3553
|
<tr>
|
3554
|
<td id=c>
|
3555
|
<span class=tx> {</span></td>
|
3556
|
<td id=sp>.</td>
|
3557
|
<td id=c>
|
3558
|
<span class=tx> </span></td>
|
3559
|
</tr>
|
3560
|
<tr>
|
3561
|
<td id=c>
|
3562
|
<span class=tx> throw new InvalidEcogridQueryException(e.getMessage());</span></td>
|
3563
|
<td id=sp>.</td>
|
3564
|
<td id=c>
|
3565
|
<span class=tx> </span></td>
|
3566
|
</tr>
|
3567
|
<tr>
|
3568
|
<td id=c>
|
3569
|
<span class=tx> }</span></td>
|
3570
|
<td id=sp>.</td>
|
3571
|
<td id=c>
|
3572
|
<span class=tx> </span></td>
|
3573
|
</tr>
|
3574
|
<tr>
|
3575
|
<td id=c>
|
3576
|
<span class=tx> </span></td>
|
3577
|
<td id=sp>.</td>
|
3578
|
<td id=c>
|
3579
|
<span class=tx> </span></td>
|
3580
|
</tr>
|
3581
|
<tr>
|
3582
|
<td id=c>
|
3583
|
<span class=tx> //set up condition type</span></td>
|
3584
|
<td id=sp>.</td>
|
3585
|
<td id=c>
|
3586
|
<span class=tx> </span></td>
|
3587
|
</tr>
|
3588
|
<tr>
|
3589
|
<td id=c>
|
3590
|
<span class=tx> ConditionType condition = new ConditionType();</span></td>
|
3591
|
<td id=sp>.</td>
|
3592
|
<td id=c>
|
3593
|
<span class=tx> </span></td>
|
3594
|
</tr>
|
3595
|
<tr>
|
3596
|
<td id=c>
|
3597
|
<span class=tx> condition.setConcept(path);</span></td>
|
3598
|
<td id=sp>.</td>
|
3599
|
<td id=c>
|
3600
|
<span class=tx> </span></td>
|
3601
|
</tr>
|
3602
|
<tr>
|
3603
|
<td id=c>
|
3604
|
<span class=tx> condition.setOperator(operatorType);</span></td>
|
3605
|
<td id=sp>.</td>
|
3606
|
<td id=c>
|
3607
|
<span class=tx> </span></td>
|
3608
|
</tr>
|
3609
|
<tr>
|
3610
|
<td id=c>
|
3611
|
<span class=tx> condition.setValue(value);</span></td>
|
3612
|
<td id=sp>.</td>
|
3613
|
<td id=c>
|
3614
|
<span class=tx> </span></td>
|
3615
|
</tr>
|
3616
|
<tr>
|
3617
|
<td id=c>
|
3618
|
<span class=tx> return condition;</span></td>
|
3619
|
<td id=sp>.</td>
|
3620
|
<td id=c>
|
3621
|
<span class=tx> </span></td>
|
3622
|
</tr>
|
3623
|
<tr>
|
3624
|
<td id=c>
|
3625
|
<span class=tx> </span></td>
|
3626
|
<td id=sp>.</td>
|
3627
|
<td id=c>
|
3628
|
<span class=tx> </span></td>
|
3629
|
</tr>
|
3630
|
<tr>
|
3631
|
<td id=c>
|
3632
|
<span class=tx> }//generateConditionType</span></td>
|
3633
|
<td id=sp>.</td>
|
3634
|
<td id=c>
|
3635
|
<span class=tx> </span></td>
|
3636
|
</tr>
|
3637
|
<tr>
|
3638
|
<td id=c>
|
3639
|
<span class=tx> </span></td>
|
3640
|
<td id=sp>.</td>
|
3641
|
<td id=c>
|
3642
|
<span class=tx> </span></td>
|
3643
|
</tr>
|
3644
|
<tr>
|
3645
|
<td id=c>
|
3646
|
<span class=tx> </span></td>
|
3647
|
<td id=sp>.</td>
|
3648
|
<td id=c>
|
3649
|
<span class=tx> </span></td>
|
3650
|
</tr>
|
3651
|
<tr>
|
3652
|
<td id=c>
|
3653
|
<span class=tx>}//SearchQueryGenerator</span></td>
|
3654
|
<td id=sp>.</td>
|
3655
|
<td id=c>
|
3656
|
<span class=tx> </span></td>
|
3657
|
</tr>
|
3658
|
</table></body></html>
|