Project

General

Profile

1
function generateQueryString(organizationScope, anyValue) {
2
	var queryString = ""; 
3
	queryString += "<pathquery version='1.2'>";
4
	queryString += "<returndoctype>metadata</returndoctype>";
5
	queryString += "<returndoctype>-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN</returndoctype>";
6
	queryString += "<returndoctype>-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN</returndoctype>";
7
	queryString += "<returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype>";
8
	queryString += "<returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype>";
9
	queryString += "<returndoctype>-//NCEAS//eml-dataset-2.0//EN</returndoctype>";
10
	queryString += "<returndoctype>-//NCEAS//resource//EN</returndoctype>";
11
	queryString += "<returnfield>originator/individualName/surName</returnfield>";
12
	queryString += "<returnfield>originator/individualName/givenName</returnfield>";
13
	queryString += "<returnfield>originator/organizationName</returnfield>";
14
	queryString += "<returnfield>creator/individualName/surName</returnfield>";
15
	queryString += "<returnfield>creator/organizationName</returnfield>";
16
	queryString += "<returnfield>dataset/title</returnfield>";
17
	queryString += "<returnfield>keyword</returnfield>";
18
	queryString += "<returnfield>creator/individualName/givenName</returnfield>";
19
	queryString += "<returnfield>idinfo/citation/citeinfo/title</returnfield>";
20
	queryString += "<returnfield>idinfo/citation/citeinfo/origin</returnfield>";
21
	queryString += "<returnfield>idinfo/keywords/theme/themekey</returnfield>";
22
	
23
	queryString += "<querygroup operator='INTERSECT'>";
24
	queryString += "<queryterm casesensitive='false' searchmode='contains'>";
25
	
26
	queryString += "<value>" + anyValue + "</value>";
27
			
28
	queryString += "</queryterm>";
29
	
30
	queryString += "<querygroup operator='UNION'>";
31
	queryString += "<queryterm casesensitive='false' searchmode='contains'>";
32
	
33
	queryString += "<value>" + organizationScope + "</value>";
34
	
35
	queryString += "<pathexpr>placekey</pathexpr>";
36
	queryString += "</queryterm>";
37
	queryString += "<queryterm casesensitive='false' searchmode='contains'>";
38
	
39
	queryString += "<value>" + organizationScope + "</value>";
40
	
41
	queryString += "<pathexpr>keyword</pathexpr>";
42
	queryString += "</queryterm>";
43
	queryString += "</querygroup>";
44
	
45
	queryString += "</querygroup>";
46
	
47
	queryString += "</pathquery>";
48
	
49
	//alert(queryString);
50
	
51
	return queryString;
52
}
53

    
54
function setQueryFormField() {
55
	//alert('setQueryFormField');
56
	var queryField = document.getElementById("query");
57
	//alert('queryField=' + queryField);
58
	var anyfieldField = document.getElementById("anyfield");
59
	//alert('anyfieldField=' + anyfieldField);
60
	var organizationScopeField = document.getElementById("organizationScope");
61
	//alert('organizationScopeField=' + organizationScopeField);
62
	
63
	queryField.value = 
64
		generateQueryString(
65
			organizationScopeField.value,
66
			anyfieldField.value);
67
	
68
	//alert(queryField.value);
69
}
70

    
71
function setBrowseAll() {
72
	//set the field to wildcard
73
	var anyfieldField = document.getElementById("anyfield");
74
	anyfieldField.value = "";
75
	
76
	//set the query
77
	setQueryFormField();
78
}
(19-19/21)