Project

General

Profile

« Previous | Next » 

Revision 2545

Added by sgarg over 19 years ago

Changes to the NRS index and header html code so that restricted search on name, title, abstract, keywords etc is done. action=squery is used for this instead of action=query.

View differences:

header.html
28 28
  <title>UCNRS Data Registry</title>
29 29
  <link rel="stylesheet" type="text/css" 
30 30
        href="@systemidserver@@style-skins-path@/nrs/nrs.css"></link>
31
  <script language="Javascript">
32
        function trim(stringToTrim) {
33
                return stringToTrim.replace(/^\s*/, '').replace(/\s*$/,'');
34
        }
35

  
36
        function checkSearch(submitFormObj) {
37
                var searchString = trim(submitFormObj.searchstring.value);
38
                if (searchString=="") {
39
                        searchString="%";
40
                }
41

  
42
                submitFormObj.query.value = "<pathquery version=\"1.2\">"+
43
                                                  +"<querytitle>Web-Search</querytitle>"
44
                                                  +"<returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype>"
45
                                                           +"<returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype>"
46
                                                           +"<returndoctype>-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN</returndoctype>"
47
                                                           +"<returndoctype>-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN</returndoctype>"
48
                                                           +"<returndoctype>-//NCEAS//resource//EN</returndoctype>"
49
                                                           +"<returndoctype>-//NCEAS//eml-dataset//EN</returndoctype>"
50
                                                           +"<returnfield>originator/individualName/surName</returnfield>"
51
                                                           +"<returnfield>originator/individualName/givenName</returnfield>"
52
                                                           +"<returnfield>creator/individualName/surName</returnfield>"
53
                                                           +"<returnfield>creator/individualName/givenName</returnfield>"
54
                                                           +"<returnfield>originator/organizationName</returnfield>"
55
                                                           +"<returnfield>creator/organizationName</returnfield>"
56
                                                           +"<returnfield>dataset/title</returnfield>"
57
                                                           +"<returnfield>keyword</returnfield>"
58
                                                           +"<querygroup operator=\"INTERSECT\">"
59
                                                                +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
60
                                                                        +"<value>University of California Natural Reserve System</value>"
61
                                                                        +"<pathexpr>organizationName</pathexpr>"
62
                                                                +"</queryterm>"
63
                                                                +"<querygroup operator=\"UNION\">"
64
                                                                        +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
65
                                                                                +"<value>" + searchString + "</value>"
66
                                                                                +"<pathexpr>surName</pathexpr>"
67
                                                                        +"</queryterm>"
68
                                                                        +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
69
                                                                                +"<value>" + searchString + "</value>"
70
                                                                                +"<pathexpr>givenName</pathexpr>"
71
                                                                        +"</queryterm>"
72
                                                                        +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
73
                                                                                +"<value>" + searchString + "</value>"
74
                                                                                +"<pathexpr>keyword</pathexpr>"
75
                                                                        +"</queryterm>"
76
                                                                        +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
77
                                                                                +"<value>" + searchString + "</value>"
78
                                                                                +"<pathexpr>para</pathexpr>"
79
                                                                        +"</queryterm>"
80
                                                                        +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
81
                                                                                +"<value>" + searchString + "</value>"
82
                                                                                +"<pathexpr>geographicDescription</pathexpr>"
83
                                                                        +"</queryterm>"
84
                                                                        +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
85
                                                                                +"<value>" + searchString + "</value>"
86
                                                                                +"<pathexpr>literalLayout</pathexpr>"
87
                                                                        +"</queryterm>"
88
                                                                        +"<queryterm searchmode=\"contains\" casesensitive=\"false\">"
89
                                                                                +"<value>" + searchString + "</value>"
90
                                                                                +"<pathexpr>abstract/para</pathexpr>"
91
                                                                        +"</queryterm>"
92
                                                                +"</querygroup>"
93
                                                          +"</querygroup>"
94
                                                  +"</pathquery>";
95
                return true;
96
        }
97
  </script>
31 98
</head>
32 99

  
33 100
<body>
......
55 122
    <td valign="top" width="20%"> 
56 123
<p class="searchbox">
57 124
Search for Data<br />
58
<form method="POST" action="@servlet-path@" target="_top">
125
<form method="POST" action="@servlet-path@" target="_top" onSubmit="return checkSearch(this)">
59 126
  <input value="INTERSECT" name="operator" type="hidden">   
60
  <input size="14" name="anyfield" type="text" value="">
61
  <input name="organizationName" value="University of California Natural Reserve System" type="hidden">
62
  <input name="action" value="query" type="hidden">
127
  <input size="14" name="searchstring" type="text" value="">
128
  <input name="query" type="hidden"/>
63 129
  <input name="qformat" value="nrs" type="hidden">
64 130
  <input name="enableediting" value="true" type="hidden">
65
  <input name="operator" value="UNION" type="hidden">
66
  <input name="returnfield" value="originator/individualName/surName" type="hidden">
67
  <input name="returnfield" value="originator/individualName/givenName" type="hidden">
68
  <input name="returnfield" value="creator/individualName/surName" type="hidden">
69
  <input name="returnfield" value="creator/individualName/givenName" type="hidden">
70
  <input name="returnfield" value="originator/organizationName" type="hidden">
71
  <input name="returnfield" value="creator/organizationName" type="hidden">
72
  <input name="returnfield" value="dataset/title" type="hidden">
73
  <input name="returnfield" value="keyword" type="hidden">
74
  <input name="returndoctype" value="eml://ecoinformatics.org/eml-2.0.1" type="hidden">
75
  <input name="returndoctype" value="eml://ecoinformatics.org/eml-2.0.0" type="hidden">
76
  <input name="returndoctype" value="-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN" type="hidden">
77
  <input name="returndoctype" value="-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN" type="hidden">
78
  <input name="returndoctype" value="-//NCEAS//resource//EN" type="hidden">
79
  <input name="returndoctype" value="-//NCEAS//eml-dataset//EN" type="hidden">
131
  <input type="hidden" name="action" value="squery">
80 132
  <!-- <input value="Start Search" type="submit"> -->
81 133
</form>
82 134
</p>

Also available in: Unified diff