Project

General

Profile

metacat / lib / style / skins / first / index.jsp @ 4562

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: 2008-11-16 08:08:11 -0800 (Sun, 16 Nov 2008) $'
10
 * '$Revision: 4562 $'
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
			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
			searchTerms[otherField] = otherValue;
71
			
72
			var operator = "UNION";
73
			if (document.getElementById("all").checked) {
74
				operator = "INTERSECT";
75
			}
76
			
77
			var metacatURL = "<%=CONTEXT_URL%>/metacat";
78
			
79
			//generate the query
80
			var queryString = 
81
				generateSearchString(
82
					searchTerms,
83
					operator,
84
					true, 
85
					false);
86
			
87
			//alert("queryString=" + queryString);
88
			
89
			callAjax(metacatURL, queryString, "first-assessment", "ajaxSearchResults");
90
			
91
			Effect.Appear('ajaxSearchResults', {duration: 1.5});		
92
		}
93
   </script>
94
</head>
95
<body>
96
<script language="JavaScript">
97
          insertTemplateOpening("<%=CONTEXT_URL%>");
98
          insertSearchBox("<%=CONTEXT_URL%>");
99
      </script>
100

    
101
<table width="100%" border="0" cellspacing="20" cellpadding="0">
102
	<tr>
103
		<th colspan="2">
104
			Search
105
		</th>
106
	</tr>		
107
	<tr>
108
		<td>
109
			<form method="POST" action="<%=SERVLET_URL%>" target="_top" id="searchForm">
110
			
111
			<table class="tables" cellpadding="8" cellspacing="0">
112
				<tr class="sectheader">
113

    
114
					<td class="borderbottom" align="left" colspan="2">
115
						Any field:
116
						<input size="30" name="searchstring" type="text" value="" id="searchBox">
117
					</td>
118

    
119
				</tr>
120
				<tr>
121
					<td align="left" class="borderbottom">
122
							
123
						<input name="query" type="hidden"> 
124
						<input name="qformat" value="first" type="hidden"> 
125
						<input type="hidden" name="action" value="squery"> 								
126
						
127
						<table>
128
							
129
							<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
							<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
						</table>
157
					</td>
158
					<td valign="bottom" class="borderbottom">
159
						<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
								<td colspan="2">
174
									<input type="button" onclick="javascript:searchAssessments()" value="Search"/>
175
								</td>
176
							</tr>
177
						</table>
178
					</td>
179
				</tr>
180
				
181
			</table>
182
			</form>
183
			
184
		</td>
185
		<td colspan="1" valign="top">
186
			<div align="left">
187
				<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
				<a href="javascript:browseAll()">Browse All Assessments...</a>
195
			</div>
196
		</td>
197
	</tr>
198
	<tr>
199
		<td valign="top" colspan="2">	
200
			<div id="ajaxSearchResults" style="display:none;">
201
				Loading search results 
202
				<img src="<%=CONTEXT_URL%>/style/images/spinner.gif" border="none"/>
203
			</div>
204
		</td>
205
	</tr>
206
</table>
207

    
208
<script language="JavaScript">          
209
    insertTemplateClosing("<%=CONTEXT_URL%>");
210
</script>
211
</body>
212
</html>