function trim(stringToTrim) {
return stringToTrim.replace(/^\s*/, '').replace(/\s*$/,'');
}
function checkSearch(submitFormObj) {
var searchString = trim(submitFormObj.searchstring.value);
var checkBox = document.getElementById("searchAll");
if (searchString=="") {
if (confirm("Show *all* data in the KNB?")) {
searchString = "%";
} else {
return false;
}
}
if (!checkBox.checked && searchString!="%") {
submitFormObj.query.value = ""
+"Web-Search"
+"eml://ecoinformatics.org/eml-2.1.1"
+"eml://ecoinformatics.org/eml-2.1.0"
+"eml://ecoinformatics.org/eml-2.0.1"
+"eml://ecoinformatics.org/eml-2.0.0"
+"-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN"
+"-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN"
+"-//NCEAS//resource//EN"
+"-//NCEAS//eml-dataset//EN"
+"metadata"
+"originator/individualName/surName"
+"originator/individualName/givenName"
+"creator/individualName/surName"
+"creator/individualName/givenName"
+"originator/organizationName"
+"creator/organizationName"
+"dataset/title"
+"dataset/title/value"
+"keyword"
+"keyword/value"
//fgdc fields
+"idinfo/citation/citeinfo/title"
+"idinfo/citation/citeinfo/origin"
+"idinfo/keywords/theme/themekey"
+""
+""
+""
+"National Center for Ecological Analysis and Synthesis"
+"organizationName"
+""
+""
//+"%"
+"National Center for Ecological Analysis and Synthesis"
+"placekey"
+""
+""
+""
+""
+"" + searchString + ""
+"surName"
+""
+""
+"" + searchString + ""
+"givenName"
+""
+""
+"" + searchString + ""
+"keyword"
+""
+""
+"" + searchString + ""
+"keyword/value"
+""
+""
+"" + searchString + ""
+"para"
+""
+""
+"" + searchString + ""
+"geographicDescription"
+""
+""
+"" + searchString + ""
+"literalLayout"
+""
+""
+"" + searchString + ""
+"title"
+""
+""
+"" + searchString + ""
+"title/value"
+""
+""
+"" + searchString + ""
+"@packageId"
+""
+""
+"" + searchString + ""
+"abstract/para"
+""
+""
+"" + searchString + ""
+"abstract/para/value"
+""
//FGDC fields
+""
+"" + searchString + ""
+"abstract"
+""
+""
+"" + searchString + ""
+"idinfo/citation/citeinfo/title"
+""
+""
+"" + searchString + ""
+"idinfo/citation/citeinfo/origin"
+""
+""
+"" + searchString + ""
+"idinfo/keywords/theme/themekey"
+""
+""
+"" + searchString + ""
+"placekey"
+""
+""
+""
+"";
} else {
queryTermString = "";
if (searchString != "%"){
queryTermString = ""
+"" + searchString + ""
+"";
}
submitFormObj.query.value = ""
+"Web-Search"
+"eml://ecoinformatics.org/eml-2.1.1"
+"eml://ecoinformatics.org/eml-2.1.0"
+"eml://ecoinformatics.org/eml-2.0.1"
+"eml://ecoinformatics.org/eml-2.0.0"
+"-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN"
+"-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN"
+"-//NCEAS//resource//EN"
+"-//NCEAS//eml-dataset//EN"
+"metadata"
+"originator/individualName/surName"
+"originator/individualName/givenName"
+"creator/individualName/surName"
+"creator/individualName/givenName"
+"originator/organizationName"
+"creator/organizationName"
+"dataset/title"
+"dataset/title/value"
+"keyword"
+"keyword/value"
//fgdc fields
+"idinfo/citation/citeinfo/title"
+"idinfo/citation/citeinfo/origin"
+"idinfo/keywords/theme/themekey"
+""
+""
+""
+"National Center for Ecological Analysis and Synthesis"
+"organizationName"
+""
+""
//+"%"
+"National Center for Ecological Analysis and Synthesis"
+"placekey"
+""
+""
+ queryTermString
+""
+"";
}
return true;
}
function browseAll(searchFormId) {
var searchForm = document.getElementById(searchFormId);
var searchString = searchForm.searchstring;
var checkBox = document.getElementById("searchAll");
searchString.value="";
checkBox.checked = true;
if (checkSearch(searchForm)) {
searchForm.submit();
}
}
function searchAll(){
var checkBox = document.getElementById("searchCheckBox");
if (checkBox.checked == true) {
alert("You have selected to search all possible existing fields. This search will take longer.");
}
}