1
|
<%@ page language="java"%>
|
2
|
<%
|
3
|
/**
|
4
|
* '$RCSfile$'
|
5
|
* Authors: Matt Jones
|
6
|
* Copyright: 2008 Regents of the University of California and the
|
7
|
* National Center for Ecological Analysis and Synthesis
|
8
|
* For Details: http://www.nceas.ucsb.edu/
|
9
|
*
|
10
|
* '$Author: leinfelder $'
|
11
|
* '$Date: 2011-10-27 08:58:47 -0700 (Thu, 27 Oct 2011) $'
|
12
|
* '$Revision: 6547 $'
|
13
|
*
|
14
|
* This is an HTML document for loading an xml document into Oracle
|
15
|
*
|
16
|
* This program is free software; you can redistribute it and/or modify
|
17
|
* it under the terms of the GNU General Public License as published by
|
18
|
* the Free Software Foundation; either version 2 of the License, or
|
19
|
* (at your option) any later version.
|
20
|
*
|
21
|
* This program is distributed in the hope that it will be useful,
|
22
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24
|
* GNU General Public License for more details.
|
25
|
*
|
26
|
* You should have received a copy of the GNU General Public License
|
27
|
* along with this program; if not, write to the Free Software
|
28
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
29
|
*/
|
30
|
%>
|
31
|
|
32
|
<%@ include file="../../common/common-settings.jsp"%>
|
33
|
<%@ include file="../../common/configure-check.jsp"%>
|
34
|
<%@page import="edu.ucsb.nceas.metacat.service.SessionService"%>
|
35
|
<%
|
36
|
|
37
|
// what was the given DataONE identity?
|
38
|
String d1Identity = request.getParameter("d1Identity");
|
39
|
String token = request.getParameter("token");
|
40
|
|
41
|
// look up the username from the given session
|
42
|
String sessionId = request.getParameter("sessionId");
|
43
|
if (sessionId == null) {
|
44
|
if (request.getSession() != null) {
|
45
|
sessionId = request.getSession().getId();
|
46
|
}
|
47
|
}
|
48
|
if (sessionId == null || !SessionService.getInstance().isSessionRegistered(sessionId)) {
|
49
|
// redirect to the login page
|
50
|
response.sendRedirect(STYLE_SKINS_URL + "/dev/login.html");
|
51
|
return;
|
52
|
}
|
53
|
String userName = SessionService.getInstance().getRegisteredSession(sessionId).getUserName();
|
54
|
%>
|
55
|
|
56
|
<html>
|
57
|
<head>
|
58
|
<title>Map legacy account to DataONE</title>
|
59
|
|
60
|
<link rel="stylesheet" type="text/css" href="<%=STYLE_COMMON_URL%>/jquery/jqueryui/css/smoothness/jquery-ui-1.8.6.custom.css">
|
61
|
<link rel="stylesheet" type="text/css" href="dataone.css" />
|
62
|
<script language="javascript" type="text/javascript" src="<%=STYLE_COMMON_URL%>/jquery/jquery.js"></script>
|
63
|
<script language="javascript" type="text/javascript" src="<%=STYLE_COMMON_URL%>/jquery/jqueryui/js/jquery-ui-1.8.6.custom.min.js"></script>
|
64
|
<script type="text/javascript">
|
65
|
var portalURL = "https://cn-dev.dataone.org/portal/identity";
|
66
|
|
67
|
function lookupToken() {
|
68
|
var data = $('#tokenFrame').contents();
|
69
|
$('#mapForm [name="token"]').val(data);
|
70
|
alert('Loaded token: ' + data);
|
71
|
|
72
|
|
73
|
}
|
74
|
function lookupSubject() {
|
75
|
var subjectFrame = $('#subjectFrame');
|
76
|
var data = $('#subjectFrame').val();
|
77
|
$('#mapForm [name="primarySubject"]').val(data);
|
78
|
alert('Loaded subject: ' + data);
|
79
|
}
|
80
|
function initTabs() {
|
81
|
$(function() {
|
82
|
$("#tabs").tabs();
|
83
|
$("#tabs").tabs("add", "#mapping", "Legacy account mapping");
|
84
|
});
|
85
|
}
|
86
|
function init() {
|
87
|
initTabs();
|
88
|
//lookupToken();
|
89
|
//lookupSubject();
|
90
|
}
|
91
|
</script>
|
92
|
|
93
|
</head>
|
94
|
<body onload="init()">
|
95
|
<!-- dataone logo header -->
|
96
|
<div class="logoheader">
|
97
|
<h1></h1>
|
98
|
</div>
|
99
|
|
100
|
<div id="tabs">
|
101
|
<!-- place holder for tabs -->
|
102
|
<ul></ul>
|
103
|
|
104
|
<div id="mapping">
|
105
|
<p>Use this form to connect your old KNB account to your new DataONE identity.
|
106
|
You will need to be logged into both systems at the same time in order for the mapping to take place.
|
107
|
</p>
|
108
|
|
109
|
Your current KNB account:
|
110
|
<div>
|
111
|
<%=userName %>
|
112
|
</div>
|
113
|
<br/>
|
114
|
|
115
|
Will be mapped to this DataONE account*:
|
116
|
<iframe id="subjectFrame" frameborder="0" marginwidth="0" height="30" width="100%" src="https://cn-dev.dataone.org/portal/identity?action=getSubject">
|
117
|
</iframe>
|
118
|
|
119
|
<hr/>
|
120
|
|
121
|
1. Use this temporary DataONE token*:
|
122
|
<iframe id="tokenFrame" frameborder="0" marginwidth="0" height="30" width="100%" src="https://cn-dev.dataone.org/portal/identity?action=getToken">
|
123
|
</iframe>
|
124
|
<br/>
|
125
|
|
126
|
|
127
|
|
128
|
<form action="performMapping.jsp" target="right" method="POST" id="mapForm">
|
129
|
2. Enter your DataONE token:
|
130
|
<br/>
|
131
|
<input type="text" name="token" size="50">
|
132
|
<input type="hidden" name="secondarySubject" value="<%=userName %>">
|
133
|
<input type="hidden" name="action" value="mapIdentity">
|
134
|
<input type="submit" value="Map Identity">
|
135
|
</form>
|
136
|
|
137
|
<hr/>
|
138
|
|
139
|
<p>
|
140
|
*If you do not see your DataONE account or DataONE token here, then you must first authenticate using CILogon.
|
141
|
</p>
|
142
|
<p>
|
143
|
<a href="https://cn-dev.dataone.org/portal/startRequest?target=<%=STYLE_SKINS_URL%>/dataone/index.jsp">Begin Login</a>
|
144
|
</p>
|
145
|
</div>
|
146
|
|
147
|
</div>
|
148
|
</body>
|
149
|
</html>
|