Project

General

Profile

1 4235 leinfelder
<%@ page    language="java" %>
2
<%
3
/**
4
 *
5
 * '$RCSfile$'
6
 * Copyright: 2008 Regents of the University of California and the
7
 *             National Center for Ecological Analysis and Synthesis
8
 *    '$Author$'
9
 *      '$Date$'
10
 * '$Revision$'
11
 *
12
 * This program is free software; you can redistribute it and/or modify
13
 * it under the terms of the GNU General Public License as published by
14
 * the Free Software Foundation; either version 2 of the License, or
15
 * (at your option) any later version.
16
 *
17
 * This program is distributed in the hope that it will be useful,
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 * GNU General Public License for more details.
21
22
 * You should have received a copy of the GNU General Public License
23
 * along with this program; if not, write to the Free Software
24
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25
 */
26
%>
27
28
<%@ include file="../../common/common-settings.jsp"%>
29
<%@ include file="../../common/configure-check.jsp"%>
30
31 3510 leinfelder
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
32
<html>
33
<head>
34
<title>FIRST Assessment Metadata Repository</title>
35
<link rel="stylesheet" type="text/css"
36 4235 leinfelder
	href="<%=STYLE_SKINS_URL%>/first/first.css">
37 3510 leinfelder
<script language="JavaScript" type="text/JavaScript"
38 4235 leinfelder
	src="<%=STYLE_SKINS_URL%>/first/first.js"></script>
39 3510 leinfelder
<script language="JavaScript" type="text/JavaScript"
40 4290 leinfelder
	src="<%=STYLE_SKINS_URL%>/first/search.js"></script>
41
<script language="JavaScript" type="text/JavaScript"
42 4235 leinfelder
	src="<%=STYLE_COMMON_URL%>/branding.js"></script>
43 4290 leinfelder
<script language="Javascript" type="text/JavaScript"
44
	src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js">
45 4388 leinfelder
</script>
46
<script language="Javascript" type="text/JavaScript"
47
	src="<%=STYLE_COMMON_URL%>/effects.js">
48
</script>
49 3510 leinfelder
<script language="Javascript">
50
51 4364 leinfelder
		function browseAll() {
52
			document.getElementById("searchBox").value = "%";
53
			searchAssessments();
54
		}
55
56
		function searchAssessments() {
57
			var searchString = document.getElementById("searchBox").value;
58
			var institution = document.getElementById("institution").value;
59
			var instructor = document.getElementById("instructor").value;
60
			var course = document.getElementById("course").value;
61
			var year = document.getElementById("year").value;
62 4562 leinfelder
			var otherField = document.getElementById("otherField").value;
63
			var otherValue = document.getElementById("otherValue").value;
64 4364 leinfelder
			var searchTerms = new Object();
65
			searchTerms["anyValue"] = searchString;
66
			searchTerms["institution/organizationName"] = institution;
67
			searchTerms["instructor/individualName/surName"] = instructor;
68
			searchTerms["course/lom/general/title/string"] = course;
69
			searchTerms["course/year"] = year;
70 4562 leinfelder
			searchTerms[otherField] = otherValue;
71 3550 leinfelder
72 4364 leinfelder
			var operator = "UNION";
73
			if (document.getElementById("all").checked) {
74
				operator = "INTERSECT";
75 3510 leinfelder
			}
76 3550 leinfelder
77 4290 leinfelder
			var metacatURL = "<%=CONTEXT_URL%>/metacat";
78
79
			//generate the query
80
			var queryString =
81
				generateSearchString(
82 4364 leinfelder
					searchTerms,
83
					operator,
84 4290 leinfelder
					true,
85
					false);
86 4364 leinfelder
87
			//alert("queryString=" + queryString);
88
89 4388 leinfelder
			callAjax(metacatURL, queryString, "first-assessment", "ajaxSearchResults");
90
91
			Effect.Appear('ajaxSearchResults', {duration: 1.5});
92 4290 leinfelder
		}
93 3510 leinfelder
   </script>
94
</head>
95
<body>
96
<script language="JavaScript">
97 4235 leinfelder
          insertTemplateOpening("<%=CONTEXT_URL%>");
98
          insertSearchBox("<%=CONTEXT_URL%>");
99 3510 leinfelder
      </script>
100
101 4386 leinfelder
<table width="100%" border="0" cellspacing="20" cellpadding="0">
102 3510 leinfelder
	<tr>
103 4388 leinfelder
		<th colspan="2">
104
			Search
105
		</th>
106
	</tr>
107
	<tr>
