Project

General

Profile

1
<%@ 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: leinfelder $'
9
 *      '$Date: 2009-07-27 12:59:14 -0700 (Mon, 27 Jul 2009) $'
10
 * '$Revision: 4997 $'
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
<!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
	href="<%=STYLE_SKINS_URL%>/first/first.css">
37
<script language="JavaScript" type="text/JavaScript"
38
	src="<%=STYLE_SKINS_URL%>/first/first.js"></script>
39
<script language="JavaScript" type="text/JavaScript"
40
	src="<%=STYLE_SKINS_URL%>/first/search.js"></script>
41
<script language="JavaScript" type="text/JavaScript"
42
	src="<%=STYLE_COMMON_URL%>/branding.js"></script>
43
<script language="Javascript" type="text/JavaScript"
44
	src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js">
45
</script>
46
<script language="Javascript" type="text/JavaScript"
47
	src="<%=STYLE_COMMON_URL%>/effects.js">
48
</script>
49
<script language="Javascript">
50

    
51
		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
			var otherField = document.getElementById("otherField").value;
63
			var otherValue = document.getElementById("otherValue").value;
64
			//keywords
65
			var keywordThesaurus1 = document.getElementById("keywordThesaurus1").value;
66
			var keyword1 = document.getElementById("keyword1").value;
67

    
68
			
69
			var searchTerms = new Object();
70
			searchTerms["anyValue"] = searchString;
71
			searchTerms["institution/organizationName"] = institution;
72
			searchTerms["instructor/individualName/surName"] = instructor;
73
			searchTerms["course/lom/general/title/string"] = course;
74
			searchTerms["course/year"] = year;
75
			searchTerms[otherField] = otherValue;
76
			//TODO: implement thesaurus matching (compound INTERSECTION)
77
			searchTerms["keyword"] = keyword1;
78
			
79
			var operator = "UNION";
80
			if (document.getElementById("all").checked) {
81
				operator = "INTERSECT";
82
			}
83
			
84
			var metacatURL = "<%=CONTEXT_URL%>/metacat";
85
			
86
			//generate the query
87
			var queryString = 
88
				generateSearchString(
89
					searchTerms,
90
					operator,
91
					true, 
92
					false);
93
			
94
			//alert("queryString=" + queryString);
95
			
96
			callAjax(metacatURL, queryString, "first-assessment", "ajaxSearchResults");
97
			
98
			Effect.Appear('ajaxSearchResults', {duration: 1.5});		
99
		}
100
   </script>
101
</head>
102
<body>
103
<script language="JavaScript">
104
          insertTemplateOpening("<%=CONTEXT_URL%>");
105
          insertSearchBox("<%=CONTEXT_URL%>");
106
      </script>
107

    
108
<table width="100%" border="0" cellspacing="20" cellpadding="0">
109
	<tr>
110
		<th colspan="2">
111
			Search
112
		</th>
113
	</tr>		
114
	<tr>
115
		<td>
116
			<form method="POST" action="<%=SERVLET_URL%>" target="_top" id="searchForm">
117
			
118
			<table class="tables" cellpadding="8" cellspacing="0">
119
				<tr class="sectheader">
120

    
121
					<td class="borderbottom" align="left" colspan="2">
122
						Any field:
123
						<input size="30" name="searchstring" type="text" value="" id="searchBox">
124
					</td>
125

    
126
				</tr>
127
				<tr>
128
					<td valign="top" align="left" class="borderbottom">
129
							
130
						<input name="query" type="hidden"> 
131
						<input name="qformat" value="first" type="hidden"> 
132
						<input type="hidden" name="action" value="squery"> 								
133
						
134
						<table>
135
							<tr>
136
								<td nowrap="nowrap">Question contains: </td>
137
								<td><input disabled="disabled" readonly="readonly" name="question" id="question" type="text" size="14"/></td>
138
							</tr>
139
							<tr>
140
								<td>Institution: </td>
141
								<td><input name="institution" id="institution" type="text" size="14"/></td>
142
							</tr>
143
							<tr>
144
								<td>Course: </td>
145
								<td><input name="course" id="course" type="text" size="14"/></td>
146
							</tr>
147
							<tr>
148
								<td>Instructor: </td>
149
								<td><input name="instructor" id="instructor" type="text" size="14"/></td>
150
							</tr>
151
							<tr>
