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-10-29 11:26:33 -0700 (Wed, 29 Oct 2008) $'
10
 * '$Revision: 4484 $'
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
<%@page import="edu.ucsb.nceas.metacat.service.SessionService"%>
31
<%@page import="java.util.Map"%>
32

    
33

    
34
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
35
<%@page import="java.util.Iterator"%>
36
<%@page import="edu.ucsb.nceas.metacat.service.SessionService"%>
37
<html>
38
<head>
39
<title>FIRST Data Repository</title>
40
<link rel="stylesheet" type="text/css"
41
	href="<%=STYLE_SKINS_URL%>/first/first.css"></link>
42
<script language="Javascript" type="text/JavaScript"
43
	src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js">
44
</script>		
45
<script language="Javascript" type="text/JavaScript"
46
	src="<%=STYLE_COMMON_URL%>/effects.js">
47
</script>
48
<script language="Javascript">
49
		
50
	function highlight() {
51
		//Effect.Pulsate('importantThings', { pulses: 1, duration: 2 });
52
		//Effect.Fade('importantThings');
53
		new Effect.Highlight('importantThings', { startcolor: '#ffff99', endcolor: '#ffffff' });
54
		//Effect.Shake('importantThings');
55
	}
56
</script>		
57
	
58
</head>
59

    
60
<body onload="highlight()">
61
<table width="100%" border="0" cellspacing="0" cellpadding="0">
62
	<tr>
63
		<td width="75%" height="145" valign="middle" background="<%=STYLE_SKINS_URL%>/first/images/bkgrndgradient.gif">
64
			<table width="1094" border="0" cellspacing="0" cellpadding="0">
65
			  <tr>
66
			    <td width="1012"><img src="<%=STYLE_SKINS_URL%>/first/images/first_logo.png" width="1012" height="133" /></td>
67
			    <td width="82" valign="top"><br />
68
			      <table width="63" border="0" cellspacing="0" cellpadding="0">
69
			      <tr>
70
			        	<td>&nbsp;</td>
71
			      </tr>
72
			      <tr>
73
						<td>&nbsp;</td>
74
			      </tr>
75
			      <tr>
76
						<td>&nbsp;</td>
77
			      </tr>
78
			    </table>
79
			    </td>
80
			  </tr>
81
			</table>
82
		</td>
83
	</tr>
84
	<tr>
85
		<td height="48" valign="middle" bgcolor="#C8C4B9" background="<%=STYLE_SKINS_URL%>/first/images/navbarbackground.gif">
86
			<table width="780" border="0" cellspacing="0" cellpadding="0">
87
			  <tr>
88
			    <td width="30%">&nbsp;</td>
89
			    <td><a href="index.jsp" target="_top">Search</a></td>
90
			    <td><a href="about.jsp" target="_top">About</a></td>
91
						<%
92
						boolean loggedIn = SessionService.isSessionRegistered(request.getSession().getId());
93
						String[] docids = null;
94
						Map fields = null;
95
						if (loggedIn) {
96
							docids = 
97
								SessionService.getRegisteredSession(request.getSession().getId()).getDocumentCart().getDocids();
98
							fields = 
99
								SessionService.getRegisteredSession(request.getSession().getId()).getDocumentCart().getFields();
100
							%>
101
							<td>
102
								<a href="<%=SERVLET_URL%>?action=logout&qformat=first">Logout</a>
103
							</td>
104
							<td>
105
							<div id="importantThings">
106
								<a href="cart.jsp" target="_top">
107
									Cart 
108
								</a>
109
								(Items: <%=docids.length %>, Fields: <%=fields.size() %>)
110
							</div>
111
							<!-- for the cart status -->
112
							<div style="display:none;">
113
								<form id='cartForm'>
114
									<%
115
									for (int i = 0; i < docids.length; i++) {
116
									%>							
117
										<input name="@packageId" value="<%=docids[i] %>" type="hidden"> 
118
									<%} %>
119
								</form>
120
							</div>
121
							<!-- for use when downloading merged data -->
122
							<div style="display:none;">
123
								<form id='fieldForm'>
124
									<%
125
									if (loggedIn) {
126
										Iterator fieldIter =  fields.keySet().iterator();
127
										while (fieldIter.hasNext()) {
128
											String key = (String) fieldIter.next();
129
											String value = (String) fields.get(key);
130
										%>
131
											<input type="hidden" name="<%=key %>" value="<%=value %>" />
132
										<%	
133
										}
134
									}	
135
									%>
136
								</form>
137
							</div>
138
							</td>
139
						<%	
140
						}
141
						else {
142
						%>
143
							<td>
144
								<a href="login.jsp" target="_top">Login</a>
145
							</td>
146
						<%	
147
						}
148
						%>						
149
			  </tr>
150
			</table>
151
		</td>
152
	</tr>
153
</table>		
154
</body>
155
</html>
(12-12/19)