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="EcogridQueryParser.java"></a>EcogridQueryParser.java - Revision 1.3</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>EcogridQueryParser.java,1.3</center></td><td id=sp>.</td><td id=title><center>Disk File</center></td></tr>
|
56
|
<tr><td id=sk>Skipping to line 52</td><td id=sp>.</td><td id=sk> </td></tr>
|
57
|
<tr>
|
58
|
<td id=white>
|
59
|
<span class=tx> * A class to parse ecogrid xml query document to java object</span></td>
|
60
|
<td id=sp>.</td>
|
61
|
<td id=white>
|
62
|
<span class=tx> * A class to parse ecogrid xml query document to java object</span></td>
|
63
|
</tr>
|
64
|
<tr>
|
65
|
<td id=white>
|
66
|
<span class=tx> */</span></td>
|
67
|
<td id=sp>.</td>
|
68
|
<td id=white>
|
69
|
<span class=tx> */</span></td>
|
70
|
</tr>
|
71
|
<tr>
|
72
|
<td id=white>
|
73
|
<span class=tx>public class EcogridQueryParser</span></td>
|
74
|
<td id=sp>.</td>
|
75
|
<td id=white>
|
76
|
<span class=tx>public class EcogridQueryParser</span></td>
|
77
|
</tr>
|
78
|
<tr>
|
79
|
<td id=white>
|
80
|
<span class=tx>{</span></td>
|
81
|
<td id=sp>.</td>
|
82
|
<td id=white>
|
83
|
<span class=tx>{</span></td>
|
84
|
</tr>
|
85
|
<tr>
|
86
|
<td id=white>
|
87
|
<span class=tx> //fields</span></td>
|
88
|
<td id=sp>.</td>
|
89
|
<td id=white>
|
90
|
<span class=tx> //fields</span></td>
|
91
|
</tr>
|
92
|
<tr>
|
93
|
<td id=c>
|
94
|
<a name="change0"></a><span class=tx> private QueryType ecogridQuery;</span></td>
|
95
|
<td id=sp>.</td>
|
96
|
<td id=c>
|
97
|
<span class=tx> private QueryType _ecogridQuery;</span></td>
|
98
|
</tr>
|
99
|
<tr>
|
100
|
<td id=c>
|
101
|
<span class=tx> private Document doc;</span></td>
|
102
|
<td id=sp>.</td>
|
103
|
<td id=c>
|
104
|
<span class=tx> private Node _queryNode;</span></td>
|
105
|
</tr>
|
106
|
<tr>
|
107
|
<td id=c>
|
108
|
<span class=tx> </span></td>
|
109
|
<td id=sp>.</td>
|
110
|
<td id=c>
|
111
|
<span class=tx> </span></td>
|
112
|
</tr>
|
113
|
<tr>
|
114
|
<td id=white>
|
115
|
<span class=tx> //Constant</span></td>
|
116
|
<td id=sp>.</td>
|
117
|
<td id=white>
|
118
|
<span class=tx> //Constant</span></td>
|
119
|
</tr>
|
120
|
<tr>
|
121
|
<td id=c>
|
122
|
<a name="change1"></a><span class=tx> private static final String QUERYIDATTRIBUTE = "/query/@queryId";</span></td>
|
123
|
<td id=sp>.</td>
|
124
|
<td id=c>
|
125
|
<span class=tx> private static final String QUERYIDATTRIBUTE = "@queryId";</span></td>
|
126
|
</tr>
|
127
|
<tr>
|
128
|
<td id=c>
|
129
|
<span class=tx> private static final String SYSTEMATTRIBUTE = "/query/@system";</span></td>
|
130
|
<td id=sp>.</td>
|
131
|
<td id=c>
|
132
|
<span class=tx> private static final String SYSTEMATTRIBUTE = "@system";</span></td>
|
133
|
</tr>
|
134
|
<tr>
|
135
|
<td id=c>
|
136
|
<span class=tx> private static final String NAMESPACE = "/query/namespace";</span></td>
|
137
|
<td id=sp>.</td>
|
138
|
<td id=c>
|
139
|
<span class=tx> private static final String NAMESPACE = "namespace";</span></td>
|
140
|
</tr>
|
141
|
<tr>
|
142
|
<td id=c>
|
143
|
<span class=tx> private static final String PREFIX = "prefix";</span></td>
|
144
|
<td id=sp>.</td>
|
145
|
<td id=c>
|
146
|
<span class=tx> private static final String PREFIX = "prefix";</span></td>
|
147
|
</tr>
|
148
|
<tr>
|
149
|
<td id=c>
|
150
|
<span class=tx> private static final String RETURNFIELD = "/query/returnfield";</span></td>
|
151
|
<td id=sp>.</td>
|
152
|
<td id=c>
|
153
|
<span class=tx> private static final String RETURNFIELD = "returnField";</span></td>
|
154
|
</tr>
|
155
|
<tr>
|
156
|
<td id=c>
|
157
|
<span class=tx> private static final String TITLE = "/query/title";</span></td>
|
158
|
<td id=sp>.</td>
|
159
|
<td id=c>
|
160
|
<span class=tx> private static final String TITLE = "title";</span></td>
|
161
|
</tr>
|
162
|
<tr>
|
163
|
<td id=c>
|
164
|
<span class=tx> private static final String FIRSTAND = "/query/AND";</span></td>
|
165
|
<td id=sp>.</td>
|
166
|
<td id=c>
|
167
|
<span class=tx> private static final String FIRSTAND = "AND";</span></td>
|
168
|
</tr>
|
169
|
<tr>
|
170
|
<td id=c>
|
171
|
<span class=tx> private static final String FIRSTOR = "/query/OR";</span></td>
|
172
|
<td id=sp>.</td>
|
173
|
<td id=c>
|
174
|
<span class=tx> private static final String FIRSTOR = "OR";</span></td>
|
175
|
</tr>
|
176
|
<tr>
|
177
|
<td id=c>
|
178
|
<span class=tx> private static final String FIRSTCONDITION = "/query/condition";</span></td>
|
179
|
<td id=sp>.</td>
|
180
|
<td id=c>
|
181
|
<span class=tx> private static final String FIRSTCONDITION = "condition";</span></td>
|
182
|
</tr>
|
183
|
<tr>
|
184
|
<td id=c>
|
185
|
<span class=tx> private static final String AND = "AND";</span></td>
|
186
|
<td id=sp>.</td>
|
187
|
<td id=c>
|
188
|
<span class=tx> private static final String AND = "AND";</span></td>
|
189
|
</tr>
|
190
|
<tr>
|
191
|
<td id=c>
|
192
|
<span class=tx> private static final String OR = "OR";</span></td>
|
193
|
<td id=sp>.</td>
|
194
|
<td id=c>
|
195
|
<span class=tx> private static final String OR = "OR";</span></td>
|
196
|
</tr>
|
197
|
<tr>
|
198
|
<td id=c>
|
199
|
<span class=tx> private static final String CON = "condition";</span></td>
|
200
|
<td id=sp>.</td>
|
201
|
<td id=c>
|
202
|
<span class=tx> private static final String CON = "condition";</span></td>
|
203
|
</tr>
|
204
|
<tr>
|
205
|
<td id=c>
|
206
|
<span class=tx> private static final String OPERATOR = "operator";</span></td>
|
207
|
<td id=sp>.</td>
|
208
|
<td id=c>
|
209
|
<span class=tx> private static final String OPERATOR = "operator";</span></td>
|
210
|
</tr>
|
211
|
<tr>
|
212
|
<td id=c>
|
213
|
<span class=tx> private static final String CONCEPT = "concept";</span></td>
|
214
|
<td id=sp>.</td>
|
215
|
<td id=c>
|
216
|
<span class=tx> private static final String CONCEPT = "concept";</span></td>
|
217
|
</tr>
|
218
|
<tr>
|
219
|
<td id=c>
|
220
|
<span class=tx> </span></td>
|
221
|
<td id=sp>.</td>
|
222
|
<td id=c>
|
223
|
<span class=tx> </span></td>
|
224
|
</tr>
|
225
|
<tr>
|
226
|
<td id=white>
|
227
|
<span class=tx> /**</span></td>
|
228
|
<td id=sp>.</td>
|
229
|
<td id=white>
|
230
|
<span class=tx> /**</span></td>
|
231
|
</tr>
|
232
|
<tr>
|
233
|
<td id=c>
|
234
|
<a name="change2"></a><span class=tx> * default constructor</span></td>
|
235
|
<td id=sp>.</td>
|
236
|
<td id=c>
|
237
|
<span class=tx> * Constructor with reader for parsing XML</span></td>
|
238
|
</tr>
|
239
|
<tr>
|
240
|
<td id=white>
|
241
|
<span class=tx> * @param xmlInput xml source</span></td>
|
242
|
<td id=sp>.</td>
|
243
|
<td id=white>
|
244
|
<span class=tx> * @param xmlInput xml source</span></td>
|
245
|
</tr>
|
246
|
<tr>
|
247
|
<td id=white>
|
248
|
<span class=tx> */</span></td>
|
249
|
<td id=sp>.</td>
|
250
|
<td id=white>
|
251
|
<span class=tx> */</span></td>
|
252
|
</tr>
|
253
|
<tr>
|
254
|
<td id=white>
|
255
|
<span class=tx> public EcogridQueryParser (Reader xmlInput) throws Exception</span></td>
|
256
|
<td id=sp>.</td>
|
257
|
<td id=white>
|
258
|
<span class=tx> public EcogridQueryParser (Reader xmlInput) throws Exception</span></td>
|
259
|
</tr>
|
260
|
<tr>
|
261
|
<td id=white>
|
262
|
<span class=tx> {</span></td>
|
263
|
<td id=sp>.</td>
|
264
|
<td id=white>
|
265
|
<span class=tx> {</span></td>
|
266
|
</tr>
|
267
|
<tr>
|
268
|
<td id=white>
|
269
|
<span class=tx> //create new ecogrid query java object</span></td>
|
270
|
<td id=sp>.</td>
|
271
|
<td id=white>
|
272
|
<span class=tx> //create new ecogrid query java object</span></td>
|
273
|
</tr>
|
274
|
<tr>
|
275
|
<td id=c>
|
276
|
<a name="change3"></a><span class=tx> ecogridQuery = new QueryType();</span></td>
|
277
|
<td id=sp>.</td>
|
278
|
<td id=c>
|
279
|
<span class=tx> _ecogridQuery = new QueryType();</span></td>
|
280
|
</tr>
|
281
|
<tr><td id=sk>Skipping to line 84</td><td id=sp>.</td><td id=sk> </td></tr>
|
282
|
<tr>
|
283
|
<td id=white>
|
284
|
<span class=tx> //build dom tree</span></td>
|
285
|
<td id=sp>.</td>
|
286
|
<td id=white>
|
287
|
<span class=tx> //build dom tree</span></td>
|
288
|
</tr>
|
289
|
<tr>
|
290
|
<td id=white>
|
291
|
<span class=tx> InputSource in = new InputSource(xmlInput);</span></td>
|
292
|
<td id=sp>.</td>
|
293
|
<td id=white>
|
294
|
<span class=tx> InputSource in = new InputSource(xmlInput);</span></td>
|
295
|
</tr>
|
296
|
<tr>
|
297
|
<td id=white>
|
298
|
<span class=tx> DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();</span></td>
|
299
|
<td id=sp>.</td>
|
300
|
<td id=white>
|
301
|
<span class=tx> DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();</span></td>
|
302
|
</tr>
|
303
|
<tr>
|
304
|
<td id=white>
|
305
|
<span class=tx> dfactory.setNamespaceAware(false);</span></td>
|
306
|
<td id=sp>.</td>
|
307
|
<td id=white>
|
308
|
<span class=tx> dfactory.setNamespaceAware(false);</span></td>
|
309
|
</tr>
|
310
|
<tr>
|
311
|
<td id=c>
|
312
|
<a name="change4"></a><span class=tx> doc = dfactory.newDocumentBuilder().parse(in);</span></td>
|
313
|
<td id=sp>.</td>
|
314
|
<td id=c>
|
315
|
<span class=tx> Document doc = dfactory.newDocumentBuilder().parse(in);</span></td>
|
316
|
</tr>
|
317
|
<tr>
|
318
|
<td id=c>
|
319
|
<span class=tx> }//EcogridQueryParser</span></td>
|
320
|
<td id=sp>.</td>
|
321
|
<td id=c>
|
322
|
<span class=tx> </span></td>
|
323
|
</tr>
|
324
|
<tr>
|
325
|
<td id=c>
|
326
|
<span class=tx> </span></td>
|
327
|
<td id=sp>.</td>
|
328
|
<td id=c>
|
329
|
<span class=tx> // Find the query node, all searches are relative to it.</span></td>
|
330
|
</tr>
|
331
|
<tr>
|
332
|
<td id=c>
|
333
|
<span class=tx> </span></td>
|
334
|
<td id=sp>.</td>
|
335
|
<td id=c>
|
336
|
<span class=tx> NodeList queryIdList = XPathAPI.selectNodeList(doc, "/query");</span></td>
|
337
|
</tr>
|
338
|
<tr>
|
339
|
<td id=c>
|
340
|
<span class=tx> </span></td>
|
341
|
<td id=sp>.</td>
|
342
|
<td id=c>
|
343
|
<span class=tx> _queryNode = queryIdList.item(0);</span></td>
|
344
|
</tr>
|
345
|
<tr>
|
346
|
<td id=c>
|
347
|
<span class=tx> </span></td>
|
348
|
<td id=sp>.</td>
|
349
|
<td id=c>
|
350
|
<span class=tx> </span></td>
|
351
|
</tr>
|
352
|
<tr>
|
353
|
<td id=c>
|
354
|
<span class=tx> </span></td>
|
355
|
<td id=sp>.</td>
|
356
|
<td id=c>
|
357
|
<span class=tx> } //EcogridQueryParser</span></td>
|
358
|
</tr>
|
359
|
<tr>
|
360
|
<td id=c>
|
361
|
<span class=tx> </span></td>
|
362
|
<td id=sp>.</td>
|
363
|
<td id=c>
|
364
|
<span class=tx> </span></td>
|
365
|
</tr>
|
366
|
<tr>
|
367
|
<td id=c>
|
368
|
<span class=tx> </span></td>
|
369
|
<td id=sp>.</td>
|
370
|
<td id=c>
|
371
|
<span class=tx> /**</span></td>
|
372
|
</tr>
|
373
|
<tr>
|
374
|
<td id=c>
|
375
|
<span class=tx> </span></td>
|
376
|
<td id=sp>.</td>
|
377
|
<td id=c>
|
378
|
<span class=tx> * Constructor wityh DOM node point to Query node</span></td>
|
379
|
</tr>
|
380
|
<tr>
|
381
|
<td id=c>
|
382
|
<span class=tx> </span></td>
|
383
|
<td id=sp>.</td>
|
384
|
<td id=c>
|
385
|
<span class=tx> * @param aQueryDOMNode DOM Node</span></td>
|
386
|
</tr>
|
387
|
<tr>
|
388
|
<td id=c>
|
389
|
<span class=tx> </span></td>
|
390
|
<td id=sp>.</td>
|
391
|
<td id=c>
|
392
|
<span class=tx> */</span></td>
|
393
|
</tr>
|
394
|
<tr>
|
395
|
<td id=c>
|
396
|
<span class=tx> </span></td>
|
397
|
<td id=sp>.</td>
|
398
|
<td id=c>
|
399
|
<span class=tx> public EcogridQueryParser (Node aQueryDOMNode)</span></td>
|
400
|
</tr>
|
401
|
<tr>
|
402
|
<td id=c>
|
403
|
<span class=tx> </span></td>
|
404
|
<td id=sp>.</td>
|
405
|
<td id=c>
|
406
|
<span class=tx> {</span></td>
|
407
|
</tr>
|
408
|
<tr>
|
409
|
<td id=c>
|
410
|
<span class=tx> </span></td>
|
411
|
<td id=sp>.</td>
|
412
|
<td id=c>
|
413
|
<span class=tx> //create new ecogrid query java object</span></td>
|
414
|
</tr>
|
415
|
<tr>
|
416
|
<td id=c>
|
417
|
<span class=tx> </span></td>
|
418
|
<td id=sp>.</td>
|
419
|
<td id=c>
|
420
|
<span class=tx> _ecogridQuery = new QueryType();</span></td>
|
421
|
</tr>
|
422
|
<tr>
|
423
|
<td id=c>
|
424
|
<span class=tx> </span></td>
|
425
|
<td id=sp>.</td>
|
426
|
<td id=c>
|
427
|
<span class=tx> _queryNode = aQueryDOMNode;</span></td>
|
428
|
</tr>
|
429
|
<tr>
|
430
|
<td id=c>
|
431
|
<span class=tx> </span></td>
|
432
|
<td id=sp>.</td>
|
433
|
<td id=c>
|
434
|
<span class=tx> } //EcogridQueryParser</span></td>
|
435
|
</tr>
|
436
|
<tr>
|
437
|
<td id=white>
|
438
|
<span class=tx> </span></td>
|
439
|
<td id=sp>.</td>
|
440
|
<td id=white>
|
441
|
<span class=tx> </span></td>
|
442
|
</tr>
|
443
|
<tr>
|
444
|
<td id=white>
|
445
|
<span class=tx> /**</span></td>
|
446
|
<td id=sp>.</td>
|
447
|
<td id=white>
|
448
|
<span class=tx> /**</span></td>
|
449
|
</tr>
|
450
|
<tr>
|
451
|
<td id=white>
|
452
|
<span class=tx> * Method to get ecogridquery</span></td>
|
453
|
<td id=sp>.</td>
|
454
|
<td id=white>
|
455
|
<span class=tx> * Method to get ecogridquery</span></td>
|
456
|
</tr>
|
457
|
<tr>
|
458
|
<td id=white>
|
459
|
<span class=tx> */</span></td>
|
460
|
<td id=sp>.</td>
|
461
|
<td id=white>
|
462
|
<span class=tx> */</span></td>
|
463
|
</tr>
|
464
|
<tr>
|
465
|
<td id=white>
|
466
|
<span class=tx> public QueryType getEcogridQuery()</span></td>
|
467
|
<td id=sp>.</td>
|
468
|
<td id=white>
|
469
|
<span class=tx> public QueryType getEcogridQuery()</span></td>
|
470
|
</tr>
|
471
|
<tr><td id=sk>Skipping to line 112</td><td id=sp>.</td><td id=sk> </td></tr>
|
472
|
<tr>
|
473
|
<td id=c>
|
474
|
<a name="change5"></a><span class=tx> return ecogridQuery;</span></td>
|
475
|
<td id=sp>.</td>
|
476
|
<td id=c>
|
477
|
<span class=tx> return _ecogridQuery;</span></td>
|
478
|
</tr>
|
479
|
<tr>
|
480
|
<td id=white>
|
481
|
<span class=tx> }</span></td>
|
482
|
<td id=sp>.</td>
|
483
|
<td id=white>
|
484
|
<span class=tx> }</span></td>
|
485
|
</tr>
|
486
|
<tr>
|
487
|
<td id=white>
|
488
|
<span class=tx> </span></td>
|
489
|
<td id=sp>.</td>
|
490
|
<td id=white>
|
491
|
<span class=tx> </span></td>
|
492
|
</tr>
|
493
|
<tr>
|
494
|
<td id=white>
|
495
|
<span class=tx> /**</span></td>
|
496
|
<td id=sp>.</td>
|
497
|
<td id=white>
|
498
|
<span class=tx> /**</span></td>
|
499
|
</tr>
|
500
|
<tr>
|
501
|
<td id=white>
|
502
|
<span class=tx> * Method to set ecogrid query</span></td>
|
503
|
<td id=sp>.</td>
|
504
|
<td id=white>
|
505
|
<span class=tx> * Method to set ecogrid query</span></td>
|
506
|
</tr>
|
507
|
<tr>
|
508
|
<td id=white>
|
509
|
<span class=tx> */</span></td>
|
510
|
<td id=sp>.</td>
|
511
|
<td id=white>
|
512
|
<span class=tx> */</span></td>
|
513
|
</tr>
|
514
|
<tr><td id=sk>Skipping to line 119</td><td id=sp>.</td><td id=sk> </td></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=c>
|
524
|
<a name="change6"></a><span class=tx> ecogridQuery = query;</span></td>
|
525
|
<td id=sp>.</td>
|
526
|
<td id=c>
|
527
|
<span class=tx> _ecogridQuery = query;</span></td>
|
528
|
</tr>
|
529
|
<tr>
|
530
|
<td id=white>
|
531
|
<span class=tx> }</span></td>
|
532
|
<td id=sp>.</td>
|
533
|
<td id=white>
|
534
|
<span class=tx> }</span></td>
|
535
|
</tr>
|
536
|
<tr>
|
537
|
<td id=white>
|
538
|
<span class=tx> </span></td>
|
539
|
<td id=sp>.</td>
|
540
|
<td id=white>
|
541
|
<span class=tx> </span></td>
|
542
|
</tr>
|
543
|
<tr>
|
544
|
<td id=white>
|
545
|
<span class=tx> /**</span></td>
|
546
|
<td id=sp>.</td>
|
547
|
<td id=white>
|
548
|
<span class=tx> /**</span></td>
|
549
|
</tr>
|
550
|
<tr>
|
551
|
<td id=white>
|
552
|
<span class=tx> *Method set up ecogrid query object by parsing xml</span></td>
|
553
|
<td id=sp>.</td>
|
554
|
<td id=white>
|
555
|
<span class=tx> *Method set up ecogrid query object by parsing xml</span></td>
|
556
|
</tr>
|
557
|
<tr>
|
558
|
<td id=white>
|
559
|
<span class=tx> */</span></td>
|
560
|
<td id=sp>.</td>
|
561
|
<td id=white>
|
562
|
<span class=tx> */</span></td>
|
563
|
</tr>
|
564
|
<tr><td id=sk>Skipping to line 130</td><td id=sp>.</td><td id=sk> </td></tr>
|
565
|
<tr>
|
566
|
<td id=white>
|
567
|
<span class=tx> setupReturnField();</span></td>
|
568
|
<td id=sp>.</td>
|
569
|
<td id=white>
|
570
|
<span class=tx> setupReturnField();</span></td>
|
571
|
</tr>
|
572
|
<tr>
|
573
|
<td id=white>
|
574
|
<span class=tx> setupTitle();</span></td>
|
575
|
<td id=sp>.</td>
|
576
|
<td id=white>
|
577
|
<span class=tx> setupTitle();</span></td>
|
578
|
</tr>
|
579
|
<tr>
|
580
|
<td id=white>
|
581
|
<span class=tx> setupFirstRelation();</span></td>
|
582
|
<td id=sp>.</td>
|
583
|
<td id=white>
|
584
|
<span class=tx> setupFirstRelation();</span></td>
|
585
|
</tr>
|
586
|
<tr>
|
587
|
<td id=white>
|
588
|
<span class=tx> }//parseXML</span></td>
|
589
|
<td id=sp>.</td>
|
590
|
<td id=white>
|
591
|
<span class=tx> }//parseXML</span></td>
|
592
|
</tr>
|
593
|
<tr>
|
594
|
<td id=white>
|
595
|
<span class=tx> </span></td>
|
596
|
<td id=sp>.</td>
|
597
|
<td id=white>
|
598
|
<span class=tx> </span></td>
|
599
|
</tr>
|
600
|
<tr>
|
601
|
<td id=c>
|
602
|
<a name="change7"></a><span class=tx> </span></td>
|
603
|
<td id=sp>.</td>
|
604
|
<td id=c>
|
605
|
<span class=tx> private Node getAttrNode(String aDocXPath, String aNodeXPath)</span></td>
|
606
|
</tr>
|
607
|
<tr>
|
608
|
<td id=c>
|
609
|
<span class=tx> </span></td>
|
610
|
<td id=sp>.</td>
|
611
|
<td id=c>
|
612
|
<span class=tx> {</span></td>
|
613
|
</tr>
|
614
|
<tr>
|
615
|
<td id=c>
|
616
|
<span class=tx> </span></td>
|
617
|
<td id=sp>.</td>
|
618
|
<td id=c>
|
619
|
<span class=tx> Node node = _queryNode;</span></td>
|
620
|
</tr>
|
621
|
<tr>
|
622
|
<td id=c>
|
623
|
<span class=tx> </span></td>
|
624
|
<td id=sp>.</td>
|
625
|
<td id=c>
|
626
|
<span class=tx> try </span></td>
|
627
|
</tr>
|
628
|
<tr>
|
629
|
<td id=c>
|
630
|
<span class=tx> </span></td>
|
631
|
<td id=sp>.</td>
|
632
|
<td id=c>
|
633
|
<span class=tx> {</span></td>
|
634
|
</tr>
|
635
|
<tr>
|
636
|
<td id=c>
|
637
|
<span class=tx> </span></td>
|
638
|
<td id=sp>.</td>
|
639
|
<td id=c>
|
640
|
<span class=tx> if (_queryNode.getNodeType() == Node.DOCUMENT_NODE)</span></td>
|
641
|
</tr>
|
642
|
<tr>
|
643
|
<td id=c>
|
644
|
<span class=tx> </span></td>
|
645
|
<td id=sp>.</td>
|
646
|
<td id=c>
|
647
|
<span class=tx> {</span></td>
|
648
|
</tr>
|
649
|
<tr>
|
650
|
<td id=c>
|
651
|
<span class=tx> 
|
652
|
</span></td>
|
653
|
<td id=sp>.</td>
|
654
|
<td id=c>
|
655
|
<span class=tx> NodeList queryIdList = XPathAPI.selectNodeList(_queryNode, aDocXP
|
656
|
ath);</span></td>
|
657
|
</tr>
|
658
|
<tr>
|
659
|
<td id=c>
|
660
|
<span class=tx> </span></td>
|
661
|
<td id=sp>.</td>
|
662
|
<td id=c>
|
663
|
<span class=tx> node = queryIdList.item(0);</span></td>
|
664
|
</tr>
|
665
|
<tr>
|
666
|
<td id=c>
|
667
|
<span class=tx> </span></td>
|
668
|
<td id=sp>.</td>
|
669
|
<td id=c>
|
670
|
<span class=tx> }</span></td>
|
671
|
</tr>
|
672
|
<tr>
|
673
|
<td id=c>
|
674
|
<span class=tx> </span></td>
|
675
|
<td id=sp>.</td>
|
676
|
<td id=c>
|
677
|
<span class=tx> else</span></td>
|
678
|
</tr>
|
679
|
<tr>
|
680
|
<td id=c>
|
681
|
<span class=tx> </span></td>
|
682
|
<td id=sp>.</td>
|
683
|
<td id=c>
|
684
|
<span class=tx> {</span></td>
|
685
|
</tr>
|
686
|
<tr>
|
687
|
<td id=c>
|
688
|
<span class=tx> 
|
689
|
</span></td>
|
690
|
<td id=sp>.</td>
|
691
|
<td id=c>
|
692
|
<span class=tx> NodeList queryIdList = XPathAPI.selectNodeList(_queryNode, aNod
|
693
|
eXPath);</span></td>
|
694
|
</tr>
|
695
|
<tr>
|
696
|
<td id=c>
|
697
|
<span class=tx> </span></td>
|
698
|
<td id=sp>.</td>
|
699
|
<td id=c>
|
700
|
<span class=tx> node = queryIdList.item(0);</span></td>
|
701
|
</tr>
|
702
|
<tr>
|
703
|
<td id=c>
|
704
|
<span class=tx> </span></td>
|
705
|
<td id=sp>.</td>
|
706
|
<td id=c>
|
707
|
<span class=tx> }</span></td>
|
708
|
</tr>
|
709
|
<tr>
|
710
|
<td id=c>
|
711
|
<span class=tx> </span></td>
|
712
|
<td id=sp>.</td>
|
713
|
<td id=c>
|
714
|
<span class=tx> } catch (Exception e)</span></td>
|
715
|
</tr>
|
716
|
<tr>
|
717
|
<td id=c>
|
718
|
<span class=tx> </span></td>
|
719
|
<td id=sp>.</td>
|
720
|
<td id=c>
|
721
|
<span class=tx> {</span></td>
|
722
|
</tr>
|
723
|
<tr>
|
724
|
<td id=c>
|
725
|
<span class=tx> </span></td>
|
726
|
<td id=sp>.</td>
|
727
|
<td id=c>
|
728
|
<span class=tx> System.err.println(e);</span></td>
|
729
|
</tr>
|
730
|
<tr>
|
731
|
<td id=c>
|
732
|
<span class=tx> </span></td>
|
733
|
<td id=sp>.</td>
|
734
|
<td id=c>
|
735
|
<span class=tx> }</span></td>
|
736
|
</tr>
|
737
|
<tr>
|
738
|
<td id=c>
|
739
|
<span class=tx> </span></td>
|
740
|
<td id=sp>.</td>
|
741
|
<td id=c>
|
742
|
<span class=tx> return node;</span></td>
|
743
|
</tr>
|
744
|
<tr>
|
745
|
<td id=c>
|
746
|
<span class=tx> </span></td>
|
747
|
<td id=sp>.</td>
|
748
|
<td id=c>
|
749
|
<span class=tx> }</span></td>
|
750
|
</tr>
|
751
|
<tr>
|
752
|
<td id=white>
|
753
|
<span class=tx> /* setup queryid and system */</span></td>
|
754
|
<td id=sp>.</td>
|
755
|
<td id=white>
|
756
|
<span class=tx> /* setup queryid and system */</span></td>
|
757
|
</tr>
|
758
|
<tr>
|
759
|
<td id=white>
|
760
|
<span class=tx> private void setupQueryIdAndSystem() throws Exception</span></td>
|
761
|
<td id=sp>.</td>
|
762
|
<td id=white>
|
763
|
<span class=tx> private void setupQueryIdAndSystem() throws Exception</span></td>
|
764
|
</tr>
|
765
|
<tr>
|
766
|
<td id=white>
|
767
|
<span class=tx> {</span></td>
|
768
|
<td id=sp>.</td>
|
769
|
<td id=white>
|
770
|
<span class=tx> {</span></td>
|
771
|
</tr>
|
772
|
<tr>
|
773
|
<td id=a>
|
774
|
<a name="change8"></a><span class=tx> 
|
775
|
</span></td>
|
776
|
<td id=sp>.</td>
|
777
|
<td id=a>
|
778
|
<span class=tx> // The _queryNode may be a document node qparsed in from an XML document
|
779
|
or may be</span></td>
|
780
|
</tr>
|
781
|
<tr>
|
782
|
<td id=a>
|
783
|
<span class=tx> </span></td>
|
784
|
<td id=sp>.</td>
|
785
|
<td id=a>
|
786
|
<span class=tx> // a generic DOM node (a subtree) of an existing tree</span></td>
|
787
|
</tr>
|
788
|
<tr>
|
789
|
<td id=white>
|
790
|
<span class=tx> // get query id</span></td>
|
791
|
<td id=sp>.</td>
|
792
|
<td id=white>
|
793
|
<span class=tx> // get query id</span></td>
|
794
|
</tr>
|
795
|
<tr>
|
796
|
<td id=c>
|
797
|
<a name="change9"></a><span class=tx> NodeList queryIdList = XPathAPI.selectNodeList(doc, QUERYIDATTRIBUTE);
|
798
|
</span></td>
|
799
|
<td id=sp>.</td>
|
800
|
<td id=c>
|
801
|
<span class=tx> NodeList queryIdList = XPathAPI.selectNodeList(_queryNode, QUERYIDATTRIBU
|
802
|
TE);</span></td>
|
803
|
</tr>
|
804
|
<tr>
|
805
|
<td id=c>
|
806
|
<span class=tx> String queryId = (queryIdList.item(0)).getNodeValue();</span></td>
|
807
|
<td id=sp>.</td>
|
808
|
<td id=c>
|
809
|
<span class=tx> String queryId = ((Node)queryIdList.item(0)).getNodeValue();</span></td>
|
810
|
</tr>
|
811
|
<tr>
|
812
|
<td id=c>
|
813
|
<span class=tx> </span></td>
|
814
|
<td id=sp>.</td>
|
815
|
<td id=c>
|
816
|
<span class=tx> </span></td>
|
817
|
</tr>
|
818
|
<tr>
|
819
|
<td id=white>
|
820
|
<span class=tx> //System.out.println("queryId is: "+ queryId);</span></td>
|
821
|
<td id=sp>.</td>
|
822
|
<td id=white>
|
823
|
<span class=tx> //System.out.println("queryId is: "+ queryId);</span></td>
|
824
|
</tr>
|
825
|
<tr>
|
826
|
<td id=white>
|
827
|
<span class=tx> // set query id</span></td>
|
828
|
<td id=sp>.</td>
|
829
|
<td id=white>
|
830
|
<span class=tx> // set query id</span></td>
|
831
|
</tr>
|
832
|
<tr>
|
833
|
<td id=c>
|
834
|
<a name="change10"></a><span class=tx> ecogridQuery.setQueryId(queryId);</span></td>
|
835
|
<td id=sp>.</td>
|
836
|
<td id=c>
|
837
|
<span class=tx> _ecogridQuery.setQueryId(queryId);</span></td>
|
838
|
</tr>
|
839
|
<tr>
|
840
|
<td id=white>
|
841
|
<span class=tx> // get system</span></td>
|
842
|
<td id=sp>.</td>
|
843
|
<td id=white>
|
844
|
<span class=tx> // get system</span></td>
|
845
|
</tr>
|
846
|
<tr>
|
847
|
<td id=c>
|
848
|
<a name="change11"></a><span class=tx> NodeList systemList = XPathAPI.selectNodeList(doc, SYSTEMATTRIBUTE);
|
849
|
</span></td>
|
850
|
<td id=sp>.</td>
|
851
|
<td id=c>
|
852
|
<span class=tx> NodeList systemList = XPathAPI.selectNodeList(_queryNode, SYSTEMATTRIBUTE
|
853
|
);</span></td>
|
854
|
</tr>
|
855
|
<tr>
|
856
|
<td id=white>
|
857
|
<span class=tx> String system = (systemList.item(0)).getNodeValue();</span></td>
|
858
|
<td id=sp>.</td>
|
859
|
<td id=white>
|
860
|
<span class=tx> String system = (systemList.item(0)).getNodeValue();</span></td>
|
861
|
</tr>
|
862
|
<tr>
|
863
|
<td id=white>
|
864
|
<span class=tx> //System.out.println("system is: "+ system);</span></td>
|
865
|
<td id=sp>.</td>
|
866
|
<td id=white>
|
867
|
<span class=tx> //System.out.println("system is: "+ system);</span></td>
|
868
|
</tr>
|
869
|
<tr>
|
870
|
<td id=white>
|
871
|
<span class=tx> URI systemUri = new URI(system);</span></td>
|
872
|
<td id=sp>.</td>
|
873
|
<td id=white>
|
874
|
<span class=tx> URI systemUri = new URI(system);</span></td>
|
875
|
</tr>
|
876
|
<tr>
|
877
|
<td id=white>
|
878
|
<span class=tx> //set system</span></td>
|
879
|
<td id=sp>.</td>
|
880
|
<td id=white>
|
881
|
<span class=tx> //set system</span></td>
|
882
|
</tr>
|
883
|
<tr>
|
884
|
<td id=c>
|
885
|
<a name="change12"></a><span class=tx> ecogridQuery.setSystem(systemUri);</span></td>
|
886
|
<td id=sp>.</td>
|
887
|
<td id=c>
|
888
|
<span class=tx> _ecogridQuery.setSystem(systemUri);</span></td>
|
889
|
</tr>
|
890
|
<tr>
|
891
|
<td id=c>
|
892
|
<span class=tx> }//setupQueryIdAndSystem</span></td>
|
893
|
<td id=sp>.</td>
|
894
|
<td id=c>
|
895
|
<span class=tx> </span></td>
|
896
|
</tr>
|
897
|
<tr>
|
898
|
<td id=c>
|
899
|
<span class=tx> </span></td>
|
900
|
<td id=sp>.</td>
|
901
|
<td id=c>
|
902
|
<span class=tx> } // setupQueryIdAndSystem</span></td>
|
903
|
</tr>
|
904
|
<tr>
|
905
|
<td id=white>
|
906
|
<span class=tx> </span></td>
|
907
|
<td id=sp>.</td>
|
908
|
<td id=white>
|
909
|
<span class=tx> </span></td>
|
910
|
</tr>
|
911
|
<tr>
|
912
|
<td id=a>
|
913
|
<a name="change13"></a><span class=tx> </span></td>
|
914
|
<td id=sp>.</td>
|
915
|
<td id=a>
|
916
|
<span class=tx> </span></td>
|
917
|
</tr>
|
918
|
<tr>
|
919
|
<td id=white>
|
920
|
<span class=tx> /* setup namepsace */</span></td>
|
921
|
<td id=sp>.</td>
|
922
|
<td id=white>
|
923
|
<span class=tx> /* setup namepsace */</span></td>
|
924
|
</tr>
|
925
|
<tr>
|
926
|
<td id=white>
|
927
|
<span class=tx> private void setupNamespace() throws Exception</span></td>
|
928
|
<td id=sp>.</td>
|
929
|
<td id=white>
|
930
|
<span class=tx> private void setupNamespace() throws Exception</span></td>
|
931
|
</tr>
|
932
|
<tr>
|
933
|
<td id=white>
|
934
|
<span class=tx> {</span></td>
|
935
|
<td id=sp>.</td>
|
936
|
<td id=white>
|
937
|
<span class=tx> {</span></td>
|
938
|
</tr>
|
939
|
<tr>
|
940
|
<td id=white>
|
941
|
<span class=tx> // get namespace</span></td>
|
942
|
<td id=sp>.</td>
|
943
|
<td id=white>
|
944
|
<span class=tx> // get namespace</span></td>
|
945
|
</tr>
|
946
|
<tr>
|
947
|
<td id=c>
|
948
|
<a name="change14"></a><span class=tx> NodeList namespaceList = XPathAPI.selectNodeList(doc, NAMESPACE);</span></td>
|
949
|
<td id=sp>.</td>
|
950
|
<td id=c>
|
951
|
<span class=tx> NodeList namespaceList = XPathAPI.selectNodeList(_queryNode, NAMESPACE);</span></td>
|
952
|
</tr>
|
953
|
<tr>
|
954
|
<td id=white>
|
955
|
<span class=tx> int length = namespaceList.getLength();</span></td>
|
956
|
<td id=sp>.</td>
|
957
|
<td id=white>
|
958
|
<span class=tx> int length = namespaceList.getLength();</span></td>
|
959
|
</tr>
|
960
|
<tr>
|
961
|
<td id=white>
|
962
|
<span class=tx> QueryType_namespace [] namespaceArray;</span></td>
|
963
|
<td id=sp>.</td>
|
964
|
<td id=white>
|
965
|
<span class=tx> QueryType_namespace [] namespaceArray;</span></td>
|
966
|
</tr>
|
967
|
<tr>
|
968
|
<td id=white>
|
969
|
<span class=tx> if ( length != 0 )</span></td>
|
970
|
<td id=sp>.</td>
|
971
|
<td id=white>
|
972
|
<span class=tx> if ( length != 0 )</span></td>
|
973
|
</tr>
|
974
|
<tr>
|
975
|
<td id=white>
|
976
|
<span class=tx> {</span></td>
|
977
|
<td id=sp>.</td>
|
978
|
<td id=white>
|
979
|
<span class=tx> {</span></td>
|
980
|
</tr>
|
981
|
<tr>
|
982
|
<td id=white>
|
983
|
<span class=tx> namespaceArray = new QueryType_namespace [length];</span></td>
|
984
|
<td id=sp>.</td>
|
985
|
<td id=white>
|
986
|
<span class=tx> namespaceArray = new QueryType_namespace [length];</span></td>
|
987
|
</tr>
|
988
|
<tr><td id=sk>Skipping to line 200</td><td id=sp>.</td><td id=sk> </td></tr>
|
989
|
<tr>
|
990
|
<td id=white>
|
991
|
<span class=tx> queryNamespace.setPrefix(prefix);</span></td>
|
992
|
<td id=sp>.</td>
|
993
|
<td id=white>
|
994
|
<span class=tx> queryNamespace.setPrefix(prefix);</span></td>
|
995
|
</tr>
|
996
|
<tr>
|
997
|
<td id=white>
|
998
|
<span class=tx> // put the object into array</span></td>
|
999
|
<td id=sp>.</td>
|
1000
|
<td id=white>
|
1001
|
<span class=tx> // put the object into array</span></td>
|
1002
|
</tr>
|
1003
|
<tr>
|
1004
|
<td id=white>
|
1005
|
<span class=tx> namespaceArray[i]=queryNamespace;</span></td>
|
1006
|
<td id=sp>.</td>
|
1007
|
<td id=white>
|
1008
|
<span class=tx> namespaceArray[i]=queryNamespace;</span></td>
|
1009
|
</tr>
|
1010
|
<tr>
|
1011
|
<td id=white>
|
1012
|
<span class=tx> }</span></td>
|
1013
|
<td id=sp>.</td>
|
1014
|
<td id=white>
|
1015
|
<span class=tx> }</span></td>
|
1016
|
</tr>
|
1017
|
<tr>
|
1018
|
<td id=white>
|
1019
|
<span class=tx> // set up the QueryType_namespace object to ecogrid query object</span></td>
|
1020
|
<td id=sp>.</td>
|
1021
|
<td id=white>
|
1022
|
<span class=tx> // set up the QueryType_namespace object to ecogrid query object</span></td>
|
1023
|
</tr>
|
1024
|
<tr>
|
1025
|
<td id=c>
|
1026
|
<a name="change15"></a><span class=tx> ecogridQuery.setNamespace(namespaceArray);</span></td>
|
1027
|
<td id=sp>.</td>
|
1028
|
<td id=c>
|
1029
|
<span class=tx> _ecogridQuery.setNamespace(namespaceArray);</span></td>
|
1030
|
</tr>
|
1031
|
<tr>
|
1032
|
<td id=white>
|
1033
|
<span class=tx> }</span></td>
|
1034
|
<td id=sp>.</td>
|
1035
|
<td id=white>
|
1036
|
<span class=tx> }</span></td>
|
1037
|
</tr>
|
1038
|
<tr>
|
1039
|
<td id=white>
|
1040
|
<span class=tx> }//setupNamespace</span></td>
|
1041
|
<td id=sp>.</td>
|
1042
|
<td id=white>
|
1043
|
<span class=tx> }//setupNamespace</span></td>
|
1044
|
</tr>
|
1045
|
<tr>
|
1046
|
<td id=white>
|
1047
|
<span class=tx> </span></td>
|
1048
|
<td id=sp>.</td>
|
1049
|
<td id=white>
|
1050
|
<span class=tx> </span></td>
|
1051
|
</tr>
|
1052
|
<tr>
|
1053
|
<td id=white>
|
1054
|
<span class=tx> /* setup returnfield */</span></td>
|
1055
|
<td id=sp>.</td>
|
1056
|
<td id=white>
|
1057
|
<span class=tx> /* setup returnfield */</span></td>
|
1058
|
</tr>
|
1059
|
<tr>
|
1060
|
<td id=white>
|
1061
|
<span class=tx> private void setupReturnField() throws Exception</span></td>
|
1062
|
<td id=sp>.</td>
|
1063
|
<td id=white>
|
1064
|
<span class=tx> private void setupReturnField() throws Exception</span></td>
|
1065
|
</tr>
|
1066
|
<tr><td id=sk>Skipping to line 212</td><td id=sp>.</td><td id=sk> </td></tr>
|
1067
|
<tr>
|
1068
|
<td id=white>
|
1069
|
<span class=tx> // get retrunfield</span></td>
|
1070
|
<td id=sp>.</td>
|
1071
|
<td id=white>
|
1072
|
<span class=tx> // get retrunfield</span></td>
|
1073
|
</tr>
|
1074
|
<tr>
|
1075
|
<td id=c>
|
1076
|
<a name="change16"></a><span class=tx> NodeList returnFieldList = XPathAPI.selectNodeList(doc, RETURNFIELD);
|
1077
|
</span></td>
|
1078
|
<td id=sp>.</td>
|
1079
|
<td id=c>
|
1080
|
<span class=tx> NodeList returnFieldList = XPathAPI.selectNodeList(_queryNode, RETURNFIEL
|
1081
|
D);</span></td>
|
1082
|
</tr>
|
1083
|
<tr>
|
1084
|
<td id=white>
|
1085
|
<span class=tx> String [] returnFieldArray ;</span></td>
|
1086
|
<td id=sp>.</td>
|
1087
|
<td id=white>
|
1088
|
<span class=tx> String [] returnFieldArray ;</span></td>
|
1089
|
</tr>
|
1090
|
<tr>
|
1091
|
<td id=white>
|
1092
|
<span class=tx> int length = returnFieldList.getLength();</span></td>
|
1093
|
<td id=sp>.</td>
|
1094
|
<td id=white>
|
1095
|
<span class=tx> int length = returnFieldList.getLength();</span></td>
|
1096
|
</tr>
|
1097
|
<tr>
|
1098
|
<td id=white>
|
1099
|
<span class=tx> if (length != 0)</span></td>
|
1100
|
<td id=sp>.</td>
|
1101
|
<td id=white>
|
1102
|
<span class=tx> if (length != 0)</span></td>
|
1103
|
</tr>
|
1104
|
<tr>
|
1105
|
<td id=white>
|
1106
|
<span class=tx> {</span></td>
|
1107
|
<td id=sp>.</td>
|
1108
|
<td id=white>
|
1109
|
<span class=tx> {</span></td>
|
1110
|
</tr>
|
1111
|
<tr>
|
1112
|
<td id=white>
|
1113
|
<span class=tx> returnFieldArray = new String [length];</span></td>
|
1114
|
<td id=sp>.</td>
|
1115
|
<td id=white>
|
1116
|
<span class=tx> returnFieldArray = new String [length];</span></td>
|
1117
|
</tr>
|
1118
|
<tr><td id=sk>Skipping to line 222</td><td id=sp>.</td><td id=sk> </td></tr>
|
1119
|
<tr>
|
1120
|
<td id=white>
|
1121
|
<span class=tx> Node returnfield = returnFieldList.item(i);</span></td>
|
1122
|
<td id=sp>.</td>
|
1123
|
<td id=white>
|
1124
|
<span class=tx> Node returnfield = returnFieldList.item(i);</span></td>
|
1125
|
</tr>
|
1126
|
<tr>
|
1127
|
<td id=white>
|
1128
|
<span class=tx> String returnfieldString = returnfield.getFirstChild().getNodeValue()
|
1129
|
;</span></td>
|
1130
|
<td id=sp>.</td>
|
1131
|
<td id=white>
|
1132
|
<span class=tx> String returnfieldString = returnfield.getFirstChild().getNodeValue()
|
1133
|
;</span></td>
|
1134
|
</tr>
|
1135
|
<tr>
|
1136
|
<td id=white>
|
1137
|
<span class=tx> returnFieldArray[i] = returnfieldString;</span></td>
|
1138
|
<td id=sp>.</td>
|
1139
|
<td id=white>
|
1140
|
<span class=tx> returnFieldArray[i] = returnfieldString;</span></td>
|
1141
|
</tr>
|
1142
|
<tr>
|
1143
|
<td id=white>
|
1144
|
<span class=tx> }</span></td>
|
1145
|
<td id=sp>.</td>
|
1146
|
<td id=white>
|
1147
|
<span class=tx> }</span></td>
|
1148
|
</tr>
|
1149
|
<tr>
|
1150
|
<td id=white>
|
1151
|
<span class=tx> // set up the QueryType_namespace object to ecogrid query object</span></td>
|
1152
|
<td id=sp>.</td>
|
1153
|
<td id=white>
|
1154
|
<span class=tx> // set up the QueryType_namespace object to ecogrid query object</span></td>
|
1155
|
</tr>
|
1156
|
<tr>
|
1157
|
<td id=c>
|
1158
|
<a name="change17"></a><span class=tx> ecogridQuery.setReturnfield(returnFieldArray);</span></td>
|
1159
|
<td id=sp>.</td>
|
1160
|
<td id=c>
|
1161
|
<span class=tx> _ecogridQuery.setReturnfield(returnFieldArray);</span></td>
|
1162
|
</tr>
|
1163
|
<tr>
|
1164
|
<td id=white>
|
1165
|
<span class=tx> }</span></td>
|
1166
|
<td id=sp>.</td>
|
1167
|
<td id=white>
|
1168
|
<span class=tx> }</span></td>
|
1169
|
</tr>
|
1170
|
<tr>
|
1171
|
<td id=white>
|
1172
|
<span class=tx> }//setupReturnField</span></td>
|
1173
|
<td id=sp>.</td>
|
1174
|
<td id=white>
|
1175
|
<span class=tx> }//setupReturnField</span></td>
|
1176
|
</tr>
|
1177
|
<tr>
|
1178
|
<td id=white>
|
1179
|
<span class=tx> </span></td>
|
1180
|
<td id=sp>.</td>
|
1181
|
<td id=white>
|
1182
|
<span class=tx> </span></td>
|
1183
|
</tr>
|
1184
|
<tr>
|
1185
|
<td id=white>
|
1186
|
<span class=tx> /* setup title */</span></td>
|
1187
|
<td id=sp>.</td>
|
1188
|
<td id=white>
|
1189
|
<span class=tx> /* setup title */</span></td>
|
1190
|
</tr>
|
1191
|
<tr>
|
1192
|
<td id=white>
|
1193
|
<span class=tx> private void setupTitle() throws Exception</span></td>
|
1194
|
<td id=sp>.</td>
|
1195
|
<td id=white>
|
1196
|
<span class=tx> private void setupTitle() throws Exception</span></td>
|
1197
|
</tr>
|
1198
|
<tr><td id=sk>Skipping to line 234</td><td id=sp>.</td><td id=sk> </td></tr>
|
1199
|
<tr>
|
1200
|
<td id=white>
|
1201
|
<span class=tx> // get retrunfield</span></td>
|
1202
|
<td id=sp>.</td>
|
1203
|
<td id=white>
|
1204
|
<span class=tx> // get retrunfield</span></td>
|
1205
|
</tr>
|
1206
|
<tr>
|
1207
|
<td id=c>
|
1208
|
<a name="change18"></a><span class=tx> NodeList titleList = XPathAPI.selectNodeList(doc, TITLE);</span></td>
|
1209
|
<td id=sp>.</td>
|
1210
|
<td id=c>
|
1211
|
<span class=tx> NodeList titleList = XPathAPI.selectNodeList(_queryNode, TITLE);</span></td>
|
1212
|
</tr>
|
1213
|
<tr>
|
1214
|
<td id=white>
|
1215
|
<span class=tx> String [] titleArray ;</span></td>
|
1216
|
<td id=sp>.</td>
|
1217
|
<td id=white>
|
1218
|
<span class=tx> String [] titleArray ;</span></td>
|
1219
|
</tr>
|
1220
|
<tr>
|
1221
|
<td id=white>
|
1222
|
<span class=tx> int length = titleList.getLength();</span></td>
|
1223
|
<td id=sp>.</td>
|
1224
|
<td id=white>
|
1225
|
<span class=tx> int length = titleList.getLength();</span></td>
|
1226
|
</tr>
|
1227
|
<tr>
|
1228
|
<td id=white>
|
1229
|
<span class=tx> if (length != 0)</span></td>
|
1230
|
<td id=sp>.</td>
|
1231
|
<td id=white>
|
1232
|
<span class=tx> if (length != 0)</span></td>
|
1233
|
</tr>
|
1234
|
<tr>
|
1235
|
<td id=white>
|
1236
|
<span class=tx> {</span></td>
|
1237
|
<td id=sp>.</td>
|
1238
|
<td id=white>
|
1239
|
<span class=tx> {</span></td>
|
1240
|
</tr>
|
1241
|
<tr>
|
1242
|
<td id=white>
|
1243
|
<span class=tx> titleArray = new String [length];</span></td>
|
1244
|
<td id=sp>.</td>
|
1245
|
<td id=white>
|
1246
|
<span class=tx> titleArray = new String [length];</span></td>
|
1247
|
</tr>
|
1248
|
<tr><td id=sk>Skipping to line 245</td><td id=sp>.</td><td id=sk> </td></tr>
|
1249
|
<tr>
|
1250
|
<td id=white>
|
1251
|
<span class=tx> String titleString = title.getFirstChild().getNodeValue();</span></td>
|
1252
|
<td id=sp>.</td>
|
1253
|
<td id=white>
|
1254
|
<span class=tx> String titleString = title.getFirstChild().getNodeValue();</span></td>
|
1255
|
</tr>
|
1256
|
<tr>
|
1257
|
<td id=white>
|
1258
|
<span class=tx> //System.out.println("title is: " + titleString);</span></td>
|
1259
|
<td id=sp>.</td>
|
1260
|
<td id=white>
|
1261
|
<span class=tx> //System.out.println("title is: " + titleString);</span></td>
|
1262
|
</tr>
|
1263
|
<tr>
|
1264
|
<td id=white>
|
1265
|
<span class=tx> titleArray[i] = titleString;</span></td>
|
1266
|
<td id=sp>.</td>
|
1267
|
<td id=white>
|
1268
|
<span class=tx> titleArray[i] = titleString;</span></td>
|
1269
|
</tr>
|
1270
|
<tr>
|
1271
|
<td id=white>
|
1272
|
<span class=tx> }</span></td>
|
1273
|
<td id=sp>.</td>
|
1274
|
<td id=white>
|
1275
|
<span class=tx> }</span></td>
|
1276
|
</tr>
|
1277
|
<tr>
|
1278
|
<td id=white>
|
1279
|
<span class=tx> // set up the QueryType_namespace object to ecogrid query object</span></td>
|
1280
|
<td id=sp>.</td>
|
1281
|
<td id=white>
|
1282
|
<span class=tx> // set up the QueryType_namespace object to ecogrid query object</span></td>
|
1283
|
</tr>
|
1284
|
<tr>
|
1285
|
<td id=c>
|
1286
|
<a name="change19"></a><span class=tx> ecogridQuery.setTitle(titleArray);</span></td>
|
1287
|
<td id=sp>.</td>
|
1288
|
<td id=c>
|
1289
|
<span class=tx> _ecogridQuery.setTitle(titleArray);</span></td>
|
1290
|
</tr>
|
1291
|
<tr>
|
1292
|
<td id=white>
|
1293
|
<span class=tx> }</span></td>
|
1294
|
<td id=sp>.</td>
|
1295
|
<td id=white>
|
1296
|
<span class=tx> }</span></td>
|
1297
|
</tr>
|
1298
|
<tr>
|
1299
|
<td id=white>
|
1300
|
<span class=tx> }//setupReturnField</span></td>
|
1301
|
<td id=sp>.</td>
|
1302
|
<td id=white>
|
1303
|
<span class=tx> }//setupReturnField</span></td>
|
1304
|
</tr>
|
1305
|
<tr>
|
1306
|
<td id=white>
|
1307
|
<span class=tx> </span></td>
|
1308
|
<td id=sp>.</td>
|
1309
|
<td id=white>
|
1310
|
<span class=tx> </span></td>
|
1311
|
</tr>
|
1312
|
<tr>
|
1313
|
<td id=white>
|
1314
|
<span class=tx> /* setup first relation type */</span></td>
|
1315
|
<td id=sp>.</td>
|
1316
|
<td id=white>
|
1317
|
<span class=tx> /* setup first relation type */</span></td>
|
1318
|
</tr>
|
1319
|
<tr>
|
1320
|
<td id=white>
|
1321
|
<span class=tx> private void setupFirstRelation() throws Exception</span></td>
|
1322
|
<td id=sp>.</td>
|
1323
|
<td id=white>
|
1324
|
<span class=tx> private void setupFirstRelation() throws Exception</span></td>
|
1325
|
</tr>
|
1326
|
<tr><td id=sk>Skipping to line 257</td><td id=sp>.</td><td id=sk> </td></tr>
|
1327
|
<tr>
|
1328
|
<td id=c>
|
1329
|
<a name="change20"></a><span class=tx> NodeList firstAND = XPathAPI.selectNodeList(doc, FIRSTAND);</span></td>
|
1330
|
<td id=sp>.</td>
|
1331
|
<td id=c>
|
1332
|
<span class=tx> NodeList firstAND = XPathAPI.selectNodeList(_queryNode, FIRSTAND);</span></td>
|
1333
|
</tr>
|
1334
|
<tr>
|
1335
|
<td id=c>
|
1336
|
<span class=tx> NodeList firstOR = XPathAPI.selectNodeList(doc, FIRSTOR);</span></td>
|
1337
|
<td id=sp>.</td>
|
1338
|
<td id=c>
|
1339
|
<span class=tx> NodeList firstOR = XPathAPI.selectNodeList(_queryNode, FIRSTOR);</span></td>
|
1340
|
</tr>
|
1341
|
<tr>
|
1342
|
<td id=c>
|
1343
|
<span class=tx> NodeList firstCondition = XPathAPI.selectNodeList(doc, FIRSTCONDITION);
|
1344
|
</span></td>
|
1345
|
<td id=sp>.</td>
|
1346
|
<td id=c>
|
1347
|
<span class=tx> NodeList firstCondition = XPathAPI.selectNodeList(_queryNode, FIRSTCONDIT
|
1348
|
ION);</span></td>
|
1349
|
</tr>
|
1350
|
<tr>
|
1351
|
<td id=white>
|
1352
|
<span class=tx> int andLength = firstAND.getLength();</span></td>
|
1353
|
<td id=sp>.</td>
|
1354
|
<td id=white>
|
1355
|
<span class=tx> int andLength = firstAND.getLength();</span></td>
|
1356
|
</tr>
|
1357
|
<tr>
|
1358
|
<td id=white>
|
1359
|
<span class=tx> int orLength = firstOR.getLength();</span></td>
|
1360
|
<td id=sp>.</td>
|
1361
|
<td id=white>
|
1362
|
<span class=tx> int orLength = firstOR.getLength();</span></td>
|
1363
|
</tr>
|
1364
|
<tr>
|
1365
|
<td id=white>
|
1366
|
<span class=tx> int conLength = firstCondition.getLength();</span></td>
|
1367
|
<td id=sp>.</td>
|
1368
|
<td id=white>
|
1369
|
<span class=tx> int conLength = firstCondition.getLength();</span></td>
|
1370
|
</tr>
|
1371
|
<tr>
|
1372
|
<td id=white>
|
1373
|
<span class=tx> if ( andLength != 0 && orLength ==0 && conLength == 0)</span></td>
|
1374
|
<td id=sp>.</td>
|
1375
|
<td id=white>
|
1376
|
<span class=tx> if ( andLength != 0 && orLength ==0 && conLength == 0)</span></td>
|
1377
|
</tr>
|
1378
|
<tr>
|
1379
|
<td id=white>
|
1380
|
<span class=tx> {</span></td>
|
1381
|
<td id=sp>.</td>
|
1382
|
<td id=white>
|
1383
|
<span class=tx> {</span></td>
|
1384
|
</tr>
|
1385
|
<tr><td id=sk>Skipping to line 266</td><td id=sp>.</td><td id=sk> </td></tr>
|
1386
|
<tr>
|
1387
|
<td id=white>
|
1388
|
<span class=tx> ANDType and = new ANDType();</span></td>
|
1389
|
<td id=sp>.</td>
|
1390
|
<td id=white>
|
1391
|
<span class=tx> ANDType and = new ANDType();</span></td>
|
1392
|
</tr>
|
1393
|
<tr>
|
1394
|
<td id=white>
|
1395
|
<span class=tx> handleANDType(and, firstAND.item(0));</span></td>
|
1396
|
<td id=sp>.</td>
|
1397
|
<td id=white>
|
1398
|
<span class=tx> handleANDType(and, firstAND.item(0));</span></td>
|
1399
|
</tr>
|
1400
|
<tr>
|
1401
|
<td id=c>
|
1402
|
<a name="change21"></a><span class=tx> ecogridQuery.setAND(and);</span></td>
|
1403
|
<td id=sp>.</td>
|
1404
|
<td id=c>
|
1405
|
<span class=tx> _ecogridQuery.setAND(and);</span></td>
|
1406
|
</tr>
|
1407
|
<tr>
|
1408
|
<td id=white>
|
1409
|
<span class=tx> </span></td>
|
1410
|
<td id=sp>.</td>
|
1411
|
<td id=white>
|
1412
|
<span class=tx> </span></td>
|
1413
|
</tr>
|
1414
|
<tr>
|
1415
|
<td id=white>
|
1416
|
<span class=tx> }</span></td>
|
1417
|
<td id=sp>.</td>
|
1418
|
<td id=white>
|
1419
|
<span class=tx> }</span></td>
|
1420
|
</tr>
|
1421
|
<tr>
|
1422
|
<td id=white>
|
1423
|
<span class=tx> else if (orLength != 0 && andLength ==0 && conLength == 0)</span></td>
|
1424
|
<td id=sp>.</td>
|
1425
|
<td id=white>
|
1426
|
<span class=tx> else if (orLength != 0 && andLength ==0 && conLength == 0)</span></td>
|
1427
|
</tr>
|
1428
|
<tr>
|
1429
|
<td id=white>
|
1430
|
<span class=tx> {</span></td>
|
1431
|
<td id=sp>.</td>
|
1432
|
<td id=white>
|
1433
|
<span class=tx> {</span></td>
|
1434
|
</tr>
|
1435
|
<tr>
|
1436
|
<td id=white>
|
1437
|
<span class=tx> // first is or</span></td>
|
1438
|
<td id=sp>.</td>
|
1439
|
<td id=white>
|
1440
|
<span class=tx> // first is or</span></td>
|
1441
|
</tr>
|
1442
|
<tr><td id=sk>Skipping to line 275</td><td id=sp>.</td><td id=sk> </td></tr>
|
1443
|
<tr>
|
1444
|
<td id=white>
|
1445
|
<span class=tx> handleORType(or, firstOR.item(0));</span></td>
|
1446
|
<td id=sp>.</td>
|
1447
|
<td id=white>
|
1448
|
<span class=tx> handleORType(or, firstOR.item(0));</span></td>
|
1449
|
</tr>
|
1450
|
<tr>
|
1451
|
<td id=c>
|
1452
|
<a name="change22"></a><span class=tx> ecogridQuery.setOR(or);</span></td>
|
1453
|
<td id=sp>.</td>
|
1454
|
<td id=c>
|
1455
|
<span class=tx> _ecogridQuery.setOR(or);</span></td>
|
1456
|
</tr>
|
1457
|
<tr>
|
1458
|
<td id=white>
|
1459
|
<span class=tx> }</span></td>
|
1460
|
<td id=sp>.</td>
|
1461
|
<td id=white>
|
1462
|
<span class=tx> }</span></td>
|
1463
|
</tr>
|
1464
|
<tr>
|
1465
|
<td id=white>
|
1466
|
<span class=tx> else if (conLength != 0 &&orLength == 0 && andLength == 0 )</span></td>
|
1467
|
<td id=sp>.</td>
|
1468
|
<td id=white>
|
1469
|
<span class=tx> else if (conLength != 0 &&orLength == 0 && andLength == 0 )</span></td>
|
1470
|
</tr>
|
1471
|
<tr>
|
1472
|
<td id=white>
|
1473
|
<span class=tx> {</span></td>
|
1474
|
<td id=sp>.</td>
|
1475
|
<td id=white>
|
1476
|
<span class=tx> {</span></td>
|
1477
|
</tr>
|
1478
|
<tr>
|
1479
|
<td id=white>
|
1480
|
<span class=tx> // first is condition</span></td>
|
1481
|
<td id=sp>.</td>
|
1482
|
<td id=white>
|
1483
|
<span class=tx> // first is condition</span></td>
|
1484
|
</tr>
|
1485
|
<tr>
|
1486
|
<td id=white>
|
1487
|
<span class=tx> ConditionType condition = handleConditionType(firstCondition.item(0));</span></td>
|
1488
|
<td id=sp>.</td>
|
1489
|
<td id=white>
|
1490
|
<span class=tx> ConditionType condition = handleConditionType(firstCondition.item(0));</span></td>
|
1491
|
</tr>
|
1492
|
<tr>
|
1493
|
<td id=c>
|
1494
|
<a name="change23"></a><span class=tx> ecogridQuery.setCondition(condition);</span></td>
|
1495
|
<td id=sp>.</td>
|
1496
|
<td id=c>
|
1497
|
<span class=tx> _ecogridQuery.setCondition(condition);</span></td>
|
1498
|
</tr>
|
1499
|
</table></body></html>
|
1500
|
<div style="background-color: #EEEEEE;"><H3><a name="EcogridQueryTransformer.java"></a>EcogridQueryTransformer.java - Revision 1.3</H3>
|
1501
|
<hr></div><table BGCOLOR=White CELLPADDING=0 CELLSPACING=0 WIDTH="100%" COLS=3>
|
1502
|
<COLGROUP><COL width="*"><COL width="1"><COL width="*"><THEAD>
|
1503
|
<tr><td id=title><center>EcogridQueryTransformer.java,1.3</center></td><td id=sp>.</td><td id=title><center>Disk File</center></td></tr>
|
1504
|
<tr><td id=sk>Skipping to line 200</td><td id=sp>.</td><td id=sk> </td></tr>
|
1505
|
<tr>
|
1506
|
<td id=white>
|
1507
|
<span class=tx> String[] returnfields = aQuery.getReturnfield();</span></td>
|
1508
|
<td id=sp>.</td>
|
1509
|
<td id=white>
|
1510
|
<span class=tx> String[] returnfields = aQuery.getReturnfield();</span></td>
|
1511
|
</tr>
|
1512
|
<tr>
|
1513
|
<td id=white>
|
1514
|
<span class=tx> if (returnfields != null)</span></td>
|
1515
|
<td id=sp>.</td>
|
1516
|
<td id=white>
|
1517
|
<span class=tx> if (returnfields != null)</span></td>
|
1518
|
</tr>
|
1519
|
<tr>
|
1520
|
<td id=white>
|
1521
|
<span class=tx> {</span></td>
|
1522
|
<td id=sp>.</td>
|
1523
|
<td id=white>
|
1524
|
<span class=tx> {</span></td>
|
1525
|
</tr>
|
1526
|
<tr>
|
1527
|
<td id=white>
|
1528
|
<span class=tx> for (int i = 0; i < returnfields.length; i++)</span></td>
|
1529
|
<td id=sp>.</td>
|
1530
|
<td id=white>
|
1531
|
<span class=tx> for (int i = 0; i < returnfields.length; i++)</span></td>
|
1532
|
</tr>
|
1533
|
<tr>
|
1534
|
<td id=white>
|
1535
|
<span class=tx> {</span></td>
|
1536
|
<td id=sp>.</td>
|
1537
|
<td id=white>
|
1538
|
<span class=tx> {</span></td>
|
1539
|
</tr>
|
1540
|
<tr>
|
1541
|
<td id=c>
|
1542
|
<a name="change0"></a><span class=tx> strBuf.append(" <returnfield>" + returnfields[i] + "</returnf
|
1543
|
ield>\n");</span></td>
|
1544
|
<td id=sp>.</td>
|
1545
|
<td id=c>
|
1546
|
<span class=tx> strBuf.append(" <returnField>" + returnfields[i] + "</returnF
|
1547
|
ield>\n");</span></td>
|
1548
|
</tr>
|
1549
|
<tr>
|
1550
|
<td id=white>
|
1551
|
<span class=tx> }</span></td>
|
1552
|
<td id=sp>.</td>
|
1553
|
<td id=white>
|
1554
|
<span class=tx> }</span></td>
|
1555
|
</tr>
|
1556
|
<tr>
|
1557
|
<td id=white>
|
1558
|
<span class=tx> }</span></td>
|
1559
|
<td id=sp>.</td>
|
1560
|
<td id=white>
|
1561
|
<span class=tx> }</span></td>
|
1562
|
</tr>
|
1563
|
<tr>
|
1564
|
<td id=white>
|
1565
|
<span class=tx> </span></td>
|
1566
|
<td id=sp>.</td>
|
1567
|
<td id=white>
|
1568
|
<span class=tx> </span></td>
|
1569
|
</tr>
|
1570
|
<tr>
|
1571
|
<td id=white>
|
1572
|
<span class=tx> String[] titles = aQuery.getTitle();</span></td>
|
1573
|
<td id=sp>.</td>
|
1574
|
<td id=white>
|
1575
|
<span class=tx> String[] titles = aQuery.getTitle();</span></td>
|
1576
|
</tr>
|
1577
|
<tr>
|
1578
|
<td id=white>
|
1579
|
<span class=tx> if (titles != null)</span></td>
|
1580
|
<td id=sp>.</td>
|
1581
|
<td id=white>
|
1582
|
<span class=tx> if (titles != null)</span></td>
|
1583
|
</tr>
|
1584
|
</table></body></html>
|