1744 |
09 Jan 06 |
nicklas |
1 |
<%-- $Id$ |
1744 |
09 Jan 06 |
nicklas |
2 |
------------------------------------------------------------------ |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Johan Enell |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen |
1744 |
09 Jan 06 |
nicklas |
6 |
|
2304 |
22 May 06 |
jari |
7 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
8 |
Available at http://base.thep.lu.se/ |
1744 |
09 Jan 06 |
nicklas |
9 |
|
1744 |
09 Jan 06 |
nicklas |
10 |
BASE is free software; you can redistribute it and/or |
1744 |
09 Jan 06 |
nicklas |
11 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
12 |
as published by the Free Software Foundation; either version 3 |
1744 |
09 Jan 06 |
nicklas |
13 |
of the License, or (at your option) any later version. |
1744 |
09 Jan 06 |
nicklas |
14 |
|
1744 |
09 Jan 06 |
nicklas |
15 |
BASE is distributed in the hope that it will be useful, |
1744 |
09 Jan 06 |
nicklas |
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1744 |
09 Jan 06 |
nicklas |
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1744 |
09 Jan 06 |
nicklas |
18 |
GNU General Public License for more details. |
1744 |
09 Jan 06 |
nicklas |
19 |
|
1744 |
09 Jan 06 |
nicklas |
20 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
21 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
1744 |
09 Jan 06 |
nicklas |
22 |
------------------------------------------------------------------ |
1744 |
09 Jan 06 |
nicklas |
23 |
|
1744 |
09 Jan 06 |
nicklas |
24 |
@author Nicklas |
1744 |
09 Jan 06 |
nicklas |
25 |
@version 2.0 |
1744 |
09 Jan 06 |
nicklas |
26 |
--%> |
5426 |
24 Sep 10 |
nicklas |
27 |
<%@ page pageEncoding="UTF-8" session="false" |
1744 |
09 Jan 06 |
nicklas |
28 |
import="net.sf.basedb.core.SessionControl" |
1744 |
09 Jan 06 |
nicklas |
29 |
import="net.sf.basedb.core.Item" |
1744 |
09 Jan 06 |
nicklas |
30 |
import="net.sf.basedb.core.Permission" |
1744 |
09 Jan 06 |
nicklas |
31 |
import="net.sf.basedb.core.ItemContext" |
1744 |
09 Jan 06 |
nicklas |
32 |
import="net.sf.basedb.clients.web.Base" |
1744 |
09 Jan 06 |
nicklas |
33 |
import="net.sf.basedb.clients.web.util.HTML" |
1744 |
09 Jan 06 |
nicklas |
34 |
import="net.sf.basedb.util.Enumeration" |
1744 |
09 Jan 06 |
nicklas |
35 |
import="net.sf.basedb.clients.web.util.HTML" |
1744 |
09 Jan 06 |
nicklas |
36 |
%> |
1744 |
09 Jan 06 |
nicklas |
37 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
1749 |
10 Jan 06 |
nicklas |
38 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
1744 |
09 Jan 06 |
nicklas |
39 |
<% |
1744 |
09 Jan 06 |
nicklas |
40 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
1744 |
09 Jan 06 |
nicklas |
41 |
final String ID = sc.getId(); |
1744 |
09 Jan 06 |
nicklas |
42 |
final Item itemType = Item.valueOf(request.getParameter("item_type")); |
1933 |
07 Feb 06 |
nicklas |
43 |
final String subContext = request.getParameter("subcontext"); |
1933 |
07 Feb 06 |
nicklas |
44 |
final ItemContext current = sc.getCurrentContext(itemType, subContext); |
1933 |
07 Feb 06 |
nicklas |
45 |
final Enumeration<Integer, String> contextNames = sc.getContextNames(itemType, subContext); |
1849 |
26 Jan 06 |
nicklas |
46 |
int numListed = 0; |
1744 |
09 Jan 06 |
nicklas |
47 |
%> |
1744 |
09 Jan 06 |
nicklas |
48 |
<base:page type="popup" title="Manage presets"> |
6181 |
22 Oct 12 |
nicklas |
49 |
<base:head scripts="table.js,~manage.js" styles="table.css,toolbar.css" /> |
1749 |
10 Jan 06 |
nicklas |
50 |
<base:body> |
5907 |
13 Dec 11 |
nicklas |
51 |
<h1>Manage presets for <%=itemType%> <%="".equals(subContext) ? "" : "(" + subContext + ")" %> |
5907 |
13 Dec 11 |
nicklas |
52 |
<base:help helpid="contexts.manage" /></h1> |
5907 |
13 Dec 11 |
nicklas |
53 |
|
5907 |
13 Dec 11 |
nicklas |
54 |
<div class="content"> |
2003 |
16 Feb 06 |
nicklas |
55 |
<% |
2003 |
16 Feb 06 |
nicklas |
56 |
if (contextNames.size() == 0) |
2003 |
16 Feb 06 |
nicklas |
57 |
{ |
2003 |
16 Feb 06 |
nicklas |
58 |
%> |
6607 |
19 Nov 14 |
nicklas |
59 |
<table class="fullcc bg-filled-50 bottomborder"><tr><td> |
5907 |
13 Dec 11 |
nicklas |
60 |
<b>You have not saved any presets for |
5907 |
13 Dec 11 |
nicklas |
61 |
<%=itemType%> <%="".equals(subContext) ? "" : "(" + subContext + ")" %> |
5907 |
13 Dec 11 |
nicklas |
62 |
</b> |
5907 |
13 Dec 11 |
nicklas |
63 |
</td></tr></table> |
2003 |
16 Feb 06 |
nicklas |
64 |
<% |
2003 |
16 Feb 06 |
nicklas |
65 |
} |
2003 |
16 Feb 06 |
nicklas |
66 |
else |
2003 |
16 Feb 06 |
nicklas |
67 |
{ |
2003 |
16 Feb 06 |
nicklas |
68 |
%> |
2003 |
16 Feb 06 |
nicklas |
69 |
<tbl:table |
2003 |
16 Feb 06 |
nicklas |
70 |
id="contexts" |
2003 |
16 Feb 06 |
nicklas |
71 |
action="index.jsp" |
5951 |
09 Feb 12 |
nicklas |
72 |
subclass="fulltable" |
7943 |
04 May 21 |
nicklas |
73 |
stickyheaders="<%=null%>" |
1749 |
10 Jan 06 |
nicklas |
74 |
> |
2003 |
16 Feb 06 |
nicklas |
75 |
<tbl:hidden |
2003 |
16 Feb 06 |
nicklas |
76 |
name="item_type" |
2003 |
16 Feb 06 |
nicklas |
77 |
value="<%=itemType.name()%>" |
1749 |
10 Jan 06 |
nicklas |
78 |
/> |
2003 |
16 Feb 06 |
nicklas |
79 |
<tbl:hidden |
2003 |
16 Feb 06 |
nicklas |
80 |
name="subcontext" |
2003 |
16 Feb 06 |
nicklas |
81 |
value="<%=subContext%>" |
2003 |
16 Feb 06 |
nicklas |
82 |
/> |
2003 |
16 Feb 06 |
nicklas |
83 |
<tbl:columndef |
2003 |
16 Feb 06 |
nicklas |
84 |
id="name" |
2003 |
16 Feb 06 |
nicklas |
85 |
title="Name" |
2003 |
16 Feb 06 |
nicklas |
86 |
/> |
2003 |
16 Feb 06 |
nicklas |
87 |
<tbl:columndef |
2003 |
16 Feb 06 |
nicklas |
88 |
id="actions" |
2003 |
16 Feb 06 |
nicklas |
89 |
title=" " |
2003 |
16 Feb 06 |
nicklas |
90 |
/> |
2003 |
16 Feb 06 |
nicklas |
91 |
<tbl:toolbar |
2003 |
16 Feb 06 |
nicklas |
92 |
visible="true" |
6607 |
19 Nov 14 |
nicklas |
93 |
subclass="bottomborder bg-filled-50" |
5951 |
09 Feb 12 |
nicklas |
94 |
style="height: 1.75em;" |
2003 |
16 Feb 06 |
nicklas |
95 |
> |
2003 |
16 Feb 06 |
nicklas |
96 |
<tbl:button |
6181 |
22 Oct 12 |
nicklas |
97 |
id="btnDeleteSelected" |
5946 |
03 Feb 12 |
nicklas |
98 |
image="delete.png" |
2003 |
16 Feb 06 |
nicklas |
99 |
title="Delete…" |
2003 |
16 Feb 06 |
nicklas |
100 |
tooltip="Delete the selected items" |
2003 |
16 Feb 06 |
nicklas |
101 |
/> |
2003 |
16 Feb 06 |
nicklas |
102 |
</tbl:toolbar> |
5951 |
09 Feb 12 |
nicklas |
103 |
<tbl:data style="top: 1.75em;"> |
5949 |
08 Feb 12 |
nicklas |
104 |
<tbl:headers> |
5949 |
08 Feb 12 |
nicklas |
105 |
<tbl:headerrow> |
5949 |
08 Feb 12 |
nicklas |
106 |
<tbl:header |
5949 |
08 Feb 12 |
nicklas |
107 |
clazz="index" |
5949 |
08 Feb 12 |
nicklas |
108 |
/> |
5949 |
08 Feb 12 |
nicklas |
109 |
<tbl:header |
5949 |
08 Feb 12 |
nicklas |
110 |
clazz="check" |
5949 |
08 Feb 12 |
nicklas |
111 |
visible="true" |
5949 |
08 Feb 12 |
nicklas |
112 |
><base:icon |
6834 |
08 Apr 15 |
nicklas |
113 |
subclass="link table-check" |
5949 |
08 Feb 12 |
nicklas |
114 |
image="check_uncheck.png" |
6834 |
08 Apr 15 |
nicklas |
115 |
tooltip="Toggle all (use CTRL, ALT or SHIFT to check/uncheck)" |
6181 |
22 Oct 12 |
nicklas |
116 |
data-form="contexts" |
6181 |
22 Oct 12 |
nicklas |
117 |
style="align: left;" |
5949 |
08 Feb 12 |
nicklas |
118 |
/> |
5949 |
08 Feb 12 |
nicklas |
119 |
</tbl:header> |
5949 |
08 Feb 12 |
nicklas |
120 |
<tbl:columnheaders /> |
5949 |
08 Feb 12 |
nicklas |
121 |
</tbl:headerrow> |
5949 |
08 Feb 12 |
nicklas |
122 |
</tbl:headers> |
2003 |
16 Feb 06 |
nicklas |
123 |
<tbl:rows> |
2003 |
16 Feb 06 |
nicklas |
124 |
<% |
2003 |
16 Feb 06 |
nicklas |
125 |
for (int i = 0; i < contextNames.size(); ++i) |
2003 |
16 Feb 06 |
nicklas |
126 |
{ |
2003 |
16 Feb 06 |
nicklas |
127 |
String name = contextNames.getValue(i); |
2003 |
16 Feb 06 |
nicklas |
128 |
int id = contextNames.getKey(i); |
2003 |
16 Feb 06 |
nicklas |
129 |
if (!ItemContext.DEFAULT_NAME.equals(name)) |
2003 |
16 Feb 06 |
nicklas |
130 |
{ |
2003 |
16 Feb 06 |
nicklas |
131 |
numListed++; |
2003 |
16 Feb 06 |
nicklas |
132 |
%> |
2003 |
16 Feb 06 |
nicklas |
133 |
<tbl:row> |
5949 |
08 Feb 12 |
nicklas |
134 |
<tbl:header clazz="index"><%=numListed%></tbl:header> |
2003 |
16 Feb 06 |
nicklas |
135 |
<tbl:header |
2003 |
16 Feb 06 |
nicklas |
136 |
clazz="check" |
2003 |
16 Feb 06 |
nicklas |
137 |
><input |
2003 |
16 Feb 06 |
nicklas |
138 |
type="checkbox" |
2003 |
16 Feb 06 |
nicklas |
139 |
name="<%=id%>" |
2003 |
16 Feb 06 |
nicklas |
140 |
value="<%=id%>" |
2003 |
16 Feb 06 |
nicklas |
141 |
title="<%=HTML.encodeTags(name)%>" |
2003 |
16 Feb 06 |
nicklas |
142 |
></tbl:header> |
2003 |
16 Feb 06 |
nicklas |
143 |
<tbl:cell column="name"><%=HTML.encodeTags(name)%></tbl:cell> |
2003 |
16 Feb 06 |
nicklas |
144 |
<tbl:cell column="actions"> |
6181 |
22 Oct 12 |
nicklas |
145 |
<span class="link auto-init" data-auto-init="load-context" data-context-id="<%=id%>" |
6181 |
22 Oct 12 |
nicklas |
146 |
title="Load this preset">Load</span> |
2003 |
16 Feb 06 |
nicklas |
147 |
</tbl:cell> |
2003 |
16 Feb 06 |
nicklas |
148 |
</tbl:row> |
2003 |
16 Feb 06 |
nicklas |
149 |
<% |
2003 |
16 Feb 06 |
nicklas |
150 |
} |
2003 |
16 Feb 06 |
nicklas |
151 |
} |
5949 |
08 Feb 12 |
nicklas |
152 |
if (numListed == 0) |
5949 |
08 Feb 12 |
nicklas |
153 |
{ |
5949 |
08 Feb 12 |
nicklas |
154 |
%> |
6604 |
18 Nov 14 |
nicklas |
155 |
<tbl:panel subclass="bg-filled-50"> |
5949 |
08 Feb 12 |
nicklas |
156 |
<div class="messagecontainer note">No presets were found</div> |
5949 |
08 Feb 12 |
nicklas |
157 |
</tbl:panel> |
5949 |
08 Feb 12 |
nicklas |
158 |
<% |
5949 |
08 Feb 12 |
nicklas |
159 |
} |
2003 |
16 Feb 06 |
nicklas |
160 |
%> |
2003 |
16 Feb 06 |
nicklas |
161 |
</tbl:rows> |
2003 |
16 Feb 06 |
nicklas |
162 |
</tbl:data> |
2003 |
16 Feb 06 |
nicklas |
163 |
</tbl:table> |
2003 |
16 Feb 06 |
nicklas |
164 |
<br> |
1849 |
26 Jan 06 |
nicklas |
165 |
<% |
2003 |
16 Feb 06 |
nicklas |
166 |
} |
2003 |
16 Feb 06 |
nicklas |
167 |
%> |
5907 |
13 Dec 11 |
nicklas |
168 |
</div> |
5907 |
13 Dec 11 |
nicklas |
169 |
<base:buttongroup subclass="dialogbuttons"> |
6181 |
22 Oct 12 |
nicklas |
170 |
<base:button id="close" title="Close" /> |
5907 |
13 Dec 11 |
nicklas |
171 |
</base:buttongroup> |
1744 |
09 Jan 06 |
nicklas |
172 |
|
1744 |
09 Jan 06 |
nicklas |
173 |
</base:body> |
1744 |
09 Jan 06 |
nicklas |
174 |
</base:page> |