1794 |
19 Jan 06 |
nicklas |
1 |
<%-- $Id$ |
1794 |
19 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 Nicklas Nordborg |
1794 |
19 Jan 06 |
nicklas |
5 |
|
2304 |
22 May 06 |
jari |
6 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
7 |
Available at http://base.thep.lu.se/ |
1794 |
19 Jan 06 |
nicklas |
8 |
|
1794 |
19 Jan 06 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
1794 |
19 Jan 06 |
nicklas |
10 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
11 |
as published by the Free Software Foundation; either version 3 |
1794 |
19 Jan 06 |
nicklas |
12 |
of the License, or (at your option) any later version. |
1794 |
19 Jan 06 |
nicklas |
13 |
|
1794 |
19 Jan 06 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
1794 |
19 Jan 06 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1794 |
19 Jan 06 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1794 |
19 Jan 06 |
nicklas |
17 |
GNU General Public License for more details. |
1794 |
19 Jan 06 |
nicklas |
18 |
|
1794 |
19 Jan 06 |
nicklas |
19 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
1794 |
19 Jan 06 |
nicklas |
21 |
------------------------------------------------------------------ |
1794 |
19 Jan 06 |
nicklas |
22 |
|
1794 |
19 Jan 06 |
nicklas |
23 |
|
1794 |
19 Jan 06 |
nicklas |
24 |
@author Nicklas |
1794 |
19 Jan 06 |
nicklas |
25 |
@version 2.0 |
1794 |
19 Jan 06 |
nicklas |
26 |
--%> |
5426 |
24 Sep 10 |
nicklas |
27 |
<%@ page pageEncoding="UTF-8" session="false" |
1794 |
19 Jan 06 |
nicklas |
28 |
import="net.sf.basedb.core.SessionControl" |
1794 |
19 Jan 06 |
nicklas |
29 |
import="net.sf.basedb.core.DbControl" |
1794 |
19 Jan 06 |
nicklas |
30 |
import="net.sf.basedb.core.Item" |
5570 |
16 Feb 11 |
nicklas |
31 |
import="net.sf.basedb.core.Config" |
1794 |
19 Jan 06 |
nicklas |
32 |
import="net.sf.basedb.core.SystemItems" |
1794 |
19 Jan 06 |
nicklas |
33 |
import="net.sf.basedb.core.ItemContext" |
1794 |
19 Jan 06 |
nicklas |
34 |
import="net.sf.basedb.core.Permission" |
1794 |
19 Jan 06 |
nicklas |
35 |
import="net.sf.basedb.core.Directory" |
1794 |
19 Jan 06 |
nicklas |
36 |
import="net.sf.basedb.core.File" |
5361 |
14 Jun 10 |
nicklas |
37 |
import="net.sf.basedb.core.FileServer" |
5630 |
13 May 11 |
nicklas |
38 |
import="net.sf.basedb.core.ItemSubtype" |
5326 |
29 Apr 10 |
nicklas |
39 |
import="net.sf.basedb.core.Location" |
1794 |
19 Jan 06 |
nicklas |
40 |
import="net.sf.basedb.core.ItemQuery" |
5643 |
26 May 11 |
nicklas |
41 |
import="net.sf.basedb.core.Include" |
1794 |
19 Jan 06 |
nicklas |
42 |
import="net.sf.basedb.core.ItemResultList" |
1794 |
19 Jan 06 |
nicklas |
43 |
import="net.sf.basedb.core.PermissionDeniedException" |
1794 |
19 Jan 06 |
nicklas |
44 |
import="net.sf.basedb.core.BaseException" |
1794 |
19 Jan 06 |
nicklas |
45 |
import="net.sf.basedb.core.query.Orders" |
1794 |
19 Jan 06 |
nicklas |
46 |
import="net.sf.basedb.core.query.Hql" |
1794 |
19 Jan 06 |
nicklas |
47 |
import="net.sf.basedb.clients.web.Base" |
1794 |
19 Jan 06 |
nicklas |
48 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
49 |
import="net.sf.basedb.util.Values" |
5501 |
18 Nov 10 |
nicklas |
50 |
import="net.sf.basedb.core.plugin.GuiContext" |
5501 |
18 Nov 10 |
nicklas |
51 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5501 |
18 Nov 10 |
nicklas |
52 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5501 |
18 Nov 10 |
nicklas |
53 |
import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
7604 |
25 Feb 19 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.tabcontrol.TabAction" |
5501 |
18 Nov 10 |
nicklas |
55 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
1794 |
19 Jan 06 |
nicklas |
56 |
import="java.util.List" |
1794 |
19 Jan 06 |
nicklas |
57 |
import="java.util.Set" |
1794 |
19 Jan 06 |
nicklas |
58 |
import="java.util.HashSet" |
4520 |
15 Sep 08 |
nicklas |
59 |
import="java.nio.charset.Charset" |
1794 |
19 Jan 06 |
nicklas |
60 |
%> |
1794 |
19 Jan 06 |
nicklas |
61 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
1794 |
19 Jan 06 |
nicklas |
62 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
6137 |
19 Sep 12 |
nicklas |
63 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
1794 |
19 Jan 06 |
nicklas |
64 |
<% |
1794 |
19 Jan 06 |
nicklas |
65 |
final Item itemType = Item.FILE; |
1794 |
19 Jan 06 |
nicklas |
66 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
1794 |
19 Jan 06 |
nicklas |
67 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
1794 |
19 Jan 06 |
nicklas |
68 |
final int itemId = cc.getId(); |
1794 |
19 Jan 06 |
nicklas |
69 |
final String ID = sc.getId(); |
1794 |
19 Jan 06 |
nicklas |
70 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
71 |
final DbControl dc = sc.newDbControl(":Edit "+itemType); |
1794 |
19 Jan 06 |
nicklas |
72 |
try |
1794 |
19 Jan 06 |
nicklas |
73 |
{ |
1794 |
19 Jan 06 |
nicklas |
74 |
String title = null; |
1794 |
19 Jan 06 |
nicklas |
75 |
File file = null; |
1794 |
19 Jan 06 |
nicklas |
76 |
Directory directory = null; |
5643 |
26 May 11 |
nicklas |
77 |
boolean readCurrentSubtype = true; |
5643 |
26 May 11 |
nicklas |
78 |
int currentSubtypeId = 0; |
5361 |
14 Jun 10 |
nicklas |
79 |
boolean readCurrentFileServer = true; |
5361 |
14 Jun 10 |
nicklas |
80 |
FileServer currentFileServer = null; |
7605 |
26 Feb 19 |
nicklas |
81 |
List<FileServer> recentFileServers = cc.getRecent(dc, Item.FILESERVER); |
5909 |
14 Dec 11 |
nicklas |
82 |
boolean isURL = true; |
1794 |
19 Jan 06 |
nicklas |
83 |
|
1794 |
19 Jan 06 |
nicklas |
84 |
if (itemId == 0) |
1794 |
19 Jan 06 |
nicklas |
85 |
{ |
5909 |
14 Dec 11 |
nicklas |
86 |
title = "New URL"; |
5643 |
26 May 11 |
nicklas |
87 |
currentSubtypeId = Values.getInt(request.getParameter("subtype_id")); |
5643 |
26 May 11 |
nicklas |
88 |
if (currentSubtypeId == 0) |
2597 |
25 Aug 06 |
nicklas |
89 |
{ |
5643 |
26 May 11 |
nicklas |
90 |
int recentSubtypeId = Values.getInt(cc.getRecent(Item.ITEMSUBTYPE.name(), 0)); |
5643 |
26 May 11 |
nicklas |
91 |
currentSubtypeId = Values.getInt(cc.getPropertyValue("itemSubtype"), recentSubtypeId); |
2597 |
25 Aug 06 |
nicklas |
92 |
} |
5361 |
14 Jun 10 |
nicklas |
93 |
if (cc.getPropertyFilter("fileServer.name") != null) |
5361 |
14 Jun 10 |
nicklas |
94 |
{ |
5361 |
14 Jun 10 |
nicklas |
95 |
currentFileServer = Base.getFirstMatching(dc, FileServer.getQuery(), "name", cc.getPropertyFilter("fileServer.name")); |
5361 |
14 Jun 10 |
nicklas |
96 |
} |
2597 |
25 Aug 06 |
nicklas |
97 |
directory = Directory.getById(dc, Values.getInt(request.getParameter("directory_id"), |
2597 |
25 Aug 06 |
nicklas |
98 |
SystemItems.getId(Directory.ROOT))); |
1794 |
19 Jan 06 |
nicklas |
99 |
cc.removeObject("item"); |
1794 |
19 Jan 06 |
nicklas |
100 |
} |
1794 |
19 Jan 06 |
nicklas |
101 |
else |
1794 |
19 Jan 06 |
nicklas |
102 |
{ |
1794 |
19 Jan 06 |
nicklas |
103 |
file = File.getById(dc, itemId); |
5643 |
26 May 11 |
nicklas |
104 |
file.checkPermission(Permission.WRITE); |
5909 |
14 Dec 11 |
nicklas |
105 |
isURL = file.getLocation() == Location.EXTERNAL; |
1794 |
19 Jan 06 |
nicklas |
106 |
directory = file.getDirectory(); |
1794 |
19 Jan 06 |
nicklas |
107 |
cc.setObject("item", file); |
5909 |
14 Dec 11 |
nicklas |
108 |
title = (isURL ? "Edit URL -- " : "Edit file -- ") + HTML.encodeTags(file.getName()); |
1794 |
19 Jan 06 |
nicklas |
109 |
try |
1794 |
19 Jan 06 |
nicklas |
110 |
{ |
5643 |
26 May 11 |
nicklas |
111 |
ItemSubtype subtype = file.getItemSubtype(); |
5643 |
26 May 11 |
nicklas |
112 |
if (subtype != null) currentSubtypeId = subtype.getId(); |
1794 |
19 Jan 06 |
nicklas |
113 |
} |
1794 |
19 Jan 06 |
nicklas |
114 |
catch (PermissionDeniedException ex) |
1794 |
19 Jan 06 |
nicklas |
115 |
{ |
5643 |
26 May 11 |
nicklas |
116 |
readCurrentSubtype = false; |
1794 |
19 Jan 06 |
nicklas |
117 |
} |
5361 |
14 Jun 10 |
nicklas |
118 |
try |
5361 |
14 Jun 10 |
nicklas |
119 |
{ |
5361 |
14 Jun 10 |
nicklas |
120 |
currentFileServer = file.getFileServer(); |
5361 |
14 Jun 10 |
nicklas |
121 |
} |
5361 |
14 Jun 10 |
nicklas |
122 |
catch (PermissionDeniedException ex) |
5361 |
14 Jun 10 |
nicklas |
123 |
{ |
5361 |
14 Jun 10 |
nicklas |
124 |
readCurrentFileServer = false; |
5361 |
14 Jun 10 |
nicklas |
125 |
} |
1794 |
19 Jan 06 |
nicklas |
126 |
} |
1794 |
19 Jan 06 |
nicklas |
127 |
// Query to retrieve file types |
5643 |
26 May 11 |
nicklas |
128 |
final ItemQuery<ItemSubtype> subtypesQuery = Base.getSubtypesQuery(itemType); |
5643 |
26 May 11 |
nicklas |
129 |
subtypesQuery.include(Include.ALL); |
1794 |
19 Jan 06 |
nicklas |
130 |
|
5501 |
18 Nov 10 |
nicklas |
131 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), file); |
7604 |
25 Feb 19 |
nicklas |
132 |
ExtensionsInvoker<TabAction> invoker = EditUtil.useEditExtensions(jspContext); |
1794 |
19 Jan 06 |
nicklas |
133 |
%> |
6308 |
20 Aug 13 |
nicklas |
134 |
<base:page type="popup" title="<%=title%>" id="edit-page"> |
7857 |
20 Oct 20 |
nicklas |
135 |
<base:head scripts="tabcontrol-2.js,subtypes.js,~files.js" styles="tabcontrol.css"> |
5501 |
18 Nov 10 |
nicklas |
136 |
<ext:scripts context="<%=jspContext%>" /> |
5501 |
18 Nov 10 |
nicklas |
137 |
<ext:stylesheets context="<%=jspContext%>" /> |
1794 |
19 Jan 06 |
nicklas |
138 |
</base:head> |
6308 |
20 Aug 13 |
nicklas |
139 |
<base:body> |
5908 |
13 Dec 11 |
nicklas |
140 |
<h1><%=title%> <base:help tabcontrol="settings" /></h1> |
5908 |
13 Dec 11 |
nicklas |
141 |
|
6162 |
10 Oct 12 |
nicklas |
142 |
<form action="index.jsp?ID=<%=ID%>" method="post" name="file"> |
1794 |
19 Jan 06 |
nicklas |
143 |
<input type="hidden" name="cmd" value="UpdateItem"> |
1794 |
19 Jan 06 |
nicklas |
144 |
<input type="hidden" name="directory_id" value="<%=directory.getId()%>"> |
1794 |
19 Jan 06 |
nicklas |
145 |
|
5908 |
13 Dec 11 |
nicklas |
146 |
<t:tabcontrol id="settings" |
5908 |
13 Dec 11 |
nicklas |
147 |
subclass="content dialogtabcontrol" |
5501 |
18 Nov 10 |
nicklas |
148 |
position="bottom" remember="<%=file != null%>" |
5501 |
18 Nov 10 |
nicklas |
149 |
extensions="<%=invoker%>"> |
6308 |
20 Aug 13 |
nicklas |
150 |
<t:tab id="info" title="<%=isURL ? "URL" : "File" %>" helpid="file.edit"> |
5908 |
13 Dec 11 |
nicklas |
151 |
<table class="fullform input100"> |
1794 |
19 Jan 06 |
nicklas |
152 |
<tr> |
5908 |
13 Dec 11 |
nicklas |
153 |
<th>Path</th> |
5908 |
13 Dec 11 |
nicklas |
154 |
<td colspan="2"><%=HTML.encodeTags(directory.getPath().toString())%></td> |
1794 |
19 Jan 06 |
nicklas |
155 |
</tr> |
5326 |
29 Apr 10 |
nicklas |
156 |
<% |
5909 |
14 Dec 11 |
nicklas |
157 |
if (isURL) |
5326 |
29 Apr 10 |
nicklas |
158 |
{ |
5326 |
29 Apr 10 |
nicklas |
159 |
%> |
5908 |
13 Dec 11 |
nicklas |
160 |
<tr class="double"> |
5908 |
13 Dec 11 |
nicklas |
161 |
<th>URL</th> |
6308 |
20 Aug 13 |
nicklas |
162 |
<td><input class="text required auto-init" |
6308 |
20 Aug 13 |
nicklas |
163 |
data-auto-init="<%=file == null ? "focus-select" : "focus" %>" |
6308 |
20 Aug 13 |
nicklas |
164 |
type="text" name="url" id="url" |
5326 |
29 Apr 10 |
nicklas |
165 |
value="<%=HTML.encodeTags(file == null ? Values.getString(cc.getPropertyValue("url")) : file.getUrl())%>" |
6308 |
20 Aug 13 |
nicklas |
166 |
size="40" maxlength="<%=File.MAX_URL_LENGTH%>"><br> |
5812 |
17 Oct 11 |
nicklas |
167 |
<span title="Issues a HEAD request to the given URL in order to find size, MIME type, etc."> |
5812 |
17 Oct 11 |
nicklas |
168 |
<input type="checkbox" name="loadMetadata" id="loadMetadata" value="1" <%=file == null ? "checked" : "" %> |
5812 |
17 Oct 11 |
nicklas |
169 |
><label for="loadMetadata">Load metadata</label></span> |
5332 |
30 Apr 10 |
nicklas |
170 |
</td> |
5908 |
13 Dec 11 |
nicklas |
171 |
<td></td> |
5326 |
29 Apr 10 |
nicklas |
172 |
</tr> |
5361 |
14 Jun 10 |
nicklas |
173 |
<tr> |
5908 |
13 Dec 11 |
nicklas |
174 |
<th>Server</th> |
5361 |
14 Jun 10 |
nicklas |
175 |
<td> |
5361 |
14 Jun 10 |
nicklas |
176 |
<base:select |
5361 |
14 Jun 10 |
nicklas |
177 |
id="server_id" |
5361 |
14 Jun 10 |
nicklas |
178 |
clazz="selectionlist" |
5361 |
14 Jun 10 |
nicklas |
179 |
required="false" |
5361 |
14 Jun 10 |
nicklas |
180 |
current="<%=currentFileServer%>" |
5361 |
14 Jun 10 |
nicklas |
181 |
denied="<%=!readCurrentFileServer%>" |
5361 |
14 Jun 10 |
nicklas |
182 |
recent="<%=recentFileServers%>" |
5361 |
14 Jun 10 |
nicklas |
183 |
newitem="<%=file == null%>" |
5361 |
14 Jun 10 |
nicklas |
184 |
/> |
5361 |
14 Jun 10 |
nicklas |
185 |
</td> |
5908 |
13 Dec 11 |
nicklas |
186 |
<td></td> |
5361 |
14 Jun 10 |
nicklas |
187 |
</tr> |
5326 |
29 Apr 10 |
nicklas |
188 |
<% |
5326 |
29 Apr 10 |
nicklas |
189 |
} |
5326 |
29 Apr 10 |
nicklas |
190 |
%> |
1794 |
19 Jan 06 |
nicklas |
191 |
<tr> |
5908 |
13 Dec 11 |
nicklas |
192 |
<th>Name</th> |
6308 |
20 Aug 13 |
nicklas |
193 |
<td><input class="text required <%=!isURL ? "auto-init" : ""%> |
6308 |
20 Aug 13 |
nicklas |
194 |
data-auto-init="<%=file == null ? "focus-select" : "focus" %>" |
6308 |
20 Aug 13 |
nicklas |
195 |
type="text" name="name" |
5326 |
29 Apr 10 |
nicklas |
196 |
value="<%=HTML.encodeTags(file == null ? Values.getString(cc.getPropertyValue("name")) : file.getName())%>" |
1794 |
19 Jan 06 |
nicklas |
197 |
size="40" maxlength="<%=File.MAX_NAME_LENGTH%>"></td> |
5908 |
13 Dec 11 |
nicklas |
198 |
<td></td> |
1794 |
19 Jan 06 |
nicklas |
199 |
</tr> |
3463 |
07 Jun 07 |
nicklas |
200 |
<tr> |
5908 |
13 Dec 11 |
nicklas |
201 |
<th><label for="writeProtected">Write protected</label></th> |
5812 |
17 Oct 11 |
nicklas |
202 |
<td><input type="checkbox" name="write_protected" id="writeProtected" value="1" |
3463 |
07 Jun 07 |
nicklas |
203 |
<%=(file != null && file.isWriteProtected()) || |
3463 |
07 Jun 07 |
nicklas |
204 |
(file == null && Values.getBoolean(cc.getPropertyValue("writeProtected"))) ? "checked" : ""%>></td> |
5908 |
13 Dec 11 |
nicklas |
205 |
<td></td> |
3463 |
07 Jun 07 |
nicklas |
206 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
207 |
<tr > |
5908 |
13 Dec 11 |
nicklas |
208 |
<th>Type</th> |
5908 |
13 Dec 11 |
nicklas |
209 |
<td> |
5643 |
26 May 11 |
nicklas |
210 |
<select name="subtype_id" |
5643 |
26 May 11 |
nicklas |
211 |
<%=!readCurrentSubtype ? "disabled readonly class=\"disabled selectionlist\"" : "class=\"selectionlist\""%>> |
1794 |
19 Jan 06 |
nicklas |
212 |
<% |
5643 |
26 May 11 |
nicklas |
213 |
if (!readCurrentSubtype) |
1794 |
19 Jan 06 |
nicklas |
214 |
{ |
1794 |
19 Jan 06 |
nicklas |
215 |
%> |
1794 |
19 Jan 06 |
nicklas |
216 |
<option value="-1">- denied - |
1794 |
19 Jan 06 |
nicklas |
217 |
<% |
1794 |
19 Jan 06 |
nicklas |
218 |
} |
1794 |
19 Jan 06 |
nicklas |
219 |
else |
1794 |
19 Jan 06 |
nicklas |
220 |
{ |
1794 |
19 Jan 06 |
nicklas |
221 |
%> |
5643 |
26 May 11 |
nicklas |
222 |
<option value="0">-none- |
1794 |
19 Jan 06 |
nicklas |
223 |
<% |
5643 |
26 May 11 |
nicklas |
224 |
for (ItemSubtype subtype : subtypesQuery.list(dc)) |
1794 |
19 Jan 06 |
nicklas |
225 |
{ |
5643 |
26 May 11 |
nicklas |
226 |
int id = subtype.getId(); |
5643 |
26 May 11 |
nicklas |
227 |
if (id != currentSubtypeId && subtype.isRemoved()) continue; |
1794 |
19 Jan 06 |
nicklas |
228 |
%> |
5643 |
26 May 11 |
nicklas |
229 |
<option value="<%=id == currentSubtypeId && file != null ? -id : id%>" |
5643 |
26 May 11 |
nicklas |
230 |
<%=id == currentSubtypeId ? "selected" : ""%> |
5643 |
26 May 11 |
nicklas |
231 |
title="<%=HTML.encodeTags(subtype.getDescription()) %>" |
5643 |
26 May 11 |
nicklas |
232 |
><%=HTML.encodeTags(subtype.getName())%> |
1794 |
19 Jan 06 |
nicklas |
233 |
<% |
1794 |
19 Jan 06 |
nicklas |
234 |
} |
1794 |
19 Jan 06 |
nicklas |
235 |
} |
1794 |
19 Jan 06 |
nicklas |
236 |
%> |
1794 |
19 Jan 06 |
nicklas |
237 |
</select> |
1794 |
19 Jan 06 |
nicklas |
238 |
</td> |
5908 |
13 Dec 11 |
nicklas |
239 |
<td></td> |
1794 |
19 Jan 06 |
nicklas |
240 |
</tr> |
1794 |
19 Jan 06 |
nicklas |
241 |
<tr> |
5908 |
13 Dec 11 |
nicklas |
242 |
<th>MIME type</th> |
5908 |
13 Dec 11 |
nicklas |
243 |
<td><table style="width: 100%;"> |
5569 |
16 Feb 11 |
nicklas |
244 |
<tr> |
6217 |
14 Dec 12 |
nicklas |
245 |
<td style="width: 98%;"><input class="text" type="text" name="mime_type" |
5569 |
16 Feb 11 |
nicklas |
246 |
value="<%=HTML.encodeTags(file == null ? Values.getString(cc.getPropertyValue("mimeType")) : file.getMimeType())%>" |
5908 |
13 Dec 11 |
nicklas |
247 |
maxlength="<%=File.MAX_MIMETYPE_LENGTH%>"></td> |
6308 |
20 Aug 13 |
nicklas |
248 |
<td><base:button id="selectMimeType" title="Select…"/></td> |
5569 |
16 Feb 11 |
nicklas |
249 |
</tr> |
5569 |
16 Feb 11 |
nicklas |
250 |
</table> |
5569 |
16 Feb 11 |
nicklas |
251 |
</td> |
5908 |
13 Dec 11 |
nicklas |
252 |
<td></td> |
1794 |
19 Jan 06 |
nicklas |
253 |
</tr> |
4520 |
15 Sep 08 |
nicklas |
254 |
<tr> |
5908 |
13 Dec 11 |
nicklas |
255 |
<th>Character set</th> |
4520 |
15 Sep 08 |
nicklas |
256 |
<td> |
6416 |
05 Feb 14 |
nicklas |
257 |
<select name="characterSet" class="selectionlist"> |
4520 |
15 Sep 08 |
nicklas |
258 |
<option value="">- n/a - |
4520 |
15 Sep 08 |
nicklas |
259 |
<% |
4520 |
15 Sep 08 |
nicklas |
260 |
String currentCharset = file == null ? |
5908 |
13 Dec 11 |
nicklas |
261 |
Values.getStringOrNull(cc.getPropertyValue("characterSet")) : file.getCharacterSet(); |
5570 |
16 Feb 11 |
nicklas |
262 |
int numCommon = Config.getCommonCharsets().size(); |
5570 |
16 Feb 11 |
nicklas |
263 |
int i = 0; |
4520 |
15 Sep 08 |
nicklas |
264 |
boolean hasMatched = false; |
5570 |
16 Feb 11 |
nicklas |
265 |
for (String charset : Config.getAllCharsets()) |
4520 |
15 Sep 08 |
nicklas |
266 |
{ |
5570 |
16 Feb 11 |
nicklas |
267 |
boolean selected = false; |
5570 |
16 Feb 11 |
nicklas |
268 |
if (!hasMatched) |
5570 |
16 Feb 11 |
nicklas |
269 |
{ |
5570 |
16 Feb 11 |
nicklas |
270 |
selected = charset.equalsIgnoreCase(currentCharset); |
5570 |
16 Feb 11 |
nicklas |
271 |
hasMatched |= selected; |
5570 |
16 Feb 11 |
nicklas |
272 |
} |
4520 |
15 Sep 08 |
nicklas |
273 |
%> |
5570 |
16 Feb 11 |
nicklas |
274 |
<option value="<%=charset%>" <%=selected ? "selected" : ""%> |
5570 |
16 Feb 11 |
nicklas |
275 |
<%=i==numCommon ? "style=\"border-top: 1px solid #666666;\"" : "" %>><%=charset%> |
4520 |
15 Sep 08 |
nicklas |
276 |
<% |
5570 |
16 Feb 11 |
nicklas |
277 |
i++; |
4520 |
15 Sep 08 |
nicklas |
278 |
} |
4520 |
15 Sep 08 |
nicklas |
279 |
if (!hasMatched && currentCharset != null) |
4520 |
15 Sep 08 |
nicklas |
280 |
{ |
4520 |
15 Sep 08 |
nicklas |
281 |
%> |
4520 |
15 Sep 08 |
nicklas |
282 |
<option value="<%=currentCharset%>" selected><%=currentCharset%> |
4520 |
15 Sep 08 |
nicklas |
283 |
<% |
4520 |
15 Sep 08 |
nicklas |
284 |
} |
4520 |
15 Sep 08 |
nicklas |
285 |
%> |
4520 |
15 Sep 08 |
nicklas |
286 |
</select> |
4520 |
15 Sep 08 |
nicklas |
287 |
</td> |
5908 |
13 Dec 11 |
nicklas |
288 |
<td></td> |
4520 |
15 Sep 08 |
nicklas |
289 |
</tr> |
5908 |
13 Dec 11 |
nicklas |
290 |
<tr class="dynamic"> |
5908 |
13 Dec 11 |
nicklas |
291 |
<th>Description</th> |
5908 |
13 Dec 11 |
nicklas |
292 |
<td> |
6607 |
19 Nov 14 |
nicklas |
293 |
<textarea class="text" rows="4" name="description" id="description" |
1794 |
19 Jan 06 |
nicklas |
294 |
><%=HTML.encodeTags(file == null ? cc.getPropertyValue("description") : file.getDescription())%></textarea> |
1794 |
19 Jan 06 |
nicklas |
295 |
</td> |
5908 |
13 Dec 11 |
nicklas |
296 |
<td style="width: 20px;"> |
6215 |
13 Dec 12 |
nicklas |
297 |
<base:zoom textarea="description" title="Description" /> |
5908 |
13 Dec 11 |
nicklas |
298 |
</td> |
1794 |
19 Jan 06 |
nicklas |
299 |
</tr> |
1794 |
19 Jan 06 |
nicklas |
300 |
</table> |
1794 |
19 Jan 06 |
nicklas |
301 |
</t:tab> |
7857 |
20 Oct 20 |
nicklas |
302 |
<t:tab id="annotations" title="Annotations" helpid="annotations.edit"> |
7857 |
20 Oct 20 |
nicklas |
303 |
<jsp:include page="../../common/annotations/annotate_frameset.jsp"> |
7857 |
20 Oct 20 |
nicklas |
304 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
7857 |
20 Oct 20 |
nicklas |
305 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
7857 |
20 Oct 20 |
nicklas |
306 |
<jsp:param name="ID" value="<%=ID%>" /> |
7857 |
20 Oct 20 |
nicklas |
307 |
</jsp:include> |
7857 |
20 Oct 20 |
nicklas |
308 |
</t:tab> |
1794 |
19 Jan 06 |
nicklas |
309 |
</t:tabcontrol> |
5908 |
13 Dec 11 |
nicklas |
310 |
</form> |
5908 |
13 Dec 11 |
nicklas |
311 |
|
5908 |
13 Dec 11 |
nicklas |
312 |
<div class="legend"> |
5946 |
03 Feb 12 |
nicklas |
313 |
<base:icon image="required.png" />= required information |
5908 |
13 Dec 11 |
nicklas |
314 |
</div> |
1794 |
19 Jan 06 |
nicklas |
315 |
|
5908 |
13 Dec 11 |
nicklas |
316 |
<base:buttongroup subclass="dialogbuttons"> |
6308 |
20 Aug 13 |
nicklas |
317 |
<base:button id="btnSave" title="Save" /> |
6308 |
20 Aug 13 |
nicklas |
318 |
<base:button id="close" title="Cancel" /> |
5908 |
13 Dec 11 |
nicklas |
319 |
</base:buttongroup> |
5908 |
13 Dec 11 |
nicklas |
320 |
|
1794 |
19 Jan 06 |
nicklas |
321 |
</base:body> |
1794 |
19 Jan 06 |
nicklas |
322 |
</base:page> |
1794 |
19 Jan 06 |
nicklas |
323 |
<% |
1794 |
19 Jan 06 |
nicklas |
324 |
} |
1794 |
19 Jan 06 |
nicklas |
325 |
finally |
1794 |
19 Jan 06 |
nicklas |
326 |
{ |
1794 |
19 Jan 06 |
nicklas |
327 |
if (dc != null) dc.close(); |
1794 |
19 Jan 06 |
nicklas |
328 |
} |
1794 |
19 Jan 06 |
nicklas |
329 |
%> |