1 |
7678
|
leinfelder
|
function encodeXML(theString) {
|
2 |
|
|
return theString.replace(/&/g, '&')
|
3 |
|
|
.replace(/</g, '<')
|
4 |
|
|
.replace(/>/g, '>')
|
5 |
|
|
.replace(/"/g, '"');
|
6 |
|
|
}
|
7 |
|
|
|
8 |
5129
|
cjones
|
function trim(stringToTrim) {
|
9 |
|
|
return stringToTrim.replace(/^\s*/, '').replace(/\s*$/,'');
|
10 |
|
|
}
|
11 |
|
|
|
12 |
|
|
function checkSearch(submitFormObj) {
|
13 |
|
|
var searchString = trim(submitFormObj.searchstring.value);
|
14 |
7678
|
leinfelder
|
searchString = encodeXML(searchString);
|
15 |
5129
|
cjones
|
var checkBox = document.getElementById("searchAll");
|
16 |
|
|
|
17 |
|
|
if (searchString=="") {
|
18 |
|
|
if (confirm("Show *all* data in the PARC Catalog?")) {
|
19 |
|
|
searchString = "%";
|
20 |
|
|
} else {
|
21 |
|
|
return false;
|
22 |
|
|
}
|
23 |
|
|
}
|
24 |
|
|
|
25 |
|
|
if (!checkBox.checked && searchString!="%") {
|
26 |
|
|
submitFormObj.query.value = "<pathquery version=\"1.2\">"
|
27 |
|
|
+"<querytitle>Web-Search</querytitle>"
|
28 |
5710
|
leinfelder
|
+"<returndoctype>eml://ecoinformatics.org/eml-2.1.1</returndoctype>"
|
29 |
5129
|
cjones
|
+"<returndoctype>eml://ecoinformatics.org/eml-2.1.0</returndoctype>"
|
30 |
|
|
+"<returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype>"
|
31 |
5710
|
leinfelder
|
+"<returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype>"
|
32 |
5129
|
cjones
|
+"<returndoctype>metadata</returndoctype>"
|
33 |
|
|
+"<returnfield>originator/individualName/surName</returnfield>"
|
34 |
|
|
+"<returnfield>originator/individualName/givenName</returnfield>"
|
35 |
|
|
+"<returnfield>creator/individualName/surName</returnfield>"
|
36 |
|
|
+"<returnfield>creator/individualName/givenName</returnfield>"
|
37 |
|
|
+"<returnfield>originator/organizationName</returnfield>"
|
38 |
|
|
+"<returnfield>creator/organizationName</returnfield>"
|
39 |
|
|
+"<returnfield>dataset/title</returnfield>"
|
40 |
5816
|
leinfelder
|
+"<returnfield>dataset/title/value</returnfield>"
|
41 |
5129
|
cjones
|
+"<returnfield>keyword</returnfield>"
|
42 |
5816
|
leinfelder
|
+"<returnfield>keyword/value</returnfield>"
|
43 |
5129
|
cjones
|
//fgdc fields
|
44 |
|
|
+"<returnfield>idinfo/citation/citeinfo/title</returnfield>"
|
45 |
|
|
+"<returnfield>idinfo/citation/citeinfo/origin</returnfield>"
|
46 |
|
|
+"<returnfield>idinfo/keywords/theme/themekey</returnfield>"
|
47 |
|
|
+"<querygroup operator=\"INTERSECT\">"
|
48 |
|
|
+"<querygroup operator=\"UNION\">"
|
49 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
50 |
|
|
+"<value>Palmyra Atoll Research Consortium</value>"
|
51 |
7490
|
leinfelder
|
+"<pathexpr>creator/organizationName</pathexpr>"
|
52 |
5129
|
cjones
|
+"</queryterm>"
|
53 |
|
|
+"</querygroup>"
|
54 |
|
|
+"<querygroup operator=\"UNION\">"
|
55 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
56 |
|
|
+"<value>" + searchString + "</value>"
|
57 |
7490
|
leinfelder
|
+"<pathexpr>creator/individualName/surName</pathexpr>"
|
58 |
5129
|
cjones
|
+"</queryterm>"
|
59 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
60 |
|
|
+"<value>" + searchString + "</value>"
|
61 |
7490
|
leinfelder
|
+"<pathexpr>creator/individualName/givenName</pathexpr>"
|
62 |
5129
|
cjones
|
+"</queryterm>"
|
63 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
64 |
|
|
+"<value>" + searchString + "</value>"
|
65 |
7490
|
leinfelder
|
+"<pathexpr>keyword</pathexpr>"
|
66 |
5129
|
cjones
|
+"</queryterm>"
|
67 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
68 |
5816
|
leinfelder
|
+"<value>" + searchString + "</value>"
|
69 |
7490
|
leinfelder
|
+"<pathexpr>keyword/value</pathexpr>"
|
70 |
5816
|
leinfelder
|
+"</queryterm>"
|
71 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
72 |
5129
|
cjones
|
+"<value>" + searchString + "</value>"
|
73 |
|
|
+"<pathexpr>para</pathexpr>"
|
74 |
|
|
+"</queryterm>"
|
75 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
76 |
|
|
+"<value>" + searchString + "</value>"
|
77 |
7490
|
leinfelder
|
+"<pathexpr>geographicDescription</pathexpr>"
|
78 |
5129
|
cjones
|
+"</queryterm>"
|
79 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
80 |
|
|
+"<value>" + searchString + "</value>"
|
81 |
|
|
+"<pathexpr>literalLayout</pathexpr>"
|
82 |
|
|
+"</queryterm>"
|
83 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
84 |
|
|
+"<value>" + searchString + "</value>"
|
85 |
7490
|
leinfelder
|
+"<pathexpr>dataset/title</pathexpr>"
|
86 |
5129
|
cjones
|
+"</queryterm>"
|
87 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
88 |
5816
|
leinfelder
|
+"<value>" + searchString + "</value>"
|
89 |
7490
|
leinfelder
|
+"<pathexpr>dataset/title/value</pathexpr>"
|
90 |
5816
|
leinfelder
|
+"</queryterm>"
|
91 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
92 |
5129
|
cjones
|
+"<value>" + searchString + "</value>"
|
93 |
7490
|
leinfelder
|
+"<pathexpr>@packageId</pathexpr>"
|
94 |
5129
|
cjones
|
+"</queryterm>"
|
95 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
96 |
|
|
+"<value>" + searchString + "</value>"
|
97 |
7490
|
leinfelder
|
+"<pathexpr>abstract/para</pathexpr>"
|
98 |
5129
|
cjones
|
+"</queryterm>"
|
99 |
5816
|
leinfelder
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
100 |
|
|
+"<value>" + searchString + "</value>"
|
101 |
7490
|
leinfelder
|
+"<pathexpr>abstract/para/value</pathexpr>"
|
102 |
5816
|
leinfelder
|
+"</queryterm>"
|
103 |
5129
|
cjones
|
+"</querygroup>"
|
104 |
|
|
+"</querygroup>"
|
105 |
|
|
+"</pathquery>";
|
106 |
|
|
|
107 |
|
|
} else {
|
108 |
|
|
queryTermString = "";
|
109 |
|
|
if (searchString != "%"){
|
110 |
|
|
queryTermString = "<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
111 |
|
|
+"<value>" + searchString + "</value>"
|
112 |
|
|
+"</queryterm>";
|
113 |
|
|
}
|
114 |
|
|
submitFormObj.query.value = "<pathquery version=\"1.2\">"
|
115 |
|
|
+"<querytitle>Web-Search</querytitle>"
|
116 |
5710
|
leinfelder
|
+"<returndoctype>eml://ecoinformatics.org/eml-2.1.1</returndoctype>"
|
117 |
5129
|
cjones
|
+"<returndoctype>eml://ecoinformatics.org/eml-2.1.0</returndoctype>"
|
118 |
|
|
+"<returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype>"
|
119 |
|
|
+"<returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype>"
|
120 |
|
|
+"<returndoctype>metadata</returndoctype>"
|
121 |
|
|
+"<returnfield>originator/individualName/surName</returnfield>"
|
122 |
|
|
+"<returnfield>originator/individualName/givenName</returnfield>"
|
123 |
|
|
+"<returnfield>creator/individualName/surName</returnfield>"
|
124 |
|
|
+"<returnfield>creator/individualName/givenName</returnfield>"
|
125 |
|
|
+"<returnfield>originator/organizationName</returnfield>"
|
126 |
|
|
+"<returnfield>creator/organizationName</returnfield>"
|
127 |
|
|
+"<returnfield>dataset/title</returnfield>"
|
128 |
5816
|
leinfelder
|
+"<returnfield>dataset/title/value</returnfield>"
|
129 |
5129
|
cjones
|
+"<returnfield>keyword</returnfield>"
|
130 |
5816
|
leinfelder
|
+"<returnfield>keyword/value</returnfield>"
|
131 |
5129
|
cjones
|
//fgdc fields
|
132 |
|
|
+"<returnfield>idinfo/citation/citeinfo/title</returnfield>"
|
133 |
|
|
+"<returnfield>idinfo/citation/citeinfo/origin</returnfield>"
|
134 |
|
|
+"<returnfield>idinfo/keywords/theme/themekey</returnfield>"
|
135 |
|
|
+"<querygroup operator=\"INTERSECT\">"
|
136 |
|
|
+"<querygroup operator=\"UNION\">"
|
137 |
|
|
+"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
|
138 |
|
|
+"<value>Palmyra Atoll Research Consortium</value>"
|
139 |
7490
|
leinfelder
|
+"<pathexpr>creator/organizationName</pathexpr>"
|
140 |
5129
|
cjones
|
+"</queryterm>"
|
141 |
|
|
+"</querygroup>"
|
142 |
|
|
+ queryTermString
|
143 |
|
|
+"</querygroup>"
|
144 |
|
|
+"</pathquery>";
|
145 |
|
|
|
146 |
|
|
}
|
147 |
|
|
return true;
|
148 |
|
|
}
|
149 |
|
|
|
150 |
|
|
function browseAll(searchFormId) {
|
151 |
|
|
var searchForm = document.getElementById(searchFormId);
|
152 |
|
|
var searchString = searchForm.searchstring;
|
153 |
|
|
var checkBox = document.getElementById("searchAll");
|
154 |
|
|
searchString.value="";
|
155 |
|
|
checkBox.checked = true;
|
156 |
|
|
if (checkSearch(searchForm)) {
|
157 |
|
|
searchForm.submit();
|
158 |
|
|
}
|
159 |
|
|
|
160 |
|
|
}
|
161 |
|
|
|
162 |
|
|
function searchAll(){
|
163 |
|
|
var checkBox = document.getElementById("searchCheckBox");
|
164 |
|
|
if (checkBox.checked == true) {
|
165 |
|
|
alert("You have selected to search all possible existing fields. This search will take longer.");
|
166 |
|
|
}
|
167 |
|
|
}
|