1102 |
29 May 09 |
nicklas |
1 |
<%-- $Id$ |
1102 |
29 May 09 |
nicklas |
2 |
------------------------------------------------------------------ |
1102 |
29 May 09 |
nicklas |
Copyright (C) 2009 Nicklas Nordborg |
1102 |
29 May 09 |
nicklas |
4 |
|
1102 |
29 May 09 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
1102 |
29 May 09 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
1102 |
29 May 09 |
nicklas |
7 |
|
1102 |
29 May 09 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
1102 |
29 May 09 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
1102 |
29 May 09 |
nicklas |
10 |
as published by the Free Software Foundation; either version 2 |
1102 |
29 May 09 |
nicklas |
11 |
of the License, or (at your option) any later version. |
1102 |
29 May 09 |
nicklas |
12 |
|
1102 |
29 May 09 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
1102 |
29 May 09 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1102 |
29 May 09 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1102 |
29 May 09 |
nicklas |
16 |
GNU General Public License for more details. |
1102 |
29 May 09 |
nicklas |
17 |
|
1102 |
29 May 09 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
1102 |
29 May 09 |
nicklas |
19 |
along with this program; if not, write to the Free Software |
1102 |
29 May 09 |
nicklas |
20 |
Foundation, Inc., 59 Temple Place - Suite 330, |
1102 |
29 May 09 |
nicklas |
21 |
Boston, MA 02111-1307, USA. |
1102 |
29 May 09 |
nicklas |
22 |
------------------------------------------------------------------ |
1102 |
29 May 09 |
nicklas |
23 |
|
1102 |
29 May 09 |
nicklas |
24 |
@author Jari, Nicklas |
1102 |
29 May 09 |
nicklas |
25 |
--%> |
1102 |
29 May 09 |
nicklas |
26 |
<%@ page |
1102 |
29 May 09 |
nicklas |
27 |
pageEncoding="UTF-8" |
1102 |
29 May 09 |
nicklas |
28 |
session="false" |
1102 |
29 May 09 |
nicklas |
29 |
import="net.sf.basedb.core.Application" |
1102 |
29 May 09 |
nicklas |
30 |
import="net.sf.basedb.core.BioAssaySet" |
1102 |
29 May 09 |
nicklas |
31 |
import="net.sf.basedb.core.Experiment" |
1102 |
29 May 09 |
nicklas |
32 |
import="net.sf.basedb.core.Directory" |
1102 |
29 May 09 |
nicklas |
33 |
import="net.sf.basedb.core.User" |
1102 |
29 May 09 |
nicklas |
34 |
import="net.sf.basedb.core.DbControl" |
1102 |
29 May 09 |
nicklas |
35 |
import="net.sf.basedb.core.SessionControl" |
1102 |
29 May 09 |
nicklas |
36 |
import="net.sf.basedb.core.Path" |
1102 |
29 May 09 |
nicklas |
37 |
import="net.sf.basedb.core.Presets" |
1102 |
29 May 09 |
nicklas |
38 |
import="net.sf.basedb.core.Presets.Preset" |
1102 |
29 May 09 |
nicklas |
39 |
import="net.sf.basedb.clients.web.Base" |
1102 |
29 May 09 |
nicklas |
40 |
import="net.sf.basedb.clients.web.util.HTML" |
1102 |
29 May 09 |
nicklas |
41 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
1102 |
29 May 09 |
nicklas |
42 |
import="net.sf.basedb.util.Values" |
1102 |
29 May 09 |
nicklas |
43 |
%> |
1102 |
29 May 09 |
nicklas |
44 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
1102 |
29 May 09 |
nicklas |
45 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
1102 |
29 May 09 |
nicklas |
46 |
|
1102 |
29 May 09 |
nicklas |
47 |
<% |
1102 |
29 May 09 |
nicklas |
48 |
final SessionControl sc = Base.getExistingSessionControl(request, true); |
1102 |
29 May 09 |
nicklas |
49 |
final String ID = sc.getId(); |
1102 |
29 May 09 |
nicklas |
50 |
final float scale = Base.getScale(sc); |
1102 |
29 May 09 |
nicklas |
51 |
DbControl dc = null; |
1102 |
29 May 09 |
nicklas |
52 |
try |
1102 |
29 May 09 |
nicklas |
53 |
{ |
1102 |
29 May 09 |
nicklas |
54 |
dc = sc.newDbControl(); |
1102 |
29 May 09 |
nicklas |
55 |
final User user = User.getById(dc, sc.getLoggedInUserId()); |
1108 |
04 Jun 09 |
nicklas |
56 |
String presetsXml = sc.getUserDefaultSetting("net.sf.basedb.genepattern.options"); |
1102 |
29 May 09 |
nicklas |
57 |
Presets presets = new Presets(); |
1102 |
29 May 09 |
nicklas |
58 |
if (presetsXml != null) presets.loadFrom(presetsXml); |
1102 |
29 May 09 |
nicklas |
59 |
%> |
1102 |
29 May 09 |
nicklas |
60 |
<base:page type="popup" title="<%="GenePattern options for "+HTML.encodeTags(user.getName())%>"> |
1102 |
29 May 09 |
nicklas |
61 |
<base:head scripts="tabcontrol.js" styles="tabcontrol.css"> |
1102 |
29 May 09 |
nicklas |
62 |
<script language="JavaScript"> |
1102 |
29 May 09 |
nicklas |
63 |
function saveSettings() |
1102 |
29 May 09 |
nicklas |
64 |
{ |
1102 |
29 May 09 |
nicklas |
65 |
document.forms['options'].submit(); |
1102 |
29 May 09 |
nicklas |
66 |
} |
1102 |
29 May 09 |
nicklas |
67 |
function addServer() |
1102 |
29 May 09 |
nicklas |
68 |
{ |
1106 |
02 Jun 09 |
nicklas |
69 |
Main.openPopup('edit_server.jsp?ID=<%=ID%>&gpServer=', 'EditGPServer', 600, 400); |
1102 |
29 May 09 |
nicklas |
70 |
} |
1102 |
29 May 09 |
nicklas |
71 |
function editServer() |
1102 |
29 May 09 |
nicklas |
72 |
{ |
1102 |
29 May 09 |
nicklas |
73 |
var frm = document.forms['options']; |
1102 |
29 May 09 |
nicklas |
74 |
if (frm.servers.selectedIndex < 0) |
1102 |
29 May 09 |
nicklas |
75 |
{ |
1102 |
29 May 09 |
nicklas |
76 |
alert('No server has been selected'); |
1102 |
29 May 09 |
nicklas |
77 |
return; |
1102 |
29 May 09 |
nicklas |
78 |
} |
1102 |
29 May 09 |
nicklas |
79 |
var gpServer = frm.servers[frm.servers.selectedIndex].text; |
1106 |
02 Jun 09 |
nicklas |
80 |
Main.openPopup('edit_server.jsp?ID=<%=ID%>&gpServer=' + encodeURIComponent(gpServer), 'EditGPServer', 600, 400); |
1102 |
29 May 09 |
nicklas |
81 |
} |
1102 |
29 May 09 |
nicklas |
82 |
function removeServer() |
1102 |
29 May 09 |
nicklas |
83 |
{ |
1102 |
29 May 09 |
nicklas |
84 |
var frm = document.forms['options']; |
1102 |
29 May 09 |
nicklas |
85 |
if (frm.servers.selectedIndex < 0) |
1102 |
29 May 09 |
nicklas |
86 |
{ |
1102 |
29 May 09 |
nicklas |
87 |
alert('No server has been selected'); |
1102 |
29 May 09 |
nicklas |
88 |
return; |
1102 |
29 May 09 |
nicklas |
89 |
} |
1102 |
29 May 09 |
nicklas |
90 |
var gpServer = frm.servers[frm.servers.selectedIndex].text; |
1102 |
29 May 09 |
nicklas |
91 |
Main.openPopup('submit.jsp?ID=<%=ID%>&cmd=RemoveServer&gpServer=' + encodeURIComponent(gpServer), 'RemoveGPServer', 300, 200); |
1102 |
29 May 09 |
nicklas |
92 |
} |
1102 |
29 May 09 |
nicklas |
93 |
</script> |
1102 |
29 May 09 |
nicklas |
94 |
</base:head> |
1102 |
29 May 09 |
nicklas |
95 |
<base:body> |
1102 |
29 May 09 |
nicklas |
96 |
<form action="submit.jsp?ID=<%=ID%>" method="post" name="options" onsubmit="return false;"> |
1102 |
29 May 09 |
nicklas |
97 |
<input type=hidden name="cmd" value="SaveOptions"> |
1102 |
29 May 09 |
nicklas |
98 |
|
1102 |
29 May 09 |
nicklas |
99 |
<h3 class="docked">GenePattern options for <%=HTML.encodeTags(user.getName())%></h3> |
1102 |
29 May 09 |
nicklas |
100 |
<t:tabcontrol id="options" |
1102 |
29 May 09 |
nicklas |
101 |
contentstyle="<%="height: "+(int)(scale*280)+"px;"%>" |
1102 |
29 May 09 |
nicklas |
102 |
position="bottom"> |
1102 |
29 May 09 |
nicklas |
103 |
|
1102 |
29 May 09 |
nicklas |
104 |
<t:tab id="option" title="GenePattern servers"> |
1102 |
29 May 09 |
nicklas |
105 |
<table class="form" cellspacing=0> |
1102 |
29 May 09 |
nicklas |
106 |
<tr> |
1102 |
29 May 09 |
nicklas |
107 |
<td class="prompt">GenePattern servers</td> |
1102 |
29 May 09 |
nicklas |
108 |
<tr> |
1102 |
29 May 09 |
nicklas |
109 |
<td> |
1102 |
29 May 09 |
nicklas |
110 |
<select name="servers" multiple="multiple" size="10" style="width: 25em;"> |
1102 |
29 May 09 |
nicklas |
111 |
<% |
1106 |
02 Jun 09 |
nicklas |
112 |
String selected = "selected"; |
1102 |
29 May 09 |
nicklas |
113 |
for (Presets.Preset server : presets) |
1102 |
29 May 09 |
nicklas |
114 |
{ |
1102 |
29 May 09 |
nicklas |
115 |
%> |
1106 |
02 Jun 09 |
nicklas |
116 |
<option <%=selected%>><%=HTML.encodeTags(server.getName())%> |
1102 |
29 May 09 |
nicklas |
117 |
<% |
1106 |
02 Jun 09 |
nicklas |
118 |
selected = ""; |
1102 |
29 May 09 |
nicklas |
119 |
} |
1102 |
29 May 09 |
nicklas |
120 |
%> |
1102 |
29 May 09 |
nicklas |
121 |
</select> |
1102 |
29 May 09 |
nicklas |
122 |
</td> |
1102 |
29 May 09 |
nicklas |
123 |
<td> |
1102 |
29 May 09 |
nicklas |
124 |
<table width="100"> |
1102 |
29 May 09 |
nicklas |
125 |
<tr><td><base:button title="Edit… " image="configure.png" onclick="editServer()" /></td></tr> |
1102 |
29 May 09 |
nicklas |
126 |
<tr><td><base:button title="Add… " onclick="addServer()" /></td></tr> |
1102 |
29 May 09 |
nicklas |
127 |
<tr><td><base:button title="Remove…" onclick="removeServer()" /></td></tr> |
1102 |
29 May 09 |
nicklas |
128 |
</table> |
1102 |
29 May 09 |
nicklas |
129 |
</td> |
1102 |
29 May 09 |
nicklas |
130 |
</tr> |
1102 |
29 May 09 |
nicklas |
131 |
</table> |
1102 |
29 May 09 |
nicklas |
132 |
|
1102 |
29 May 09 |
nicklas |
133 |
</t:tab> |
1102 |
29 May 09 |
nicklas |
134 |
</t:tabcontrol> |
1102 |
29 May 09 |
nicklas |
135 |
<p> |
1102 |
29 May 09 |
nicklas |
136 |
<table align="center"> |
1102 |
29 May 09 |
nicklas |
137 |
<tr> |
1102 |
29 May 09 |
nicklas |
138 |
<td><base:button onclick="window.close();" title="Close" /></td> |
1102 |
29 May 09 |
nicklas |
139 |
</tr> |
1102 |
29 May 09 |
nicklas |
140 |
</table> |
1102 |
29 May 09 |
nicklas |
141 |
</base:body> |
1102 |
29 May 09 |
nicklas |
142 |
</base:page> |
1102 |
29 May 09 |
nicklas |
143 |
<% |
1102 |
29 May 09 |
nicklas |
144 |
} |
1102 |
29 May 09 |
nicklas |
145 |
finally |
1102 |
29 May 09 |
nicklas |
146 |
{ |
1102 |
29 May 09 |
nicklas |
147 |
if (dc != null) dc.close(); |
1102 |
29 May 09 |
nicklas |
148 |
} |
1102 |
29 May 09 |
nicklas |
149 |
%> |