Revision 4363
Added by ben leinfelder about 16 years ago
lib/style/skins/first/search.js | ||
---|---|---|
368 | 368 |
return query; |
369 | 369 |
} |
370 | 370 |
|
371 |
function generateAssessmentListString(assessmentIds) { |
|
372 |
var query = |
|
373 |
"<pathquery version='1.2'>" |
|
374 |
+"<querytitle>Assessment-List</querytitle>" |
|
375 |
|
|
376 |
+"<returndoctype>edml://ecoinformatics.org/edml</returndoctype>" |
|
377 |
|
|
378 |
+"<returnfield>assessment/@title</returnfield>" |
|
379 |
+"<returnfield>assessment/@id</returnfield>" |
|
380 |
+"<returnfield>assessment/duration</returnfield>" |
|
381 |
+"<returnfield>lom/general/title/string</returnfield>" |
|
382 |
+"<returnfield>lom/general/keyword/string</returnfield>" |
|
383 |
+"<returnfield>individualName/surName</returnfield>" |
|
384 |
+"<returnfield>organizationName</returnfield>" |
|
385 |
|
|
386 |
+"<returnfield>assessmentItems/assessmentItem/assessmentItemId</returnfield>"; |
|
387 |
|
|
388 |
if (assessmentIds.length > 0) { |
|
389 |
query += "<querygroup operator='UNION'>"; |
|
390 |
|
|
391 |
//add the assessmentId if included |
|
392 |
for (var i=0; i < assessmentIds.length; i++) { |
|
393 |
query += |
|
394 |
"<queryterm searchmode='equals' casesensitive='false'>" |
|
395 |
+"<value>" |
|
396 |
+ assessmentIds[i] |
|
397 |
+"</value>" |
|
398 |
+"<pathexpr>@packageId</pathexpr>" |
|
399 |
+"</queryterm>"; |
|
400 |
} |
|
401 |
//close the query group |
|
402 |
query += |
|
403 |
"</querygroup>"; |
|
404 |
} |
|
405 |
|
|
406 |
query += "</pathquery>"; |
|
407 |
|
|
408 |
return query; |
|
409 |
} |
|
410 |
|
|
371 | 411 |
function callAjax(metacatURL, myQuery, qfmt) { |
372 | 412 |
|
373 | 413 |
//alert("calling ajax: " + metacatURL); |
Also available in: Unified diff
search method for retrieving specific documents (matching docid)