Project

General

Profile

1
<%@ page     language="java" %>
2
<!--
3
/**
4
  *  '$RCSfile$'
5
  *      Authors: Matt Jones, CHad Berkley
6
  *    Copyright: 2000 Regents of the University of California and the
7
  *               National Center for Ecological Analysis and Synthesis
8
  *  For Details: http://www.nceas.ucsb.edu/
9
  *
10
  *   '$Author: tao $'
11
  *     '$Date: 2007-09-06 18:17:52 -0700 (Thu, 06 Sep 2007) $'
12
  * '$Revision: 3403 $'
13
  * 
14
  * This program is free software; you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License as published by
16
  * the Free Software Foundation; either version 2 of the License, or
17
  * (at your option) any later version.
18
  *
19
  * This program is distributed in the hope that it will be useful,
20
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
  * GNU General Public License for more details.
23
  *
24
  * You should have received a copy of the GNU General Public License
25
  * along with this program; if not, write to the Free Software
26
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27
  *
28
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
29
  * convert an XML file showing the resultset of a query
30
  * into an HTML format suitable for rendering with modern web browsers.
31
  */
32
-->
33
<%@ include file="settings.jsp"%>
34
<%@ include file="session_vars.jsp"%>
35
<!-- *********************** START SEARCHBOX TABLE ************************* -->
36
<html>
37
<head>
38
  <title>Metacat Data Catalog Search Page</title>
39
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
40
  <link href="<%=relativeRoot%>/default.css" rel="stylesheet" type="text/css">
41
  <script language="javascript" 
42
    type="text/javascript" src="<%=relativeRoot%>/default.js">
43
  </script>
44
  <script language="javascript" type="text/javascript">
45
    function trim(stringToTrim) {
46
      return stringToTrim.replace(/^\s*/, '').replace(/\s*$/,'');
47
    }
48
    function allowSearch(formObj) {
49
      var canSearch = true;
50
      var searchString = trim(formObj.elements["anyfield"].value);
51
      if (searchString=="") {
52
        if (confirm("Show *all* data in the Catalog?\n(this may take some time!)            ")) {
53
	      formObj.elements["anyfield"].value = "%";
54
	      canSearch = true;
55
	      } else {
56
	        formObj.elements["anyfield"].focus();
57
	        canSearch = false;
58
	      }
59
      } 
60
      return canSearch;
61
    }
62
    function keywordSearch(formObj, searchKeyword) {
63

    
64
       var searchString = trim(searchKeyword);
65
  
66
        if (searchString=="") searchString="%";
67
  
68
        formObj.anyfield.value=searchString;
69

    
70
        if(checkSearch(formObj)){
71
             formObj.submit();
72
       }
73
       return true;
74
    }
75
    function checkSearch(submitFormObj) {
76
                var checkBox = document.getElementById("searchAll");
77
                var searchBox = document.getElementById("searchBox");
78
                var searchString = trim(searchBox.value);
79

    
80
                if (searchString=="") {
81
                        if (confirm("Show *all* data in the KNB?")) {
82
          			searchString = "%";
83
        		} else {
84
          			return false;
85
        		}		
86
                }
87

    
88
                //if(document.forms[0].radios[0].checked){
89
		if(!checkBox.checked){
90
                        if(searchString!="%"){
91
                                searchBox.name = "title";
92
                                searchBox.id = "searchBox";
93

    
94
                                submitFormObj.surName.value = searchString;
95
                                submitFormObj.givenName.value = searchString;
96
                                submitFormObj.keyword.value = searchString;
97
                                submitFormObj.organizationName.value = searchString;
98
                                submitFormObj.para.value = searchString;
99
                                submitFormObj.geographicDescription.value = searchString;
100
                                submitFormObj.literalLayout.value = searchString;
101
                                submitFormObj.operator.value="UNION";
102
                                var abs = document.getElementById("abstract");
103
                                abs.value=searchString;
104
                        } else {
105
                                searchBox.name = "anyfield";
106
                                searchBox.id = "searchBox";
107
                                searchBox.value = "%";
108

    
109
                                submitFormObj.surName.value = "";
110
                                submitFormObj.givenName.value = "";
111
                                submitFormObj.keyword.value = "";
112
                                submitFormObj.organizationName.value = "";
113
                                submitFormObj.para.value = "";
114
                                submitFormObj.geographicDescription.value = "";
115
                                submitFormObj.literalLayout.value = "";
116
                                submitFormObj.operator.value="INTERSECT";
117
                                var abs = document.getElementById("abstract");
118
                                abs.value="";
119

    
120
			 }
121
                } else {
122
                        searchBox.name = "anyfield";
123
                        searchBox.id = "searchBox";
124

    
125
                        submitFormObj.surName.value = "";
126
                        submitFormObj.givenName.value = "";
127
                        submitFormObj.keyword.value = "";
128
                        submitFormObj.organizationName.value = "";
129
                        submitFormObj.para.value = "";
130
                        submitFormObj.geographicDescription.value = "";
131
                        submitFormObj.literalLayout.value = "";
132
                        submitFormObj.operator.value="INTERSECT";
133
                        var abs = document.getElementById("abstract");
134
                        abs.value="";
135
                }
136

    
137

    
138
                var radioInput = document.getElementsByName("search");
139
		       radioInput[0].name = "";
140

    
141
                return true;
142
        }
