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: 2008-08-22 16:48:56 -0700 (Fri, 22 Aug 2008) $'
10
 * '$Revision: 4305 $'
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
<%@page import="edu.ucsb.nceas.metacat.service.SessionService"%>
33
<html>
34
<head>
35
<title>FIRST Assessment Metadata Repository</title>
36
<link rel="stylesheet" type="text/css"
37
	href="<%=STYLE_SKINS_URL%>/first/first.css">
38
<script language="JavaScript" type="text/JavaScript"
39
	src="<%=STYLE_SKINS_URL%>/first/first.js"></script>
40
<script language="JavaScript" type="text/JavaScript"
41
	src="<%=STYLE_SKINS_URL%>/first/search.js"></script>
42
<script language="JavaScript" type="text/JavaScript"
43
	src="<%=STYLE_COMMON_URL%>/branding.js"></script>
44
<script language="Javascript" type="text/JavaScript"
45
	src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js">
46
</script>	
47
<script language="Javascript" type="text/JavaScript"
48
	src="<%=STYLE_COMMON_URL%>/effects.js">
49
</script>
50
<script language="Javascript">
51
		function checkBrowser() {
52
			Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6;
53
			Prototype.Browser.IE7 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 7;
54
			Prototype.Browser.IE8 = Prototype.Browser.IE && !Prototype.Browser.IE6 && !Prototype.Browser.IE7;
55

    
56
			if (Prototype.Browser.IE6) {
57
				alert("NOTE: IE7, IE8, Firefox and Chrome are currently supported for data download.");
58
			}
59
		}
60
		function listAssessments(){
61
			var metacatURL = "<%=CONTEXT_URL%>/metacat";
62
		
63
			var docids = new Array();
64
			var doc = getIframeDocument("iframeheaderclass");
65
			var objs = doc.getElementsByName("@packageId");
66
			if (objs.length == 0) {
67
				return;
68
			}
69
			for (var i=0; i< objs.length; i++) {
70
				docids[i] = objs[i].value;
71
			}
72
				
73
			//generate the query to list assessments
74
			var queryString = 
75
				generateAssessmentListString(docids);
76
					
77
			callAjax(metacatURL, queryString, "first-assessment", "ajaxCartResults");
78
			
79
			Effect.Appear('ajaxCartResults');
80
			//Effect.BlindDown('ajaxCartResults');
81
		}
82
		
83
		function removeField(label) {
84
			var metacatURL = "<%=CONTEXT_URL%>/metacat";
85
			
86
			var myRequest = new Ajax.Request(
87
			metacatURL,
88
			{	method: 'post',
89
				parameters: { 
90
					action: 'editcart', 
91
					operation: 'removefield', 
92
					field: label, 
93
					path: null},
94
				evalScripts: true, 
95
				onSuccess: function(transport) {
96
					//in the cart, we should refresh the entire page
97
					window.location.reload();
98
				},
99
				onFailure: function(transport) {alert('failure saving field: ' + formElement.name);}
100
			 });
101
		}
102
		
103
		
104
		
105
   </script>
106
</head>
107
<body onload="checkBrowser();listAssessments()">
108
<script language="JavaScript">
109
          insertTemplateOpening("<%=CONTEXT_URL%>");
110
          insertSearchBox("<%=CONTEXT_URL%>");
111
      </script>
112

    
113
<table width="100%" border="0" cellspacing="20" cellpadding="0">
114
	<tr>
115
		<th colspan="2">Data Cart</th>
116
	</tr>
117
	<tr valign="top">
118
		<td colspan="1">
119
			<p class="emphasis">Selected Metadata Fields: 
120
				<a href="javascript:{}" onclick="Effect.Appear('fieldSelection')">Edit >></a>
121
			</p>
122
			<p>
123
				<table>
124
					<%
125
					String[] labels = 
126
						SessionService.getRegisteredSession(request.getSession().getId()).getDocumentCart().getLabels();