152
								<td>Year: </td>
153
								<td><input name="year" id="year" type="text" size="4"/></td>
154
							</tr>
155
							
156
						</table>
157
					</td>
158
					<td valign="top" class="borderbottom">
159
						<table>
160
							<tr>
161
								<td>
162
									<select id="otherField" name="otherField">
163
										<option value="assessment/title">Assessment Title</option>
164
										<option value="assessment/type">Assessment Type</option>
165
										<option value="assessment/duration">Assessment Duration</option>
166
										<option value="assessment/grading/@group">Group Grading</option>
167
										<option value="assessment/grading/@size">Group Size</option>
168
										<option value="assessment/grading">Group Grading Approach</option>
169

    
170
										<option value="course/lom/general/identifier/entry">Course Id</option>
171
										<option value="course/lom/general/title/string">Course Title</option>
172
										<option value="course/lom/general/description/string">Course Description</option>
173
										<option value="course/term">Course Term</option>
174
										<option value="course/year">Course Year</option>
175
										<option value="course/coverage/rangeOfDates/beginDate/calendarDate">Course Start Date</option>
176
										<option value="course/coverage/rangeOfDates/endDate/calendarDate">Course End Date</option>
177

    
178
										<option value="institution/organizationName">Institution Name</option>
179
										<option value="instructor/individualName/surName">Instructor Surname</option>
180
										<option value="instructor/organizationName">Instructor Organization</option>
181

    
182
									</select>
183
								</td>
184
								<td><input name="otherValue" id="otherValue" type="text" size="14"/></td>
185
							</tr>
186
							<tr>
187
								<td colspan="2"><input type="button" value="+"/></td>
188
							</tr>
189
							<tr>
190
								<td colspan="2">Keywords</td>
191
							</tr>
192
							<tr>
193
								<td>
194
									<select id="keywordThesaurus1" name="keywordThesaurus1">
195
										<option value=""></option>
196
										<option value="keywordThesaurus">NBII</option>
197
										<option value="keywordThesaurus">Bloom</option>
198
									</select>
199
								</td>
200
								<td><input name="keyword1" id="keyword1" type="text" size="14"/></td>
201
							</tr>
202
							<tr>
203
								<td colspan="2"><input type="button" value="+"/></td>
204
							</tr>
205
							
206
						</table>
207
					</td>
208
				</tr>
209
				<tr>
210
					<td valign="top" class="borderbottom">
211
						<table>
212
							<tr>
213
								<td nowrap="nowrap">
214
									<input name="anyAll" id="any" value="UNION" type="radio" checked="checked"/>
215
								</td>
216
								<td nowrap="nowrap">Match any</td>
217
							</tr>
218
							<tr>		
219
								<td nowrap="nowrap">
220
									<input name="anyAll" id="all" value="INTERSECT" type="radio"/>
221
								</td>	
222
								<td nowrap="nowrap">Match all</td>
223
							</tr>
224
						</table>
225
					</td>
226
					<td valign="bottom" class="borderbottom">
227
						<table>
228
							<tr>
229
								<td colspan="2">
230
									<input type="button" onclick="javascript:searchAssessments()" value="Search"/>
231
								</td>
232
							</tr>
233
						</table>
234
					</td>
235
				</tr>
236
			</table>
237
			</form>
238
			
239
		</td>
240
		<td colspan="1" valign="top">
241
			<div align="left">
242
				<p align="left">This tool allows you to search for Assessments either by keyword,
243
				or with a structured search that targets particular facets of an assessment.
244
				<br />
245
				<br />
246
				You can use the '%' character as a wildcard in your searches (e.g.,
247
				'%biology%' would locate any phrase with the word biology embedded within it).
248
				</p>
249
				<a href="javascript:browseAll()">Browse All Assessments...</a>
250
			</div>
251
		</td>
252
	</tr>
253
	<tr>
254
		<td valign="top" colspan="2">	
255
			<div id="ajaxSearchResults" style="display:none;">
256
				Loading search results 
257
				<img src="<%=CONTEXT_URL%>/style/images/spinner.gif" border="none"/>
258
			</div>
259
		</td>
260
	</tr>
261
</table>
262

    
263
<script language="JavaScript">          
264
    insertTemplateClosing("<%=CONTEXT_URL%>");
265
</script>
266
</body>
267
</html>
(17-17/22)