143
  </script>
144
</head>
145

    
146
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
147
  <table width="750px" align="center" cellspacing="0" cellpadding="0">
148
    <tr> 
149
      <td width="10" align="right" valign="top">
150
        <img src="<%=relativeRoot%>/images/panelhead_bg_lcorner.gif" 
151
          width="10" height="21">
152
      </td>
153
      <td class="sectionheader">
154
        search for data 
155
      </td>
156
      <td width="10" align="left" valign="top"> 
157
        <img src="<%=relativeRoot%>/images/panelhead_bg_rcorner.gif" 
158
          width="10" height="21">
159
      </td>
160
    </tr>
161
    <tr> 
162
      <td colspan="3">
163
        <table width="100%" border="0" cellpadding="0" cellspacing="0" 
164
          class="subpanel">
165
          <tr> 
166
            <td colspan="2"></td>
167
          </tr>
168
          <tr valign="baseline"> 
169
            <td colspan="2">
170
              <form action="<%=METACAT_URL%>" name="searchForm" method="post" 
171
                target="_top" onSubmit="return checkSearch(this);">
172
                <%=sessionidField%>
173
                <%=SIMPLE_SEARCH_METACAT_POST_FIELDS%>
174
                <input type="hidden" name="organizationName">
175
  			    <input type="hidden" name="surName">
176
  			    <input type="hidden" name="givenName">
177
  			    <input type="hidden" name="keyword">
178
  			    <input type="hidden" name="para">
179
  			    <input type="hidden" name="geographicDescription">
180
  			    <input type="hidden" name="literalLayout">
181
  			    <input type="hidden" name="abstract/para" id="abstract">
182
                <table width="100%" border="0" cellpadding="5" cellspacing="0">
183
                  <tr> 
184
                    <td width="94" rowspan="2" align="left" valign="top">
185
                      <img src="<%=relativeRoot%>/images/search.jpg" 
186
                        width="94" height="80">
187
                    </td>
188
                    <td colspan="2" valign="middle" class="text_example">
189
                      <p> 
190
                        <%= loginStatus %> &nbsp;
191
                        (<a href="<%=relativeRoot%>/index.jsp#loginanchor" 
192
                          target="_top"><%=loginButtonLabel%></a>).&nbsp; 
193
                        You may search the data catalog without being logged 
194
                        into your account, but will have access only to 
195
                        &quot;public&quot; data (see &quot;login &amp; 
196
                        registration&quot;)
197
                      </p>
198
                      <p>
199
                        Enter a search phrase (e.g. biodiversity) to search 
200
                        for data sets in the data catalog, or simply browse 
201
                        by category using the links below.
202
                      </p>
203
                    </td>
204
                  </tr>
205
                  <tr valign="middle"> 
206
                    <td align="right" class="searchcat"> 
207
                      <input type="text" name="anyfield" size="30" 
208
                        maxlength="200" id="searchBox">&nbsp;&nbsp;
209
                    </td>
210
                    <td width="365" align="left" class="searchcat"> 
211
                      <input type="submit" value="Search Data Catalog">
212
                      &nbsp;&nbsp;&nbsp;
213
                      
214
                      <a target="_top" 
215
                        href="<%=relativeRoot%>/index_advanced.jsp"> 
216
                          &raquo;&nbsp;advanced&nbsp;search&nbsp;&laquo;</a>
217
                      
218
                    </td>
219
                  </tr>
220

    
221
                </table>
222
              </form>
223
            </td>
224
          </tr>
225
         <tr valign="baseline" >
226
         
227
             <td colspan="2">
228
                 <table width="100%" border="0" cellpadding="0" cellspacing="0" >
229
                   <from>
230
		            <tr>
231
		               <td width="40">		    
232
			            </td>
233
			            <td width="158">
234
			                 <input name="search" type="radio" checked><span class="text_plain"> Search Title, Abstract, Keywords, Personnel (Quicker)</span></input>
235
		               </td>
236
		           </tr>
237
		            <tr>