127
					for (int i = 0; i < labels.length; i++) {
128
					%>							
129
						<tr>
130
							<td>
131
								&nbsp;
132
								<a href="javascript:{}" onclick="removeField('<%=labels[i] %>')">
133
									<img src="<%=CONTEXT_URL%>/style/images/delete.gif" border="none"/>
134
								</a>
135
							</td>
136
							<td><%=labels[i] %> </td>
137
						</tr>	
138
					<%} %>
139
				</table>
140
			</p>
141
		</td>
142
		<td>
143
			<div id="fieldSelection" style="display:none;">
144
				<p class="emphasis">
145
					<a href="javascript:{}" onclick="Effect.Fade('fieldSelection')"> << Done</a>
146
				</p>	
147
				<form id="fieldForm" method="post" action="<%=CONTEXT_URL%>/metacat">
148
					<table>
149
						<tr>
150
							<th>Assessment</th>
151
							<th>Course</th>
152
						</tr>
153
						<tr>
154
							<td>
155
								<input type="checkbox" name="title" value="//assessment/title" />
156
									Title
157
								<br/>	
158
								<input type="checkbox" name="type" value="//assessment/type"/>
159
									Type
160
								<br/>	
161
								<input type="checkbox" name="duration" value="//assessment/duration"/>
162
									Duration
163
								<br/>	
164
								<input type="checkbox" name="groupGrading" value="//assessment/grading/@group"/>
165
									Group Grading
166
								<br/>	
167
								<input type="checkbox" name="groupSize" value="//assessment/grading/@size"/>
168
									Group Size
169
								<br/>	
170
								<input type="checkbox" name="groupGradingApproach" value="//assessment/grading"/>
171
									Group Grading Approach
172
							</td>	
173
							<td>
174
								<input type="checkbox" name="year" value="//course/year"/>
175
									Year
176
								<br/>	
177
								<input type="checkbox" name="term" value="//course/term"/>
178
									Term
179
								<br/>	
180
								<input type="checkbox" name="startDate" value="//course/coverage/rangeOfDates/beginDate/calendarDate"/>
181
									Start Date
182
								<br/>	
183
								<input type="checkbox" name="endDate" value="//course/coverage/rangeOfDates/endDate/calendarDate"/>						
184
									End Date
185
								<br/>	
186
								<input type="checkbox" name="courseTitle" value="//course/lom/general/title/string"/>
187
									Title
188
								<br/>	
189
								<input type="checkbox" name="courseId" value="//course/lom/general/identifier/entry"/>
190
									ID
191
								<br/>	
192
								<input type="checkbox" name="courseDescription" value="//course/lom/general/description/string"/>
193
									Description
194
							</td>
195
						</tr>
196
						<tr>
197
							<th>Institution</th>
198
							<th>Instructor</th>
199
						</tr>
200
						<tr>	
201
							<td>
202
								<input type="checkbox" name="institutionName" value="//institution/organizationName"/>
203
									Name
204
							</td>
205
							<td>
206
								<input type="checkbox" name="instructorName" value="//instructor/individualName/surName"/>
207
									Name
208
								<br/>	
209
								<input type="checkbox" name="instructorOrganization" value="//instructor/organizationName"/>
210
									Organization	
211
							</td>
212
						</tr>
213
						<tr>
214
							<td></td>
215
							<td>
216
								<input type="button" value="Save Field Selections" onclick="saveFields('fieldForm', '<%=CONTEXT_URL%>/metacat')"/>
217
							</td>	
218
						</tr>	
219
					</table>		
220
				</form>
221
			</div>
222
		</td>
223
	</tr>
224
	<tr>
225
		<th colspan="2">
226
			&nbsp;
227
		</th>
228
	</tr>
229
	<tr>
230
		<td colspan="2">
231
			<div id="ajaxCartResults" style="/*display:none;*/">
232
				<p class="emphasis">Data Cart is Empty</p>
233
			</div>
234
		</td>
235
	</tr>
236
</table>
237

    
238
<script language="JavaScript">          
239
    insertTemplateClosing("<%=CONTEXT_URL%>");
240
</script>
241
</body>
242
</html>
(3-3/22)