1 | <%-- $Id: list_formulas.jsp 6699 2015-01-30 10:32:48Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
---|
4 | Copyright (C) 2007 Johan Enell, Nicklas Nordborg, Martin Svensson |
---|
5 | |
---|
6 | This file is part of BASE - BioArray Software Environment. |
---|
7 | Available at http://base.thep.lu.se/ |
---|
8 | |
---|
9 | BASE is free software; you can redistribute it and/or |
---|
10 | modify it under the terms of the GNU General Public License |
---|
11 | as published by the Free Software Foundation; either version 3 |
---|
12 | of the License, or (at your option) any later version. |
---|
13 | |
---|
14 | BASE is distributed in the hope that it will be useful, |
---|
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | GNU General Public License for more details. |
---|
18 | |
---|
19 | You should have received a copy of the GNU General Public License |
---|
20 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
21 | ------------------------------------------------------------------ |
---|
22 | |
---|
23 | @author Nicklas |
---|
24 | @version 2.0 |
---|
25 | --%> |
---|
26 | <%@ page pageEncoding="UTF-8" session="false" |
---|
27 | import="net.sf.basedb.core.SessionControl" |
---|
28 | import="net.sf.basedb.core.DbControl" |
---|
29 | import="net.sf.basedb.core.Item" |
---|
30 | import="net.sf.basedb.core.Formula" |
---|
31 | import="net.sf.basedb.core.Type" |
---|
32 | import="net.sf.basedb.core.IntensityTransform" |
---|
33 | import="net.sf.basedb.core.ItemQuery" |
---|
34 | import="net.sf.basedb.core.ItemResultIterator" |
---|
35 | import="net.sf.basedb.core.ItemContext" |
---|
36 | import="net.sf.basedb.core.Nameable" |
---|
37 | import="net.sf.basedb.core.Permission" |
---|
38 | import="net.sf.basedb.core.RawDataTypes" |
---|
39 | import="net.sf.basedb.core.RawDataType" |
---|
40 | import="net.sf.basedb.core.PluginDefinition" |
---|
41 | import="net.sf.basedb.core.plugin.GuiContext" |
---|
42 | import="net.sf.basedb.core.plugin.Plugin" |
---|
43 | import="net.sf.basedb.util.Enumeration" |
---|
44 | import="net.sf.basedb.util.ShareableUtil" |
---|
45 | import="net.sf.basedb.clients.web.Base" |
---|
46 | import="net.sf.basedb.clients.web.ModeInfo" |
---|
47 | import="net.sf.basedb.clients.web.PermissionUtil" |
---|
48 | import="net.sf.basedb.clients.web.util.HTML" |
---|
49 | import="net.sf.basedb.util.Values" |
---|
50 | import="net.sf.basedb.util.formatter.Formatter" |
---|
51 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
52 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
53 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
54 | import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
---|
55 | import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
---|
56 | import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
---|
57 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
58 | import="java.util.Date" |
---|
59 | import="java.util.Iterator" |
---|
60 | import="java.util.List" |
---|
61 | import="java.util.Map" |
---|
62 | %> |
---|
63 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
64 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
65 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
66 | <%! |
---|
67 | private static final Item itemType = Item.FORMULA; |
---|
68 | private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); |
---|
69 | |
---|
70 | private static final Enumeration<String, String> types = new Enumeration<String, String>(); |
---|
71 | private static final Enumeration<String, String> parsers = new Enumeration<String, String>(); |
---|
72 | private static final Enumeration<String, String> avgMethods = new Enumeration<String, String>(); |
---|
73 | private static final Enumeration<String, String> transforms = new Enumeration<String, String>(); |
---|
74 | private static final Enumeration<String, String> rawEnumeration = new Enumeration<String, String>(); |
---|
75 | private static final Enumeration<String, String> valueTypes = new Enumeration<String, String>(); |
---|
76 | static |
---|
77 | { |
---|
78 | for (Formula.Type t : Formula.Type.values()) |
---|
79 | { |
---|
80 | types.add(Integer.toString(t.getValue()), HTML.encodeTags(t.toString())); |
---|
81 | } |
---|
82 | valueTypes.add("", "- unknown -"); |
---|
83 | for (Type v : Type.values()) |
---|
84 | { |
---|
85 | valueTypes.add(Integer.toString(v.getValue()), v.toString()); |
---|
86 | } |
---|
87 | for (Formula.Parser p : Formula.Parser.values()) |
---|
88 | { |
---|
89 | parsers.add(Integer.toString(p.getValue()), HTML.encodeTags(p.toString())); |
---|
90 | } |
---|
91 | for (Formula.AverageMethod m : Formula.AverageMethod.values()) |
---|
92 | { |
---|
93 | avgMethods.add(Integer.toString(m.getValue()), HTML.encodeTags(m.toString())); |
---|
94 | } |
---|
95 | transforms.add("", "- any -"); |
---|
96 | for (IntensityTransform t : IntensityTransform.values()) |
---|
97 | { |
---|
98 | transforms.add(Integer.toString(t.getValue()), HTML.encodeTags(t.toString())); |
---|
99 | } |
---|
100 | rawEnumeration.add("", "- none -"); |
---|
101 | for (RawDataType rdt : RawDataTypes.getRawDataTypes()) |
---|
102 | { |
---|
103 | rawEnumeration.add(rdt.getId(), HTML.encodeTags(rdt.getName())); |
---|
104 | } |
---|
105 | rawEnumeration.sortValues(); |
---|
106 | } |
---|
107 | %> |
---|
108 | <% |
---|
109 | final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType); |
---|
110 | final String ID = sc.getId(); |
---|
111 | final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType); |
---|
112 | final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
---|
113 | |
---|
114 | final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
---|
115 | final String callback = request.getParameter("callback"); |
---|
116 | final String title = mode.generateTitle("formula", "formulas"); |
---|
117 | final DbControl dc = sc.newDbControl(); |
---|
118 | ItemResultIterator<Formula> formulas = null; |
---|
119 | try |
---|
120 | { |
---|
121 | Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
---|
122 | Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
---|
123 | try |
---|
124 | { |
---|
125 | final ItemQuery<Formula> query = Base.getConfiguredQuery(dc, cc, true, Formula.getQuery(), mode); |
---|
126 | formulas = query.iterate(dc); |
---|
127 | } |
---|
128 | catch (Throwable t) |
---|
129 | { |
---|
130 | t.printStackTrace(); |
---|
131 | cc.setMessage(t.getMessage()); |
---|
132 | } |
---|
133 | int numListed = 0; |
---|
134 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null); |
---|
135 | ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); |
---|
136 | ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); |
---|
137 | %> |
---|
138 | <base:page title="<%=title==null ? "Formulas" : title%>" type="<%=mode.getPageType()%>" id="list-page"> |
---|
139 | <base:head scripts="table.js,~formulas.js" styles="table.css,toolbar.css"> |
---|
140 | <ext:scripts context="<%=jspContext%>" /> |
---|
141 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
142 | </base:head> |
---|
143 | |
---|
144 | <base:body> |
---|
145 | <h1><%=title==null ? "Formulas" : title%></h1> |
---|
146 | <div class="content"> |
---|
147 | <tbl:table |
---|
148 | id="formulas" |
---|
149 | columns="<%=cc.getSetting("columns")%>" |
---|
150 | sortby="<%=cc.getSortProperty()%>" |
---|
151 | direction="<%=cc.getSortDirection()%>" |
---|
152 | action="index.jsp" |
---|
153 | sc="<%=sc%>" |
---|
154 | item="<%=itemType%>" |
---|
155 | filterrows="<%=cc.getFilterRows()%>" |
---|
156 | subclass="fulltable" |
---|
157 | > |
---|
158 | <tbl:hidden |
---|
159 | name="mode" |
---|
160 | value="<%=mode.getName()%>" |
---|
161 | /> |
---|
162 | <tbl:hidden |
---|
163 | name="callback" |
---|
164 | value="<%=callback%>" |
---|
165 | skip="<%=callback == null%>" |
---|
166 | /> |
---|
167 | <tbl:columndef |
---|
168 | id="name" |
---|
169 | property="name" |
---|
170 | datatype="string" |
---|
171 | title="Name" |
---|
172 | sortable="true" |
---|
173 | filterable="true" |
---|
174 | exportable="true" |
---|
175 | show="always" |
---|
176 | /> |
---|
177 | <tbl:columndef |
---|
178 | id="id" |
---|
179 | clazz="uniquecol" |
---|
180 | property="id" |
---|
181 | datatype="int" |
---|
182 | title="ID" |
---|
183 | sortable="true" |
---|
184 | filterable="true" |
---|
185 | exportable="true" |
---|
186 | /> |
---|
187 | <tbl:columndef |
---|
188 | id="entryDate" |
---|
189 | property="entryDate" |
---|
190 | datatype="date" |
---|
191 | title="Registered" |
---|
192 | sortable="true" |
---|
193 | filterable="true" |
---|
194 | exportable="true" |
---|
195 | formatter="<%=dateFormatter%>" |
---|
196 | /> |
---|
197 | <tbl:columndef |
---|
198 | id="type" |
---|
199 | property="type" |
---|
200 | datatype="int" |
---|
201 | enumeration="<%=types%>" |
---|
202 | title="Type" |
---|
203 | sortable="true" |
---|
204 | filterable="true" |
---|
205 | exportable="true" |
---|
206 | /> |
---|
207 | <tbl:columndef |
---|
208 | id="parser" |
---|
209 | property="parser" |
---|
210 | datatype="int" |
---|
211 | enumeration="<%=parsers%>" |
---|
212 | title="Parser" |
---|
213 | sortable="true" |
---|
214 | filterable="true" |
---|
215 | exportable="true" |
---|
216 | /> |
---|
217 | <tbl:columndef |
---|
218 | id="valueType" |
---|
219 | property="valueType" |
---|
220 | datatype="int" |
---|
221 | enumeration="<%=valueTypes%>" |
---|
222 | title="Value type" |
---|
223 | sortable="true" |
---|
224 | filterable="true" |
---|
225 | exportable="true" |
---|
226 | /> |
---|
227 | <tbl:columndef |
---|
228 | id="averageMethod" |
---|
229 | property="averageMethod" |
---|
230 | datatype="int" |
---|
231 | enumeration="<%=avgMethods%>" |
---|
232 | title="Avg. method" |
---|
233 | sortable="true" |
---|
234 | filterable="true" |
---|
235 | exportable="true" |
---|
236 | /> |
---|
237 | <tbl:columndef |
---|
238 | id="sourceIntensityTransform" |
---|
239 | property="sourceIntensityTransform" |
---|
240 | datatype="int" |
---|
241 | enumeration="<%=transforms%>" |
---|
242 | title="Source intensity transform" |
---|
243 | sortable="true" |
---|
244 | filterable="true" |
---|
245 | exportable="true" |
---|
246 | /> |
---|
247 | <tbl:columndef |
---|
248 | id="resultIntensityTransform" |
---|
249 | property="resultIntensityTransform" |
---|
250 | datatype="int" |
---|
251 | enumeration="<%=transforms%>" |
---|
252 | title="Result intensity transform" |
---|
253 | sortable="true" |
---|
254 | filterable="true" |
---|
255 | exportable="true" |
---|
256 | /> |
---|
257 | <tbl:columndef |
---|
258 | id="rawDataType" |
---|
259 | property="rawDataType" |
---|
260 | datatype="string" |
---|
261 | enumeration="<%=rawEnumeration%>" |
---|
262 | title="Raw data type" |
---|
263 | sortable="true" |
---|
264 | filterable="true" |
---|
265 | exportable="true" |
---|
266 | /> |
---|
267 | <tbl:columndef |
---|
268 | id="channels" |
---|
269 | property="channels" |
---|
270 | datatype="int" |
---|
271 | title="Channels" |
---|
272 | sortable="true" |
---|
273 | filterable="true" |
---|
274 | exportable="true" |
---|
275 | /> |
---|
276 | <tbl:columndef |
---|
277 | id="formulas" |
---|
278 | property="formulas" |
---|
279 | datatype="string" |
---|
280 | title="Formulas" |
---|
281 | sortable="false" |
---|
282 | filterable="false" |
---|
283 | exportable="true" |
---|
284 | /> |
---|
285 | <tbl:columndef |
---|
286 | id="useColors" |
---|
287 | property="coloring#usingColors" |
---|
288 | datatype="boolean" |
---|
289 | title="Use colors" |
---|
290 | sortable="true" |
---|
291 | filterable="true" |
---|
292 | exportable="true" |
---|
293 | /> |
---|
294 | <tbl:columndef |
---|
295 | id="logarithmic" |
---|
296 | property="coloring#logarithmic" |
---|
297 | datatype="boolean" |
---|
298 | title="Logarithmic" |
---|
299 | sortable="true" |
---|
300 | filterable="true" |
---|
301 | exportable="true" |
---|
302 | /> |
---|
303 | <tbl:columndef |
---|
304 | id="minValue" |
---|
305 | property="coloring#minValue" |
---|
306 | datatype="float" |
---|
307 | title="Min value" |
---|
308 | sortable="true" |
---|
309 | filterable="true" |
---|
310 | exportable="true" |
---|
311 | /> |
---|
312 | <tbl:columndef |
---|
313 | id="midValue" |
---|
314 | property="coloring#midValue" |
---|
315 | datatype="float" |
---|
316 | title="Mid value" |
---|
317 | sortable="true" |
---|
318 | filterable="true" |
---|
319 | exportable="true" |
---|
320 | /> |
---|
321 | <tbl:columndef |
---|
322 | id="maxValue" |
---|
323 | property="coloring#maxValue" |
---|
324 | datatype="float" |
---|
325 | title="Max value" |
---|
326 | sortable="true" |
---|
327 | filterable="true" |
---|
328 | exportable="true" |
---|
329 | /> |
---|
330 | <tbl:columndef |
---|
331 | id="owner" |
---|
332 | property="owner.name" |
---|
333 | datatype="string" |
---|
334 | title="Owner" |
---|
335 | sortable="true" |
---|
336 | filterable="true" |
---|
337 | exportable="true" |
---|
338 | /> |
---|
339 | <tbl:columndef |
---|
340 | id="description" |
---|
341 | property="description" |
---|
342 | datatype="string" |
---|
343 | title="Description" |
---|
344 | sortable="true" |
---|
345 | filterable="true" |
---|
346 | exportable="true" |
---|
347 | /> |
---|
348 | <tbl:columndef |
---|
349 | id="permission" |
---|
350 | title="Permission" |
---|
351 | /> |
---|
352 | <tbl:columndef |
---|
353 | id="sharedTo" |
---|
354 | title="Shared to" |
---|
355 | filterable="true" |
---|
356 | filterproperty="!sharedTo.name" |
---|
357 | datatype="string" |
---|
358 | /> |
---|
359 | <tbl:columndef |
---|
360 | id="xt-columns" |
---|
361 | extensions="<%=columnsInvoker%>" |
---|
362 | jspcontext="<%=jspContext%>" |
---|
363 | /> |
---|
364 | <div class="panelgroup bg-filled-50 bottomborder"> |
---|
365 | <tbl:toolbar |
---|
366 | subclass="bottomborder" |
---|
367 | visible="<%=mode.hasToolbar()%>" |
---|
368 | > |
---|
369 | <tbl:button |
---|
370 | id="btnNewItem" |
---|
371 | disabled="<%=!createPermission%>" |
---|
372 | image="new.png" |
---|
373 | title="New…" |
---|
374 | tooltip="<%=createPermission ? "Create new formula" : "You do not have permission to create formulas"%>" |
---|
375 | /> |
---|
376 | <tbl:button |
---|
377 | id="btnDeleteItems" |
---|
378 | image="delete.png" |
---|
379 | title="Delete" |
---|
380 | tooltip="Delete the selected items" |
---|
381 | /> |
---|
382 | <tbl:button |
---|
383 | id="btnRestoreItems" |
---|
384 | image="restore.png" |
---|
385 | title="Restore" |
---|
386 | tooltip="Restore the selected (deleted) items" |
---|
387 | /> |
---|
388 | <tbl:button |
---|
389 | id="btnShareItems" |
---|
390 | image="share.png" |
---|
391 | title="Share…" |
---|
392 | tooltip="Share the selected items" |
---|
393 | /> |
---|
394 | <tbl:button |
---|
395 | id="btnSetOwner" |
---|
396 | image="take_ownership.png" |
---|
397 | title="Set owner…" |
---|
398 | tooltip="Change owner of the selected items" |
---|
399 | /> |
---|
400 | <tbl:button |
---|
401 | id="btnColumns" |
---|
402 | image="columns.png" |
---|
403 | title="Columns…" |
---|
404 | tooltip="Show, hide and re-order columns" |
---|
405 | /> |
---|
406 | <tbl:button |
---|
407 | id="btnImport" |
---|
408 | data-plugin-type="IMPORT" |
---|
409 | image="import.png" |
---|
410 | title="Import…" |
---|
411 | tooltip="Import data" |
---|
412 | visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
---|
413 | /> |
---|
414 | <tbl:button |
---|
415 | id="btnExport" |
---|
416 | data-plugin-type="EXPORT" |
---|
417 | image="export.png" |
---|
418 | title="Export…" |
---|
419 | tooltip="Export data" |
---|
420 | visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
---|
421 | /> |
---|
422 | <tbl:button |
---|
423 | id="btnRunPlugin" |
---|
424 | data-plugin-type="OTHER" |
---|
425 | image="runplugin.png" |
---|
426 | title="Run plugin…" |
---|
427 | tooltip="Run a plugin" |
---|
428 | visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
---|
429 | /> |
---|
430 | <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
---|
431 | wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/> |
---|
432 | </tbl:toolbar> |
---|
433 | <tbl:panel> |
---|
434 | <tbl:presetselector /> |
---|
435 | <tbl:navigator |
---|
436 | page="<%=cc.getPage()%>" |
---|
437 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
438 | totalrows="<%=formulas == null ? 0 : formulas.getTotalCount()%>" |
---|
439 | visible="<%=mode.hasNavigator()%>" |
---|
440 | /> |
---|
441 | </tbl:panel> |
---|
442 | </div> |
---|
443 | <tbl:data> |
---|
444 | <tbl:headers> |
---|
445 | <tbl:headerrow> |
---|
446 | <tbl:header colspan="3" /> |
---|
447 | <tbl:columnheaders /> |
---|
448 | </tbl:headerrow> |
---|
449 | <% |
---|
450 | int numFilters = cc.getNumPropertyFilters(); |
---|
451 | int numRows = cc.getFilterRows(); |
---|
452 | for (int filterNo = 0; filterNo < numRows; filterNo++) |
---|
453 | { |
---|
454 | boolean lastRow = filterNo == numRows-1; |
---|
455 | %> |
---|
456 | <tbl:headerrow> |
---|
457 | <tbl:header subclass="index" /> |
---|
458 | <tbl:header |
---|
459 | subclass="check" |
---|
460 | visible="<%=mode.hasCheck()%>" |
---|
461 | ><base:icon |
---|
462 | id="check.uncheck" |
---|
463 | image="check_uncheck.png" |
---|
464 | tooltip="Check/uncheck all" |
---|
465 | visible="<%=lastRow%>" |
---|
466 | /></tbl:header> |
---|
467 | <tbl:header |
---|
468 | subclass="check" |
---|
469 | visible="<%=mode.hasRadio()%>" |
---|
470 | /> |
---|
471 | <tbl:header |
---|
472 | subclass="icons" |
---|
473 | visible="<%=mode.hasIcons()%>" |
---|
474 | > |
---|
475 | <base:icon |
---|
476 | subclass="link table-filter-row-action" |
---|
477 | image="add.png" |
---|
478 | tooltip="Add extra filter row" |
---|
479 | visible="<%=lastRow%>" |
---|
480 | /><base:icon |
---|
481 | subclass="link table-filter-row-action" |
---|
482 | image="remove.png" |
---|
483 | tooltip="Remove this filter row" |
---|
484 | visible="<%=numRows > 1 || numFilters > 0 %>" |
---|
485 | data-remove-row="<%=filterNo%>" |
---|
486 | /> |
---|
487 | </tbl:header> |
---|
488 | <tbl:propertyfilter row="<%=filterNo%>" /> |
---|
489 | </tbl:headerrow> |
---|
490 | <% |
---|
491 | } |
---|
492 | %> |
---|
493 | </tbl:headers> |
---|
494 | <tbl:rows> |
---|
495 | <% |
---|
496 | if (cc.getMessage() != null) |
---|
497 | { |
---|
498 | %> |
---|
499 | <tbl:panel subclass="bg-filled-50"> |
---|
500 | <div class="messagecontainer error"><%=cc.getMessage()%></div> |
---|
501 | </tbl:panel> |
---|
502 | <% |
---|
503 | cc.setMessage(null); |
---|
504 | } |
---|
505 | int index = cc.getPage()*cc.getRowsPerPage(); |
---|
506 | int selectedItemId = cc.getId(); |
---|
507 | if (formulas != null) |
---|
508 | { |
---|
509 | while (formulas.hasNext()) |
---|
510 | { |
---|
511 | Formula item = formulas.next(); |
---|
512 | RawDataType rawDataType = item.getRawDataType(); |
---|
513 | List<String> expressions = item.getFormulas(); |
---|
514 | int itemId = item.getId(); |
---|
515 | |
---|
516 | |
---|
517 | boolean deletePermission = item.hasPermission(Permission.DELETE); |
---|
518 | boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); |
---|
519 | boolean writePermission = item.hasPermission(Permission.WRITE); |
---|
520 | String tooltip = mode.isSelectionMode() ? |
---|
521 | "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); |
---|
522 | String name = HTML.encodeTags(item.getName()); |
---|
523 | index++; |
---|
524 | numListed++; |
---|
525 | %> |
---|
526 | <tbl:row> |
---|
527 | <tbl:header |
---|
528 | clazz="index" |
---|
529 | ><%=index%></tbl:header> |
---|
530 | <tbl:header |
---|
531 | clazz="check" |
---|
532 | visible="<%=mode.hasCheck()%>" |
---|
533 | ><input |
---|
534 | type="checkbox" |
---|
535 | name="<%=itemId%>" |
---|
536 | value="<%=itemId%>" |
---|
537 | title="<%=name%>" |
---|
538 | <%=cc.getSelected().contains(itemId) ? "checked" : ""%> |
---|
539 | ></tbl:header> |
---|
540 | <tbl:header |
---|
541 | clazz="check" |
---|
542 | visible="<%=mode.hasRadio()%>" |
---|
543 | ><input |
---|
544 | type="radio" |
---|
545 | name="item_id" |
---|
546 | value="<%=itemId%>" |
---|
547 | title="<%=name%>" |
---|
548 | <%=selectedItemId == itemId ? "checked" : ""%> |
---|
549 | ></tbl:header> |
---|
550 | <tbl:header |
---|
551 | clazz="icons" |
---|
552 | visible="<%=mode.hasIcons()%>" |
---|
553 | ><base:icon |
---|
554 | image="deleted.png" |
---|
555 | id="<%="delete."+itemId %>" |
---|
556 | subclass="<%=deletePermission ? "table-delete-item" : null %>" |
---|
557 | data-item-id="<%=itemId%>" |
---|
558 | tooltip="This item has been scheduled for deletion" |
---|
559 | visible="<%=item.isRemoved()%>" |
---|
560 | /><base:icon |
---|
561 | image="shared.png" |
---|
562 | id="<%="share."+itemId %>" |
---|
563 | subclass="<%=sharePermission ? "table-share-item" : null %>" |
---|
564 | data-item-id="<%=itemId%>" |
---|
565 | tooltip="This item is shared to other users, groups and/or projects" |
---|
566 | visible="<%=item.isShared()%>" |
---|
567 | /> </tbl:header> |
---|
568 | <tbl:cell column="name"><div |
---|
569 | class="link table-item" |
---|
570 | data-item-id="<%=itemId%>" |
---|
571 | data-no-edit="<%=writePermission ? 0 : 1 %>" |
---|
572 | tabindex="0" |
---|
573 | title="<%=tooltip%>"><%=name%></div></tbl:cell> |
---|
574 | <tbl:cell column="id"><%=item.getId()%></tbl:cell> |
---|
575 | <tbl:cell column="entryDate" value="<%=item.getEntryDate()%>" /> |
---|
576 | <tbl:cell column="type"><%=item.getFormulaType().toString()%></tbl:cell> |
---|
577 | <tbl:cell column="parser"><%=item.getParser().toString()%></tbl:cell> |
---|
578 | <tbl:cell column="valueType"><%=item.getValueType() == null ? "<i>- unknown -</i>" : item.getValueType()%></tbl:cell> |
---|
579 | <tbl:cell column="averageMethod"><%=item.getAverageMethod().toString()%></tbl:cell> |
---|
580 | <tbl:cell column="sourceIntensityTransform"><%=item.getSourceIntensityTransform() == null ? "<i>- any -</i>" : item.getSourceIntensityTransform().toString()%></tbl:cell> |
---|
581 | <tbl:cell column="resultIntensityTransform"><%=item.getResultIntensityTransform() == null ? "<i>- any -</i>" : item.getResultIntensityTransform().toString()%></tbl:cell> |
---|
582 | <tbl:cell column="rawDataType"><%=rawDataType == null ? "<i>- none -</i>" : HTML.encodeTags(rawDataType.getName())%></tbl:cell> |
---|
583 | <tbl:cell column="channels"><%=item.getChannels()%></tbl:cell> |
---|
584 | <tbl:cell column="formulas"> |
---|
585 | <% |
---|
586 | for (int i = 0; i < expressions.size(); ++i) |
---|
587 | { |
---|
588 | %> |
---|
589 | <%=(i+1) + ": " + HTML.encodeTags(expressions.get(i))%><br> |
---|
590 | <% |
---|
591 | } |
---|
592 | %> |
---|
593 | </tbl:cell> |
---|
594 | <tbl:cell column="owner" |
---|
595 | ><base:propertyvalue |
---|
596 | item="<%=item%>" |
---|
597 | property="owner" |
---|
598 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
599 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
600 | /></tbl:cell> |
---|
601 | <tbl:cell column="useColors"><%=item.getColoring().isUsingColors() ? "yes" : "no"%></tbl:cell> |
---|
602 | <tbl:cell column="logarithmic"><%=item.getColoring().isLogarithmic() ? "yes" : "no"%></tbl:cell> |
---|
603 | <tbl:cell column="minValue"><%=Values.formatNumber(item.getColoring().getMinValue(), 2)%></tbl:cell> |
---|
604 | <tbl:cell column="midValue"><%=Values.formatNumber(item.getColoring().getMidValue(), 2)%></tbl:cell> |
---|
605 | <tbl:cell column="maxValue"><%=Values.formatNumber(item.getColoring().getMaxValue(), 2)%></tbl:cell> |
---|
606 | <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
---|
607 | <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> |
---|
608 | <tbl:cell column="sharedTo"> |
---|
609 | <% |
---|
610 | Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); |
---|
611 | while(sharees.hasNext()) |
---|
612 | { |
---|
613 | Nameable n = sharees.next(); |
---|
614 | if (mode.hasPropertyLink()) |
---|
615 | { |
---|
616 | out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); |
---|
617 | } |
---|
618 | else |
---|
619 | { |
---|
620 | out.write(HTML.encodeTags(n.getName())); |
---|
621 | } |
---|
622 | out.write(sharees.hasNext() ? ", " : ""); |
---|
623 | } |
---|
624 | %> |
---|
625 | </tbl:cell> |
---|
626 | <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> |
---|
627 | <tbl:cell column="xt-columns" /> |
---|
628 | </tbl:xt-cells> |
---|
629 | </tbl:row> |
---|
630 | <% |
---|
631 | } |
---|
632 | } |
---|
633 | if (numListed == 0) |
---|
634 | { |
---|
635 | %> |
---|
636 | <tbl:panel subclass="bg-filled-50"> |
---|
637 | <div class="messagecontainer note"> |
---|
638 | <%=formulas == null || formulas.getTotalCount() == 0 ? "No formulas were found" : "No formulas on this page. Please select another page!" %> |
---|
639 | </div> |
---|
640 | </tbl:panel> |
---|
641 | <% |
---|
642 | } |
---|
643 | %> |
---|
644 | </tbl:rows> |
---|
645 | </tbl:data> |
---|
646 | </tbl:table> |
---|
647 | </div> |
---|
648 | |
---|
649 | <base:buttongroup subclass="dialogbuttons"> |
---|
650 | <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> |
---|
651 | <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> |
---|
652 | <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> |
---|
653 | </base:buttongroup> |
---|
654 | |
---|
655 | </base:body> |
---|
656 | </base:page> |
---|
657 | <% |
---|
658 | } |
---|
659 | finally |
---|
660 | { |
---|
661 | if (formulas != null) formulas.close(); |
---|
662 | if (dc != null) dc.close(); |
---|
663 | } |
---|
664 | %> |
---|