108 3510 leinfelder
		<td>
109 4364 leinfelder
			<form method="POST" action="<%=SERVLET_URL%>" target="_top" id="searchForm">
110 3510 leinfelder
111
			<table class="tables" cellpadding="8" cellspacing="0">
112
				<tr class="sectheader">
113 4388 leinfelder
114 4364 leinfelder
					<td class="borderbottom" align="left" colspan="2">
115 4388 leinfelder
						Any field:
116
						<input size="30" name="searchstring" type="text" value="" id="searchBox">
117 3510 leinfelder
					</td>
118 4388 leinfelder
119 4364 leinfelder
				</tr>
120 3510 leinfelder
				<tr>
121 4388 leinfelder
					<td align="left" class="borderbottom">
122 4362 leinfelder
123 4364 leinfelder
						<input name="query" type="hidden">
124
						<input name="qformat" value="first" type="hidden">
125
						<input type="hidden" name="action" value="squery">
126 4305 leinfelder
127 4364 leinfelder
						<table>
128 4388 leinfelder
129 4364 leinfelder
							<tr>
130
								<td>Institution: </td>
131
								<td><input name="institution" id="institution" type="text" size="14"/></td>
132
							</tr>
133
							<tr>
134
								<td>Course: </td>
135
								<td><input name="course" id="course" type="text" size="14"/></td>
136
							</tr>
137
							<tr>
138
								<td>Instructor: </td>
139
								<td><input name="instructor" id="instructor" type="text" size="14"/></td>
140
							</tr>
141
							<tr>
142
								<td>Year: </td>
143
								<td><input name="year" id="year" type="text" size="4"/></td>
144
							</tr>
145 4562 leinfelder
							<tr>
146
								<td>
147
									<select id="otherField" name="otherValue">
148
										<option value="assessment/@title">Assessment Title</option>
149
										<option value="assessment/@type">Assessment Type</option>
150
										<option value="assessment/duration">Assessment Duration</option>
151
										<option value="course/term">Course Term</option>
152
									</select>
153
								</td>
154
								<td><input name="otherValue" id="otherValue" type="text" size="14"/></td>
155
							</tr>
156 4364 leinfelder
						</table>
157 3510 leinfelder
					</td>
158 4388 leinfelder
					<td valign="bottom" class="borderbottom">
159 4364 leinfelder
						<table>
160
							<tr>
161
								<td nowrap="nowrap">
162
									<input name="anyAll" id="any" value="UNION" type="radio" checked="checked"/>
163
								</td>
164
								<td nowrap="nowrap">Match any</td>
165
							</tr>
166
							<tr>
167
								<td nowrap="nowrap">
168
									<input name="anyAll" id="all" value="INTERSECT" type="radio"/>
169
								</td>
170
								<td nowrap="nowrap">Match all</td>
171
							</tr>
172
							<tr>
173 4388 leinfelder
								<td colspan="2">
174
									<input type="button" onclick="javascript:searchAssessments()" value="Search"/>
175
								</td>
176
							</tr>
177 4364 leinfelder
						</table>
178
					</td>
179 3510 leinfelder
				</tr>
180 4388 leinfelder
181 3510 leinfelder
			</table>
182 4364 leinfelder
			</form>
183
184 3510 leinfelder
		</td>
185 4364 leinfelder
		<td colspan="1" valign="top">
186 4388 leinfelder
			<div align="left">
187 4364 leinfelder
				<p align="left">This tool allows you to search for Assessments either by keyword,
188
				or with a structured search that targets particular facets of an assessment.
189
				<br />
190
				<br />
191
				You can use the '%' character as a wildcard in your searches (e.g.,
192
				'%biology%' would locate any phrase with the word biology embedded within it).
193
				</p>
194 4388 leinfelder
				<a href="javascript:browseAll()">Browse All Assessments...</a>
195 4364 leinfelder
			</div>
196
		</td>
197 3510 leinfelder
	</tr>
198 4364 leinfelder
	<tr>
199
		<td valign="top" colspan="2">
200 4393 leinfelder
			<div id="ajaxSearchResults" style="display:none;">
201
				Loading search results
202
				<img src="<%=CONTEXT_URL%>/style/images/spinner.gif" border="none"/>
203
			</div>
204 4364 leinfelder
		</td>
205
	</tr>
206 3510 leinfelder
</table>
207
208
<script language="JavaScript">
209 4235 leinfelder
    insertTemplateClosing("<%=CONTEXT_URL%>");
210 3510 leinfelder
</script>
211
</body>
212
</html>