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
		
52
		function listAssessments(){
53
			var metacatURL = "<%=CONTEXT_URL%>/metacat";
54
		
55
			var docids = new Array();
56
			var objs = document.getElementsByName("@packageId");
57
			for (var i=0; i< objs.length; i++) {
58
				docids[i] = objs[i].value;
59
			}
60
				
61
			//generate the query to list assessments
62
			var queryString = 
63
				generateAssessmentListString(docids);
64
					
65
			callAjax(metacatURL, queryString, "first-assessment", "ajaxCartResults");
66
			
67
			Effect.Appear('ajaxCartResults');
68
			//Effect.BlindDown('ajaxCartResults');
69
		}
70
		
71
   </script>
72
</head>
73
<body onload="listAssessments()">
74
<script language="JavaScript">
75
          insertTemplateOpening("<%=CONTEXT_URL%>");
76
          insertSearchBox("<%=CONTEXT_URL%>");
77
      </script>
78

    
79
<table width="100%" border="0" cellspacing="0" cellpadding="0">
80
	<tr>
81
		<th>
82
			Cart
83
			<form method="POST" action="<%=SERVLET_URL%>" target="_top" id="searchForm">
84
				<input name="qformat" value="first-assessment" type="hidden"> 
85
				<input name="action" value="squery" type="hidden"> 	
86
				
87
				<%
88
				String[] docids = 
89
					SessionService.getRegisteredSession(request.getSession().getId()).getDocumentCart().getDocids() ;
90
				for (int i = 0; i < docids.length; i++) {
91
				%>							
92
					<input name="@packageId" value="<%=docids[i] %>" type="hidden"> 
93
				<%} %>	
94
			</form>
95
		</th>
96
	</tr>
97
	<tr>
98
		<td>
99
			Fields:
100
			<ul>
101
				<%
102
				String[] labels = 
103
					SessionService.getRegisteredSession(request.getSession().getId()).getDocumentCart().getLabels();
104
				for (int i = 0; i < labels.length; i++) {
105
				%>							
106
					<li><%=labels[i] %></li>
107
				<%} %>
108
			</ul>
109
		</td>
110
	</tr>
111
	<tr>
112
		<td>
113
			<div id="ajaxCartResults" style="display:none;">Loading Cart...</div>
114
		</td>
115
	</tr>
116
</table>
117

    
118
<script language="JavaScript">          
119
    insertTemplateClosing("<%=CONTEXT_URL%>");
120
</script>
121
</body>
122
</html>
(3-3/14)