238
		                 <td width="40">		    
239
			              </td>
240
			              <td width="158">
241
			                    <input name="search" type="radio" id="searchAll"><span class="text_plain"> Search all fields (Slower)</span></input>
242
		                 </td>
243
		           </tr>
244
		        </form>
245
		      </table>
246
             </td>
247
		  </tr>
248
	  
249
<%
250
/*
251
US Geography
252
------------
253
Northeast, Southeast, South, Midwest, Northwest, Southwest, Pacific Ocean, Atlantic Ocean, 
254
Great Lakes, (could also list states here)
255
*/
256
%>
257
          <tr> 
258
            <td width="375" class="searchcat">Taxonomy</td>
259
            <td width="365" class="searchcat">Habitat</td>
260
          </tr>
261
          <tr> 
262
            <td width="375" class="searchsubcat">
263
              <a href="#" onClick="keywordSearch(document.searchForm, 'plant')" class="searchsubcat">Plant,</a> 
264
              <a href="#" onClick="keywordSearch(document.searchForm, 'invertebrate')" class="searchsubcat">Invertebrate,</a> 
265
              <a href="#" onClick="keywordSearch(document.searchForm, 'mammal')" class="searchsubcat">Mammal,</a> 
266
              <a href="#" onClick="keywordSearch(document.searchForm, 'bird')" class="searchsubcat">Bird,</a> 
267
              <a href="#" onClick="keywordSearch(document.searchForm, 'reptile')" class="searchsubcat">Reptile,</a> 
268
              <a href="#" onClick="keywordSearch(document.searchForm, 'amphibian')" class="searchsubcat">Amphibian,</a>
269
              <a href="#" onClick="keywordSearch(document.searchForm, 'fungi')" class="searchsubcat">Fungi,</a>
270
              <a href="#" onClick="keywordSearch(document.searchForm, 'microbe')" class="searchsubcat">Microbe,</a>
271
              <a href="#" onClick="keywordSearch(document.searchForm, 'virus')" class="searchsubcat">Virus</a>
272
            </td>
273
            <td width="365" class="searchsubcat">
274
              <a href="#" onClick="keywordSearch(document.searchForm, 'alpine')" class="searchsubcat">Alpine,</a> 
275
              <a href="#" onClick="keywordSearch(document.searchForm, 'aquatic')" class="searchsubcat">Aquatic,</a> 
276
              <a href="#" onClick="keywordSearch(document.searchForm, 'beach')" class="searchsubcat">Beach,</a> 
277
              <a href="#" onClick="keywordSearch(document.searchForm, 'benthic')" class="searchsubcat">Benthic,</a> 
278
              <a href="#" onClick="keywordSearch(document.searchForm, 'desert')" class="searchsubcat">Desert,</a> 
279
              <a href="#" onClick="keywordSearch(document.searchForm, 'estuar')" class="searchsubcat">Estuary,</a>
280
              <a href="#" onClick="keywordSearch(document.searchForm, 'forest')" class="searchsubcat">Forest,</a>
281
              <a href="#" onClick="keywordSearch(document.searchForm, 'grassland')" class="searchsubcat">Grassland,</a>
282
              <a href="#" onClick="keywordSearch(document.searchForm, 'marine')" class="searchsubcat">Marine,</a>
283
              <a href="#" onClick="keywordSearch(document.searchForm, 'montane')" class="searchsubcat">Montane,</a>
284
              <a href="#" onClick="keywordSearch(document.searchForm, 'ocean')" class="searchsubcat">Oceanic,</a>
285
              <a href="#" onClick="keywordSearch(document.searchForm, 'savanna')" class="searchsubcat">Savanna,</a>
286
              <a href="#" onClick="keywordSearch(document.searchForm, 'shrubland')" class="searchsubcat">Shrubland,</a>
287
              <a href="#" onClick="keywordSearch(document.searchForm, 'terrestrial')" class="searchsubcat">Terrestrial,</a>
288
              <a href="#" onClick="keywordSearch(document.searchForm, 'tundra')" class="searchsubcat">Tundra,</a>
289
              <a href="#" onClick="keywordSearch(document.searchForm, 'urban')" class="searchsubcat">Urban,</a>
290
              <a href="#" onClick="keywordSearch(document.searchForm, 'wetland')" class="searchsubcat">Wetland</a>
291
            </td>
292
          </tr>
293
          <tr> 
294
            <td width="375">&nbsp;</td>
295
            <td width="365">&nbsp;</td>
296
          </tr>
297
        </table>
298
      </td>
299
    </tr>
300
  </table>
301
</body>
302
<!-- ************************* END SEARCHBOX TABLE ************************* -->
(10-10/14)