1 | <%-- $Id: menu.jsp 4187 2008-03-20 11:15:25Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2005 Nicklas Nordborg, Gregory Vincic |
---|
4 | Copyright (C) 2006 Jari Hakkinen, Nicklas Nordborg, Martin Svensson, Gregory Vincic |
---|
5 | Copyright (C) 2007 Nicklas Nordborg |
---|
6 | |
---|
7 | This file is part of BASE - BioArray Software Environment. |
---|
8 | Available at http://base.thep.lu.se/ |
---|
9 | |
---|
10 | BASE is free software; you can redistribute it and/or |
---|
11 | modify it under the terms of the GNU General Public License |
---|
12 | as published by the Free Software Foundation; either version 2 |
---|
13 | of the License, or (at your option) any later version. |
---|
14 | |
---|
15 | BASE is distributed in the hope that it will be useful, |
---|
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
18 | GNU General Public License for more details. |
---|
19 | |
---|
20 | You should have received a copy of the GNU General Public License |
---|
21 | along with this program; if not, write to the Free Software |
---|
22 | Foundation, Inc., 59 Temple Place - Suite 330, |
---|
23 | Boston, MA 02111-1307, USA. |
---|
24 | ------------------------------------------------------------------ |
---|
25 | |
---|
26 | This page is included from the <base:page> taglib to display the |
---|
27 | meny. |
---|
28 | |
---|
29 | @param name |
---|
30 | The name of the menu to display: |
---|
31 | - standard: The standard menu for a logged in user |
---|
32 | - login: The menu used on pages where no user is logged in |
---|
33 | - exception: Used on error pages, does not display a menu at all |
---|
34 | - auto: Will display either the "standard" or "login" menu |
---|
35 | |
---|
36 | @author Nicklas |
---|
37 | @version 2.0 |
---|
38 | --%> |
---|
39 | <%@ page session="false" |
---|
40 | import="net.sf.basedb.core.SessionControl" |
---|
41 | import="net.sf.basedb.core.DbControl" |
---|
42 | import="net.sf.basedb.core.BasicItem" |
---|
43 | import="net.sf.basedb.core.Nameable" |
---|
44 | import="net.sf.basedb.core.Permission" |
---|
45 | import="net.sf.basedb.core.Item" |
---|
46 | import="net.sf.basedb.core.ItemContext" |
---|
47 | import="net.sf.basedb.core.User" |
---|
48 | import="net.sf.basedb.core.Project" |
---|
49 | import="net.sf.basedb.core.Client" |
---|
50 | import="net.sf.basedb.core.StringUtil" |
---|
51 | import="net.sf.basedb.core.ItemQuery" |
---|
52 | import="net.sf.basedb.core.Include" |
---|
53 | import="net.sf.basedb.core.ItemResultList" |
---|
54 | import="net.sf.basedb.core.query.Orders" |
---|
55 | import="net.sf.basedb.core.query.Hql" |
---|
56 | import="net.sf.basedb.clients.web.Base" |
---|
57 | import="net.sf.basedb.clients.web.util.HTML" |
---|
58 | import="net.sf.basedb.util.Values" |
---|
59 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
60 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
61 | import="net.sf.basedb.clients.web.extensions.menu.MenuItemAction" |
---|
62 | import="net.sf.basedb.util.extensions.Extension" |
---|
63 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
64 | import="net.sf.basedb.util.extensions.ActionIterator" |
---|
65 | import="java.util.HashMap" |
---|
66 | import="java.util.ArrayList" |
---|
67 | import="java.util.List" |
---|
68 | import="java.util.Arrays" |
---|
69 | import="java.util.Iterator" |
---|
70 | %> |
---|
71 | <%@ taglib prefix="m" uri="/WEB-INF/menu.tld" %> |
---|
72 | <% |
---|
73 | final SessionControl sc = Base.getSessionControl(pageContext, false); |
---|
74 | final String ID = sc == null ? "" : sc.getId(); |
---|
75 | String name = Values.getString(request.getParameter("name"), "login"); |
---|
76 | final String root = request.getContextPath()+"/"; |
---|
77 | if ("exception".equals(name) && sc != null && sc.isLoggedIn()) name = "standard"; |
---|
78 | |
---|
79 | if ("login".equals(name)) |
---|
80 | { |
---|
81 | } |
---|
82 | else if ("recentItems".equals(name) && sc != null && sc.isLoggedIn()) |
---|
83 | { |
---|
84 | // Recently used items menu |
---|
85 | String stickyItems = Values.getString(sc.getUserClientSetting("menu.mostRecent"), |
---|
86 | "EXPERIMENT:BIOASSAYSET:TRANSFORMATION"); |
---|
87 | boolean loadNames = Values.getBoolean(sc.getUserClientSetting("menu.mostRecent.loadNames"), |
---|
88 | true); |
---|
89 | String recentItems = sc.getUserClientSetting("menu.mostRecent.viewed"); |
---|
90 | DbControl dc = loadNames ? sc.newDbControl() : null; |
---|
91 | try |
---|
92 | { |
---|
93 | %> |
---|
94 | <m:menu |
---|
95 | id="mostRecent" |
---|
96 | style="display: none;" |
---|
97 | > |
---|
98 | <% |
---|
99 | int numItems = 0; |
---|
100 | // Recently viewed items |
---|
101 | List<String> recentlyViewed = recentItems == null ? |
---|
102 | new ArrayList<String>() : Arrays.asList(recentItems.split(":")); |
---|
103 | if (recentlyViewed.size() > 0) |
---|
104 | { |
---|
105 | %> |
---|
106 | <m:menuitem |
---|
107 | title="Recently viewed items" |
---|
108 | style="font-weight: bold; color: #000000; background: #e8e8e8;" |
---|
109 | enabled="false" |
---|
110 | /> |
---|
111 | <m:menuseparator /> |
---|
112 | <% |
---|
113 | for (String recent : recentlyViewed) |
---|
114 | { |
---|
115 | try |
---|
116 | { |
---|
117 | String[] tmp = recent.split("="); |
---|
118 | Item itemType = Item.valueOf(tmp[0]); |
---|
119 | int itemId = Values.getInt(tmp[1], 0); |
---|
120 | if (itemId != 0) |
---|
121 | { |
---|
122 | String shortName = ""; |
---|
123 | String fullName = ""; |
---|
124 | if (loadNames) |
---|
125 | { |
---|
126 | try |
---|
127 | { |
---|
128 | BasicItem item = itemType.getById(dc, itemId); |
---|
129 | fullName = ((Nameable)item).getName(); |
---|
130 | shortName = HTML.encodeTags(StringUtil.trimString(fullName, 35)); |
---|
131 | } |
---|
132 | catch (Throwable t) |
---|
133 | { |
---|
134 | continue; |
---|
135 | } |
---|
136 | } |
---|
137 | else |
---|
138 | { |
---|
139 | fullName = itemType.toString() + "; id=" + itemId; |
---|
140 | shortName = itemType + " (id=" + itemId + ")"; |
---|
141 | } |
---|
142 | numItems++; |
---|
143 | %> |
---|
144 | <m:menuitem |
---|
145 | title="<%=numItems + ". " + shortName%>" |
---|
146 | onclick="<%="Main.viewOrEditItem('" + ID + "', '" + itemType.name() + "', " + itemId + ")"%>" |
---|
147 | tooltip="<%="Go to " + HTML.encodeTags(fullName) + " (" + itemType + ")"%>" |
---|
148 | /> |
---|
149 | <% |
---|
150 | } |
---|
151 | } |
---|
152 | catch (Throwable t) |
---|
153 | {} |
---|
154 | } |
---|
155 | } |
---|
156 | if (stickyItems != null && stickyItems.length() > 0) |
---|
157 | { |
---|
158 | int numSticky = 0; |
---|
159 | if (numItems > 0) |
---|
160 | { |
---|
161 | %> |
---|
162 | <m:menuseparator /> |
---|
163 | <% |
---|
164 | } |
---|
165 | %> |
---|
166 | <m:menuitem |
---|
167 | title="Sticky items" |
---|
168 | style="font-weight: bold; color: #000000; background: #e8e8e8;" |
---|
169 | enabled="false" |
---|
170 | /> |
---|
171 | <m:menuseparator /> |
---|
172 | <% |
---|
173 | // Sticky items |
---|
174 | for (String recentItem : stickyItems.split(":")) |
---|
175 | { |
---|
176 | try |
---|
177 | { |
---|
178 | Item itemType = Item.valueOf(recentItem); |
---|
179 | ItemContext cc = sc.getCurrentContext(itemType); |
---|
180 | if (cc.getId() != 0) |
---|
181 | { |
---|
182 | String shortName = ""; |
---|
183 | String fullName = ""; |
---|
184 | if (loadNames) |
---|
185 | { |
---|
186 | try |
---|
187 | { |
---|
188 | BasicItem item = itemType.getById(dc, cc.getId()); |
---|
189 | fullName = ((Nameable)item).getName(); |
---|
190 | shortName = ": " + HTML.encodeTags(StringUtil.trimString(fullName, 30)); |
---|
191 | } |
---|
192 | catch (Throwable t) |
---|
193 | { |
---|
194 | continue; |
---|
195 | } |
---|
196 | } |
---|
197 | else |
---|
198 | { |
---|
199 | fullName = itemType.toString() + "; id=" + cc.getId(); |
---|
200 | shortName = " (id=" + cc.getId() + ")"; |
---|
201 | } |
---|
202 | numItems++; |
---|
203 | numSticky++; |
---|
204 | %> |
---|
205 | <m:menuitem |
---|
206 | title="<%=itemType + shortName%>" |
---|
207 | onclick="<%="Main.viewOrEditItem('" + ID + "', '" + itemType.name() + "', " + cc.getId() + ")"%>" |
---|
208 | tooltip="<%="Go to " + HTML.encodeTags(fullName) + " (" + itemType + ")"%>" |
---|
209 | /> |
---|
210 | <% |
---|
211 | if (itemType == Item.BIOASSAYSET) |
---|
212 | { |
---|
213 | // Add menu for Experiment explorer as well |
---|
214 | %> |
---|
215 | <m:menuitem |
---|
216 | title="<%="Experiment explorer"+HTML.encodeTags(shortName)%>" |
---|
217 | onclick="<%="location.href = '"+root+"views/experiments/explorer/view/index.jsp?ID=" + ID + "&bioassayset_id="+cc.getId()+"'"%>" |
---|
218 | tooltip="Go to experiment explorer" |
---|
219 | /> |
---|
220 | <% |
---|
221 | } |
---|
222 | } |
---|
223 | } |
---|
224 | catch (Throwable t) |
---|
225 | {} |
---|
226 | } |
---|
227 | if (numSticky == 0) |
---|
228 | { |
---|
229 | %> |
---|
230 | <m:menuitem |
---|
231 | title="<i>- no sticky items -</i>" |
---|
232 | enabled="false" |
---|
233 | /> |
---|
234 | <% |
---|
235 | } |
---|
236 | } |
---|
237 | %> |
---|
238 | <m:menuseparator /> |
---|
239 | <m:menuitem |
---|
240 | title="Options…" |
---|
241 | onclick="<%="Main.openPopup('"+root+"my_base/user/preferences.jsp?ID="+ID+"&page=mostRecent', 'Preferences', 500, 400);"%>" |
---|
242 | tooltip="Change options for this menu" |
---|
243 | /> |
---|
244 | </m:menu> |
---|
245 | <% |
---|
246 | } |
---|
247 | finally |
---|
248 | { |
---|
249 | if (dc != null) dc.close(); |
---|
250 | } |
---|
251 | } |
---|
252 | else if ("standard".equals(name)) |
---|
253 | { |
---|
254 | final DbControl dc = sc.newDbControl(); |
---|
255 | ItemResultList<Project> projects = null; |
---|
256 | StringBuilder fillText = new StringBuilder(); |
---|
257 | try |
---|
258 | { |
---|
259 | fillText.append("<a href=\"javascript:void(0)\" title=\"Refresh current page\""); |
---|
260 | fillText.append(" onclick=\"location.reload()\">"); |
---|
261 | fillText.append("<img src=\""+root+"images/refresh.gif\" border=\"0\"></a><span class=\"menuseparator\"> </span>"); |
---|
262 | |
---|
263 | fillText.append("<a href=\"javascript:void(0)\" title=\"Go to the most recently viewed item\""); |
---|
264 | fillText.append(" onclick=\"Menu.toggleTopMenu(document.getElementById('mostRecent'), event.clientX-20, event.clientY); event.cancelBubble = true;\">"); |
---|
265 | fillText.append(" <img src=\""+root+"images/recent.png\" border=\"0\"><img src=\""+root+"images/sort_asc.gif\" border=\"0\"></a><span class=\"menuseparator\"> </span>"); |
---|
266 | |
---|
267 | Project activeProject = sc.getActiveProjectId() == 0 ? null : Project.getById(dc, sc.getActiveProjectId()); |
---|
268 | fillText.append("<img src=\""+root+"images/project.gif\" border=\"0\"> <a href=\"javascript:void(0)\" title=\"Switch project\""); |
---|
269 | fillText.append(" onclick=\"Menu.toggleTopMenu(document.getElementById('projects'), event.clientX-100, event.clientY); event.cancelBubble = true;\">"); |
---|
270 | fillText.append(activeProject == null ? "<i>- none -</i>" : HTML.encodeTags(activeProject.getName())); |
---|
271 | fillText.append(" <img src=\""+root+"images/sort_asc.gif\" border=\"0\"></a><span class=\"menuseparator\"> </span>"); |
---|
272 | |
---|
273 | User user = User.getById(dc, sc.getLoggedInUserId()); |
---|
274 | String userPrompt = sc.isImpersonated() ? "Impersonated" : "User"; |
---|
275 | fillText.append("<img src=\""+root+"images/take_ownership.png\" border=\"0\"> <a href=\"javascript:void(0)\" title=\"Switch user/logout\""); |
---|
276 | fillText.append(" onclick=\"javascript:Menu.toggleTopMenu(document.getElementById('switchuser'), event.clientX-100, event.clientY); event.cancelBubble = true;\">"); |
---|
277 | fillText.append(HTML.encodeTags(user.getLogin())); |
---|
278 | fillText.append(" (").append(user.getName()).append(") <img src=\""+root+"images/sort_asc.gif\" border=\"0\"></a>"); |
---|
279 | %> |
---|
280 | <% |
---|
281 | // Permission settings |
---|
282 | final boolean hasFiles = !sc.hasPermission(Permission.DENIED, Item.FILE); |
---|
283 | final boolean createFiles = sc.hasPermission(Permission.CREATE, Item.FILE); |
---|
284 | |
---|
285 | final boolean hasProjects = !sc.hasPermission(Permission.DENIED, Item.PROJECT); |
---|
286 | final boolean createProjects = sc.hasPermission(Permission.CREATE, Item.PROJECT); |
---|
287 | |
---|
288 | final boolean hasMessages = !sc.hasPermission(Permission.DENIED, Item.MESSAGE); |
---|
289 | final boolean createMessages = sc.hasPermission(Permission.CREATE, Item.MESSAGE); |
---|
290 | |
---|
291 | final boolean hasLabels = !sc.hasPermission(Permission.DENIED, Item.LABEL); |
---|
292 | final boolean createLabels = sc.hasPermission(Permission.CREATE, Item.LABEL); |
---|
293 | |
---|
294 | final boolean hasBioSources = !sc.hasPermission(Permission.DENIED, Item.BIOSOURCE); |
---|
295 | final boolean createBioSources = sc.hasPermission(Permission.CREATE, Item.BIOSOURCE); |
---|
296 | |
---|
297 | final boolean hasSamples = !sc.hasPermission(Permission.DENIED, Item.SAMPLE); |
---|
298 | final boolean createSamples = sc.hasPermission(Permission.CREATE, Item.SAMPLE); |
---|
299 | |
---|
300 | final boolean hasExtracts = !sc.hasPermission(Permission.DENIED, Item.EXTRACT); |
---|
301 | final boolean createExtracts = sc.hasPermission(Permission.CREATE, Item.EXTRACT); |
---|
302 | |
---|
303 | final boolean hasLabeledExtracts = !sc.hasPermission(Permission.DENIED, Item.LABELEDEXTRACT); |
---|
304 | final boolean createLabeledExtracts = sc.hasPermission(Permission.CREATE, Item.LABELEDEXTRACT); |
---|
305 | |
---|
306 | final boolean hasHybridizations = !sc.hasPermission(Permission.DENIED, Item.HYBRIDIZATION); |
---|
307 | final boolean createHybridizations = sc.hasPermission(Permission.CREATE, Item.HYBRIDIZATION); |
---|
308 | |
---|
309 | final boolean hasScans = !sc.hasPermission(Permission.DENIED, Item.SCAN); |
---|
310 | final boolean createScans = sc.hasPermission(Permission.CREATE, Item.SCAN); |
---|
311 | final boolean hasRawBioAssays = !sc.hasPermission(Permission.DENIED, Item.RAWBIOASSAY); |
---|
312 | final boolean createRawBioAssays = sc.hasPermission(Permission.CREATE, Item.RAWBIOASSAY); |
---|
313 | final boolean hasExperiments = !sc.hasPermission(Permission.DENIED, Item.EXPERIMENT); |
---|
314 | final boolean createExperiments = sc.hasPermission(Permission.CREATE, Item.EXPERIMENT); |
---|
315 | final boolean hasFormulas = !sc.hasPermission(Permission.DENIED, Item.FORMULA); |
---|
316 | final boolean createFormulas = sc.hasPermission(Permission.CREATE, Item.FORMULA); |
---|
317 | |
---|
318 | final boolean hasReporters = !sc.hasPermission(Permission.DENIED, Item.REPORTER); |
---|
319 | final boolean hasReporterLists = !sc.hasPermission(Permission.DENIED, Item.REPORTERLIST); |
---|
320 | final boolean createReporters = sc.hasPermission(Permission.CREATE, Item.REPORTER); |
---|
321 | final boolean hasJobs = !sc.hasPermission(Permission.DENIED, Item.JOB); |
---|
322 | final boolean hasSessions = !sc.hasPermission(Permission.DENIED, Item.SESSION); |
---|
323 | %> |
---|
324 | <m:menu |
---|
325 | id="view" |
---|
326 | style="display: none" |
---|
327 | > |
---|
328 | <m:menuitem |
---|
329 | title="Home" |
---|
330 | onclick="<%="Menu.openUrl('"+root+"my_base/index.jsp?ID="+ID+"')"%>" |
---|
331 | /> |
---|
332 | <m:menuitem |
---|
333 | title="All items" |
---|
334 | tooltip="View all items that you are the owner of" |
---|
335 | onclick="<%="Menu.openUrl('"+root+"views/items/index.jsp?ID="+ID+"')"%>" |
---|
336 | /> |
---|
337 | <m:menuitem |
---|
338 | title="Trashcan" |
---|
339 | tooltip="View all items that have been marked for deletion" |
---|
340 | onclick="<%="Menu.openUrl('"+root+"views/trashcan/index.jsp?ID="+ID+"')"%>" |
---|
341 | /> |
---|
342 | <m:menuseparator /> |
---|
343 | <m:menuitem |
---|
344 | title="Files" |
---|
345 | onclick="<%="Menu.openUrl('"+root+"filemanager/index.jsp?ID="+ID+"')"%>" |
---|
346 | tooltip="<%=hasFiles ? "Manage files" : "You do not have permission to manage files"%>" |
---|
347 | enabled="<%=hasFiles%>" |
---|
348 | /> |
---|
349 | <m:menuitem |
---|
350 | title="Projects" |
---|
351 | onclick="<%="Menu.openUrl('"+root+"my_base/projects/index.jsp?ID="+ID+"')"%>" |
---|
352 | tooltip="Manage projects" |
---|
353 | enabled="<%=hasProjects%>" |
---|
354 | /> |
---|
355 | <m:menuitem |
---|
356 | title="Messages" |
---|
357 | onclick="<%="Menu.openUrl('"+root+"my_base/messages/index.jsp?ID="+ID+"')"%>" |
---|
358 | tooltip="<%=hasMessages ? "Read your messages" : "You do not have permission to read messages"%>" |
---|
359 | enabled="<%=hasMessages%>" |
---|
360 | /> |
---|
361 | <m:menuitem |
---|
362 | title="Jobs" |
---|
363 | onclick="<%="Menu.openUrl('"+root+"views/jobs/index.jsp?ID="+ID+"')"%>" |
---|
364 | tooltip="<%=hasJobs ? "Check the status of your jobs" : "You do not have permission to access jobs"%>" |
---|
365 | enabled="<%=hasJobs%>" |
---|
366 | /> |
---|
367 | <m:menuitem |
---|
368 | title="Sessions" |
---|
369 | onclick="<%="Menu.openUrl('"+root+"views/sessions/index.jsp?ID="+ID+"')"%>" |
---|
370 | tooltip="<%=hasSessions ? "Check you login sessions" : "You do not have permission to access sessions"%>" |
---|
371 | enabled="<%=hasSessions%>" |
---|
372 | /> |
---|
373 | <m:menuseparator /> |
---|
374 | <m:menuitem |
---|
375 | title="Biosources" |
---|
376 | onclick="<%="Menu.openUrl('"+root+"biomaterials/biosources/index.jsp?ID="+ID+"')"%>" |
---|
377 | tooltip="<%=hasBioSources ? "Manage biosources" : "You do not have permission to manage biosources"%>" |
---|
378 | enabled="<%=hasBioSources%>" |
---|
379 | /> |
---|
380 | <m:menuitem |
---|
381 | title="Samples" |
---|
382 | onclick="<%="Menu.openUrl('"+root+"biomaterials/samples/index.jsp?ID="+ID+"')"%>" |
---|
383 | tooltip="<%=hasSamples ? "Manage samples" : "You do not have permission to manage samples"%>" |
---|
384 | enabled="<%=hasSamples%>" |
---|
385 | /> |
---|
386 | <m:menuitem |
---|
387 | title="Extracts" |
---|
388 | onclick="<%="Menu.openUrl('"+root+"biomaterials/extracts/index.jsp?ID="+ID+"')"%>" |
---|
389 | tooltip="<%=hasExtracts ? "Manage extracts" : "You do not have permission to manage extracts"%>" |
---|
390 | enabled="<%=hasExtracts%>" |
---|
391 | /> |
---|
392 | <m:menuitem |
---|
393 | title="Labeled extracts" |
---|
394 | onclick="<%="Menu.openUrl('"+root+"biomaterials/labeledextracts/index.jsp?ID="+ID+"')"%>" |
---|
395 | tooltip="<%=hasLabeledExtracts ? "Manage labeled extracts" : "You do not have permission to manage labeled extracts"%>" |
---|
396 | enabled="<%=hasLabeledExtracts%>" |
---|
397 | /> |
---|
398 | <m:menuitem |
---|
399 | title="Labels" |
---|
400 | onclick="<%="Menu.openUrl('"+root+"biomaterials/labels/index.jsp?ID="+ID+"')"%>" |
---|
401 | tooltip="<%=hasLabels ? "Manage labels" : "You do not have permission to manage labels"%>" |
---|
402 | enabled="<%=hasLabels%>" |
---|
403 | /> |
---|
404 | <m:menuseparator /> |
---|
405 | <m:menuitem |
---|
406 | title="Hybridizations" |
---|
407 | onclick="<%="Menu.openUrl('"+root+"views/hybridizations/index.jsp?ID="+ID+"')"%>" |
---|
408 | tooltip="<%=hasHybridizations ? "Manage hybridizations" : "You do not have permission to manage hybridizations"%>" |
---|
409 | enabled="<%=hasHybridizations%>" |
---|
410 | /> |
---|
411 | <m:menuitem |
---|
412 | title="Scans" |
---|
413 | onclick="<%="Menu.openUrl('"+root+"views/scans/index.jsp?ID="+ID+"')"%>" |
---|
414 | tooltip="<%=hasScans ? "Manage scans" : "You do not have permission to manage scans"%>" |
---|
415 | enabled="<%=hasScans%>" |
---|
416 | /> |
---|
417 | <m:menuitem |
---|
418 | title="Raw bioassays" |
---|
419 | onclick="<%="Menu.openUrl('"+root+"views/rawbioassays/index.jsp?ID="+ID+"')"%>" |
---|
420 | tooltip="<%=hasRawBioAssays ? "Manage raw bioassays" : "You do not have permission to manage raw bioassays"%>" |
---|
421 | enabled="<%=hasRawBioAssays%>" |
---|
422 | /> |
---|
423 | <m:menuitem |
---|
424 | title="Experiments" |
---|
425 | onclick="<%="Menu.openUrl('"+root+"views/experiments/index.jsp?ID="+ID+"')"%>" |
---|
426 | tooltip="<%=hasExperiments ? "Manage experiments" : "You do not have permission to manage experiments"%>" |
---|
427 | enabled="<%=hasExperiments%>" |
---|
428 | /> |
---|
429 | <m:menuitem |
---|
430 | title="Formulas" |
---|
431 | onclick="<%="Menu.openUrl('"+root+"views/formulas/index.jsp?ID="+ID+"')"%>" |
---|
432 | tooltip="<%=hasFormulas ? "Manage formulas" : "You do not have permission to manage formulas"%>" |
---|
433 | enabled="<%=hasFormulas%>" |
---|
434 | /> |
---|
435 | <m:menuseparator /> |
---|
436 | <m:menuitem |
---|
437 | title="Reporters" |
---|
438 | onclick="<%="Menu.openUrl('"+root+"views/reporters/index.jsp?ID="+ID+"')"%>" |
---|
439 | tooltip="<%=hasReporters ? "Manage reporters" : "You do not have permission to manage reporters"%>" |
---|
440 | enabled="<%=hasReporters%>" |
---|
441 | /> |
---|
442 | <m:menuitem |
---|
443 | title="Reporter lists" |
---|
444 | onclick="<%="Menu.openUrl('"+root+"views/reporterlists/index.jsp?ID="+ID+"')"%>" |
---|
445 | tooltip="<%=hasReporterLists ? "Manage reporter lists" : "You do not have permission to manage reporter lists"%>" |
---|
446 | enabled="<%=hasReporterLists%>" |
---|
447 | /> |
---|
448 | |
---|
449 | </m:menu> |
---|
450 | |
---|
451 | |
---|
452 | <m:menu |
---|
453 | id="file" |
---|
454 | style="display: none" |
---|
455 | > |
---|
456 | <m:submenu |
---|
457 | subid="projects" |
---|
458 | title="Select project" |
---|
459 | enabled="<%=hasProjects%>" |
---|
460 | /> |
---|
461 | <m:menuseparator /> |
---|
462 | <m:menuitem |
---|
463 | title="Contact information…" |
---|
464 | onclick="<%="Main.openPopup('"+root+"my_base/user/settings.jsp?ID="+ID+"&page=contact', 'Settings', 500, 360);"%>" |
---|
465 | tooltip="Set your address, phone, email, etc." |
---|
466 | /> |
---|
467 | <m:menuitem |
---|
468 | title="Change password…" |
---|
469 | onclick="<%="Main.openPopup('"+root+"my_base/user/settings.jsp?ID="+ID+"&page=password', 'Settings', 500, 360);"%>" |
---|
470 | tooltip="Set your password" |
---|
471 | /> |
---|
472 | <m:menuitem |
---|
473 | title="Other information…" |
---|
474 | onclick="<%="Main.openPopup('"+root+"my_base/user/settings.jsp?ID="+ID+"&page=other', 'Settings', 500, 360);"%>" |
---|
475 | tooltip="Other user-related information" |
---|
476 | /> |
---|
477 | <m:menuseparator /> |
---|
478 | <m:menuitem |
---|
479 | title="Preferences…" |
---|
480 | onclick="<%="Main.openPopup('"+root+"my_base/user/preferences.jsp?ID="+ID+"', 'Preferences', 500, 400);"%>" |
---|
481 | tooltip="Change font sizes, etc." |
---|
482 | /> |
---|
483 | <m:menuitem |
---|
484 | title="Reload permissions" |
---|
485 | onclick="<%="Main.openPopup('"+root+"my_base/user/submit_user.jsp?ID="+ID+"&cmd=ReloadPermissions', 'ReloadPermissions', 300, 200);"%>" |
---|
486 | tooltip="Reload permissions" |
---|
487 | /> |
---|
488 | <m:menuseparator /> |
---|
489 | <m:menuitem |
---|
490 | title="Logout…" |
---|
491 | onclick="<%="Main.openPopup('"+root+"logout.jsp?ID="+ID+"', 'Logout', 360, 200);"%>" |
---|
492 | tooltip="Exit from BASE" |
---|
493 | /> |
---|
494 | </m:menu> |
---|
495 | <% |
---|
496 | // Projects menu |
---|
497 | int activeProjectId = sc.getActiveProjectId(); |
---|
498 | final ItemQuery<Project> projectQuery = Project.getQuery(); |
---|
499 | projectQuery.include(Include.MINE, Include.SHARED); |
---|
500 | projectQuery.order(Orders.asc(Hql.property("name"))); |
---|
501 | projectQuery.setCacheResult(true); |
---|
502 | %> |
---|
503 | <m:menu |
---|
504 | id="projects" |
---|
505 | style="display: none" |
---|
506 | > |
---|
507 | <m:menuitem |
---|
508 | title="<i>- no active project -</i>" |
---|
509 | onclick="<%="Main.openPopup('"+root+"my_base/projects/set_active.jsp?ID="+ID+"', 'ActivateProject', 300, 140)"%>" |
---|
510 | icon="<%=activeProjectId == 0 ? "checkedmenu.gif" : null%>" |
---|
511 | enabled="<%=activeProjectId != 0%>" |
---|
512 | tooltip="<%=activeProjectId == 0 ? "No project is active" : "Disable the currently active project"%>" |
---|
513 | /> |
---|
514 | <% |
---|
515 | projects = projectQuery.list(dc); |
---|
516 | for (Project p : projects) |
---|
517 | { |
---|
518 | int projectId = p.getId(); |
---|
519 | boolean active = activeProjectId == projectId; |
---|
520 | %> |
---|
521 | <m:menuitem |
---|
522 | title="<%=HTML.encodeTags(p.getName())%>" |
---|
523 | style="<%=active ? "color: #000000; font-weight: bold;" : null %>" |
---|
524 | onclick="<%="Main.openPopup('"+root+"my_base/projects/set_active.jsp?ID="+ID+"&project_id="+p.getId()+"', 'ActivateProject', 300, 140)"%>" |
---|
525 | icon="<%=active ? "checkedmenu.gif" : null%>" |
---|
526 | enabled="<%=!active%>" |
---|
527 | tooltip="<%=active ? "This is the active project" : "Set this project to the active project"%>" |
---|
528 | /> |
---|
529 | <% |
---|
530 | } |
---|
531 | %> |
---|
532 | </m:menu> |
---|
533 | |
---|
534 | <% |
---|
535 | // Array LIMS - menu |
---|
536 | final boolean hasPlateGeometries = sc.hasPermission(Permission.READ, Item.PLATEGEOMETRY); |
---|
537 | final boolean hasPlateTypes = !sc.hasPermission(Permission.DENIED, Item.PLATETYPE); |
---|
538 | final boolean hasPlates = !sc.hasPermission(Permission.DENIED, Item.PLATE); |
---|
539 | final boolean hasPlateMappings = !sc.hasPermission(Permission.DENIED, Item.PLATEMAPPING); |
---|
540 | final boolean hasArraySlides = !sc.hasPermission(Permission.DENIED, Item.ARRAYSLIDE); |
---|
541 | final boolean hasArrayBatches = !sc.hasPermission(Permission.DENIED, Item.ARRAYBATCH); |
---|
542 | final boolean hasArrayDesigns = !sc.hasPermission(Permission.DENIED, Item.ARRAYDESIGN); |
---|
543 | final boolean hasLims = hasPlateGeometries || hasPlateTypes || hasPlates || hasPlateMappings || |
---|
544 | hasArraySlides || hasArrayBatches || hasArrayDesigns; |
---|
545 | if (hasLims) |
---|
546 | { |
---|
547 | %> |
---|
548 | <m:menu |
---|
549 | id="lims" |
---|
550 | style="display: none" |
---|
551 | > |
---|
552 | <m:menuitem |
---|
553 | title="Plate geometries" |
---|
554 | onclick="<%="Menu.openUrl('"+root+"lims/geometries/index.jsp?ID="+ID+"')"%>" |
---|
555 | tooltip="<%=hasPlateGeometries ? "Manage plate geometries" : "You do not have permission to manage plate geometries"%>" |
---|
556 | enabled="<%=hasPlateGeometries%>" |
---|
557 | /> |
---|
558 | <m:menuitem |
---|
559 | title="Plate types" |
---|
560 | onclick="<%="Menu.openUrl('"+root+"lims/platetypes/index.jsp?ID="+ID+"')"%>" |
---|
561 | tooltip="<%=hasPlateTypes ? "Manage plate types" : "You do not have permission to manage plate types"%>" |
---|
562 | enabled="<%=hasPlateTypes%>" |
---|
563 | /> |
---|
564 | <m:menuitem |
---|
565 | title="Plates" |
---|
566 | onclick="<%="Menu.openUrl('"+root+"lims/plates/index.jsp?ID="+ID+"')"%>" |
---|
567 | tooltip="<%=hasPlates ? "Manage plates" : "You do not have permission to manage plates"%>" |
---|
568 | enabled="<%=hasPlates%>" |
---|
569 | /> |
---|
570 | <m:menuitem |
---|
571 | title="Plate mappings" |
---|
572 | onclick="<%="Menu.openUrl('"+root+"lims/platemappings/index.jsp?ID="+ID+"')"%>" |
---|
573 | tooltip="<%=hasPlateTypes ? "Manage plate mappings" : "You do not have permission to manage plate mappings"%>" |
---|
574 | enabled="<%=hasPlateTypes%>" |
---|
575 | /> |
---|
576 | <m:menuseparator /> |
---|
577 | <m:menuitem |
---|
578 | title="Array designs" |
---|
579 | onclick="<%="Menu.openUrl('"+root+"lims/arraydesigns/index.jsp?ID="+ID+"')"%>" |
---|
580 | tooltip="<%=hasArrayDesigns ? "Manage array designs" : "You do not have permission to manage array designs"%>" |
---|
581 | enabled="<%=hasArrayDesigns%>" |
---|
582 | /> |
---|
583 | <m:menuitem |
---|
584 | title="Array batches" |
---|
585 | onclick="<%="Menu.openUrl('"+root+"lims/arraybatches/index.jsp?ID="+ID+"')"%>" |
---|
586 | tooltip="<%=hasArrayBatches ? "Manage array batches" : "You do not have permission to manage array batches"%>" |
---|
587 | enabled="<%=hasArrayBatches%>" |
---|
588 | /> |
---|
589 | <m:menuitem |
---|
590 | title="Array slides" |
---|
591 | onclick="<%="Menu.openUrl('"+root+"lims/arrayslides/index.jsp?ID="+ID+"')"%>" |
---|
592 | tooltip="<%=hasArraySlides ? "Manage array slides" : "You do not have permission to manage array slides"%>" |
---|
593 | enabled="<%=hasArraySlides%>" |
---|
594 | /> |
---|
595 | </m:menu> |
---|
596 | <% |
---|
597 | } |
---|
598 | %> |
---|
599 | <% |
---|
600 | // Administrate -> Types menu |
---|
601 | final boolean hasQuotaTypes = sc.hasPermission(Permission.READ, Item.QUOTATYPE); |
---|
602 | final boolean hasProtocolTypes = sc.hasPermission(Permission.READ, Item.PROTOCOLTYPE); |
---|
603 | final boolean hasFileTypes = sc.hasPermission(Permission.READ, Item.FILETYPE); |
---|
604 | final boolean hasMimeTypes = sc.hasPermission(Permission.READ, Item.MIMETYPE); |
---|
605 | final boolean hasHardwareTypes = sc.hasPermission(Permission.READ, Item.HARDWARETYPE); |
---|
606 | final boolean hasSoftwareTypes = sc.hasPermission(Permission.READ, Item.SOFTWARETYPE); |
---|
607 | final boolean hasAnnotationTypeCategories = !sc.hasPermission(Permission.DENIED, Item.ANNOTATIONTYPECATEGORY); |
---|
608 | final boolean hasAnnotationTypes = !sc.hasPermission(Permission.DENIED, Item.ANNOTATIONTYPE); |
---|
609 | final boolean hasReporterTypes = !sc.hasPermission(Permission.DENIED, Item.REPORTERTYPE); |
---|
610 | final boolean hasExtraValueTypes = !sc.hasPermission(Permission.DENIED, Item.EXTRAVALUETYPE); |
---|
611 | final boolean hasTypes = hasFileTypes || hasProtocolTypes || hasMimeTypes || hasQuotaTypes || |
---|
612 | hasSoftwareTypes || hasHardwareTypes || hasAnnotationTypeCategories || hasAnnotationTypes || |
---|
613 | hasReporterTypes || hasExtraValueTypes; |
---|
614 | if (hasTypes) |
---|
615 | { |
---|
616 | %> |
---|
617 | <m:menu |
---|
618 | id="types" |
---|
619 | style="display: none" |
---|
620 | > |
---|
621 | <m:menuitem |
---|
622 | title="Quota types" |
---|
623 | onclick="<%="Menu.openUrl('"+root+"admin/quotatypes/index.jsp?ID="+ID+"')"%>" |
---|
624 | tooltip="<%=hasQuotaTypes ? "Administrate quota types" : "You do not have permission to administrate quota types"%>" |
---|
625 | enabled="<%=hasQuotaTypes%>" |
---|
626 | /> |
---|
627 | <m:menuitem |
---|
628 | title="Protocol types" |
---|
629 | onclick="<%="Menu.openUrl('"+root+"admin/protocoltypes/index.jsp?ID="+ID+"')"%>" |
---|
630 | tooltip="<%=hasProtocolTypes ? "Administrate protocol types" : "You do not have permission to administrate protocol types"%>" |
---|
631 | enabled="<%=hasProtocolTypes%>" |
---|
632 | /> |
---|
633 | <m:menuitem |
---|
634 | title="File types" |
---|
635 | onclick="<%="Menu.openUrl('"+root+"admin/filetypes/index.jsp?ID="+ID+"')"%>" |
---|
636 | tooltip="<%=hasFileTypes ? "Administrate file types" : "You do not have permission to administrate file types"%>" |
---|
637 | enabled="<%=hasFileTypes%>" |
---|
638 | /> |
---|
639 | <m:menuitem |
---|
640 | title="MIME types" |
---|
641 | onclick="<%="Menu.openUrl('"+root+"admin/mimetypes/index.jsp?ID="+ID+"')"%>" |
---|
642 | tooltip="<%=hasMimeTypes ? "Administrate MIME types" : "You do not have permission to administrate mime types"%>" |
---|
643 | enabled="<%=hasMimeTypes%>" |
---|
644 | /> |
---|
645 | <m:menuitem |
---|
646 | title="Software types" |
---|
647 | onclick="<%="Menu.openUrl('"+root+"admin/softwaretypes/index.jsp?ID="+ID+"')"%>" |
---|
648 | tooltip="<%=hasSoftwareTypes ? "Administrate software types" : "You do not have permission to administrate software types"%>" |
---|
649 | enabled="<%=hasSoftwareTypes%>" |
---|
650 | /> |
---|
651 | <m:menuitem |
---|
652 | title="Hardware types" |
---|
653 | onclick="<%="Menu.openUrl('"+root+"admin/hardwaretypes/index.jsp?ID="+ID+"')"%>" |
---|
654 | tooltip="<%=hasHardwareTypes ? "Administrate hardware types" : "You do not have permission to administrate hardware types"%>" |
---|
655 | enabled="<%=hasHardwareTypes%>" |
---|
656 | /> |
---|
657 | <m:menuitem |
---|
658 | title="Annotation type categories" |
---|
659 | onclick="<%="Menu.openUrl('"+root+"admin/annotationtypecategories/index.jsp?ID="+ID+"')"%>" |
---|
660 | tooltip="<%=hasAnnotationTypeCategories ? "Administrate annotation type categories" : "You do not have permission to administrate annotation types categories"%>" |
---|
661 | enabled="<%=hasAnnotationTypeCategories%>" |
---|
662 | /> |
---|
663 | <m:menuitem |
---|
664 | title="Annotation types" |
---|
665 | onclick="<%="Menu.openUrl('"+root+"admin/annotationtypes/index.jsp?ID="+ID+"')"%>" |
---|
666 | tooltip="<%=hasAnnotationTypes ? "Administrate annotation types" : "You do not have permission to administrate annotation types"%>" |
---|
667 | enabled="<%=hasAnnotationTypes%>" |
---|
668 | /> |
---|
669 | <m:menuitem |
---|
670 | title="Reporter types" |
---|
671 | onclick="<%="Menu.openUrl('"+root+"admin/reportertypes/index.jsp?ID="+ID+"')"%>" |
---|
672 | tooltip="<%=hasReporterTypes ? "Administrate reporter types" : "You do not have permission to administrate reporter types"%>" |
---|
673 | enabled="<%=hasReporterTypes%>" |
---|
674 | /> |
---|
675 | <m:menuitem |
---|
676 | title="Extra value types" |
---|
677 | onclick="<%="Menu.openUrl('"+root+"admin/extravaluetypes/index.jsp?ID="+ID+"')"%>" |
---|
678 | tooltip="<%=hasExtraValueTypes ? "Administrate extra value types" : "You do not have permission to administrate extra value types"%>" |
---|
679 | enabled="<%=hasExtraValueTypes%>" |
---|
680 | /> |
---|
681 | </m:menu> |
---|
682 | <% |
---|
683 | } |
---|
684 | %> |
---|
685 | <% |
---|
686 | // Administrate -> Platforms menu |
---|
687 | final boolean hasPlatforms = sc.hasPermission(Permission.READ, Item.PLATFORM); |
---|
688 | final boolean hasFileSetMemberTypes = sc.hasPermission(Permission.READ, Item.DATAFILETYPE); |
---|
689 | final boolean hasTopPlatforms = hasPlatforms || hasFileSetMemberTypes; |
---|
690 | if (hasTopPlatforms) |
---|
691 | { |
---|
692 | %> |
---|
693 | <m:menu |
---|
694 | id="platforms" |
---|
695 | style="display: none" |
---|
696 | > |
---|
697 | <m:menuitem |
---|
698 | title="Experimental platforms" |
---|
699 | onclick="<%="Menu.openUrl('"+root+"admin/platforms/index.jsp?ID="+ID+"')"%>" |
---|
700 | tooltip="<%=hasPlatforms ? "Administrate experimental platforms" : "You do not have permission to administrate experimental platforms"%>" |
---|
701 | enabled="<%=hasPlatforms%>" |
---|
702 | /> |
---|
703 | <m:menuitem |
---|
704 | title="Data file types" |
---|
705 | onclick="<%="Menu.openUrl('"+root+"admin/datafiletypes/index.jsp?ID="+ID+"')"%>" |
---|
706 | tooltip="<%=hasFileSetMemberTypes ? "Administrate data file types" : "You do not have permission to administrate data file types"%>" |
---|
707 | enabled="<%=hasFileSetMemberTypes%>" |
---|
708 | /> |
---|
709 | </m:menu> |
---|
710 | <% |
---|
711 | } |
---|
712 | %> |
---|
713 | |
---|
714 | <% |
---|
715 | // Plugins menu |
---|
716 | final boolean hasPluginTypes = !sc.hasPermission(Permission.DENIED, Item.PLUGINTYPE); |
---|
717 | final boolean hasPluginDefinitions = !sc.hasPermission(Permission.DENIED, Item.PLUGINDEFINITION); |
---|
718 | final boolean hasPluginConfigurations = !sc.hasPermission(Permission.DENIED, Item.PLUGINCONFIGURATION); |
---|
719 | final boolean hasJobAgents = sc.hasPermission(Permission.READ, Item.JOBAGENT); |
---|
720 | final boolean hasPlugins = hasPluginTypes || hasPluginDefinitions || |
---|
721 | hasPluginConfigurations || hasJobAgents; |
---|
722 | |
---|
723 | if (hasPlugins) |
---|
724 | { |
---|
725 | %> |
---|
726 | <m:menu |
---|
727 | id="plugins" |
---|
728 | style="display: none" |
---|
729 | > |
---|
730 | <m:menuitem |
---|
731 | title="Types" |
---|
732 | onclick="<%="Menu.openUrl('"+root+"admin/plugintypes/index.jsp?ID="+ID+"')"%>" |
---|
733 | tooltip="<%=hasPluginDefinitions ? "Administrate plugin types" : "You do not have permission to administrate plugin types"%>" |
---|
734 | enabled="<%=hasPluginTypes%>" |
---|
735 | /> |
---|
736 | <m:menuitem |
---|
737 | title="Definitions" |
---|
738 | onclick="<%="Menu.openUrl('"+root+"admin/plugindefinitions/index.jsp?ID="+ID+"')"%>" |
---|
739 | tooltip="<%=hasPluginDefinitions ? "Administrate plugin definitions" : "You do not have permission to administrate plugin definitions"%>" |
---|
740 | enabled="<%=hasPluginDefinitions%>" |
---|
741 | /> |
---|
742 | <m:menuitem |
---|
743 | title="Configurations" |
---|
744 | onclick="<%="Menu.openUrl('"+root+"admin/pluginconfigurations/index.jsp?ID="+ID+"')"%>" |
---|
745 | tooltip="<%=hasPluginConfigurations ? "Administrate plugin configurations" : "You do not have permission to administrate plugin configurations"%>" |
---|
746 | enabled="<%=hasPluginConfigurations%>" |
---|
747 | /> |
---|
748 | <m:menuseparator /> |
---|
749 | <m:menuitem |
---|
750 | title="Job agents" |
---|
751 | onclick="<%="Menu.openUrl('"+root+"admin/jobagents/index.jsp?ID="+ID+"')"%>" |
---|
752 | tooltip="<%=hasJobAgents ? "Administrate job agents" : "You do not have permission to administrate job agents"%>" |
---|
753 | enabled="<%=hasJobAgents%>" |
---|
754 | /> |
---|
755 | </m:menu> |
---|
756 | <% |
---|
757 | } |
---|
758 | %> |
---|
759 | |
---|
760 | <% |
---|
761 | // Administrate menu |
---|
762 | final boolean hasUsers = sc.hasPermission(Permission.READ, Item.USER); |
---|
763 | final boolean hasGroups = sc.hasPermission(Permission.READ, Item.GROUP); |
---|
764 | final boolean hasRoles = sc.hasPermission(Permission.READ, Item.ROLE); |
---|
765 | final boolean hasQuota = sc.hasPermission(Permission.READ, Item.QUOTA); |
---|
766 | final boolean hasSoftware = !sc.hasPermission(Permission.DENIED, Item.SOFTWARE); |
---|
767 | final boolean hasHardware = !sc.hasPermission(Permission.DENIED, Item.HARDWARE); |
---|
768 | final boolean hasProtocols = !sc.hasPermission(Permission.DENIED, Item.PROTOCOL); |
---|
769 | final boolean hasClients = sc.hasPermission(Permission.READ, Item.CLIENT); |
---|
770 | final boolean hasNews = sc.hasPermission(Permission.READ, Item.NEWS); |
---|
771 | final boolean hasDiskUsage = sc.hasPermission(Permission.READ, Item.DISKUSAGE); |
---|
772 | final Client currentClient = Client.getById(dc, sc.getClientId()); |
---|
773 | final boolean hasServer = currentClient.hasPermission(Permission.WRITE); |
---|
774 | |
---|
775 | final boolean hasAdministrate = |
---|
776 | hasUsers || hasGroups || hasRoles || hasQuota || hasTypes || hasPlugins || |
---|
777 | hasSoftware || hasHardware || hasProtocols || hasClients || hasNews || |
---|
778 | hasDiskUsage || hasServer || hasTopPlatforms; |
---|
779 | |
---|
780 | if (hasAdministrate) |
---|
781 | { |
---|
782 | %> |
---|
783 | <m:menu |
---|
784 | id="administrate" |
---|
785 | style="display: none" |
---|
786 | > |
---|
787 | <m:menuitem |
---|
788 | title="Users" |
---|
789 | onclick="<%="Menu.openUrl('"+root+"admin/users/index.jsp?ID="+ID+"')"%>" |
---|
790 | tooltip="<%=hasUsers ? "Administrate users" : "You do not have permission to administrate users"%>" |
---|
791 | enabled="<%=hasUsers%>" |
---|
792 | /> |
---|
793 | <m:menuitem |
---|
794 | title="Groups" |
---|
795 | onclick="<%="Menu.openUrl('"+root+"admin/groups/index.jsp?ID="+ID+"')"%>" |
---|
796 | tooltip="<%=hasGroups ? "Administrate groups" : "You do not have permission to administrate groups"%>" |
---|
797 | enabled="<%=hasGroups%>" |
---|
798 | /> |
---|
799 | <m:menuitem |
---|
800 | title="Roles" |
---|
801 | onclick="<%="Menu.openUrl('"+root+"admin/roles/index.jsp?ID="+ID+"')"%>" |
---|
802 | tooltip="<%=hasRoles ? "Administrate roles" : "You do not have permission to administrate roles"%>" |
---|
803 | enabled="<%=hasRoles%>" |
---|
804 | /> |
---|
805 | <m:menuseparator /> |
---|
806 | <m:submenu |
---|
807 | subid="plugins" |
---|
808 | title="Plugins" |
---|
809 | tooltip="Administrate plugin definitions and configurations" |
---|
810 | enabled="<%=hasPlugins%>" |
---|
811 | /> |
---|
812 | <m:menuseparator /> |
---|
813 | <m:menuitem |
---|
814 | title="Quota" |
---|
815 | onclick="<%="Menu.openUrl('"+root+"admin/quota/index.jsp?ID="+ID+"')"%>" |
---|
816 | tooltip="<%=hasQuota ? "Administrate quota" : "You do not have permission to administrate quota"%>" |
---|
817 | enabled="<%=hasQuota%>" |
---|
818 | /> |
---|
819 | <m:menuitem |
---|
820 | title="Software" |
---|
821 | onclick="<%="Menu.openUrl('"+root+"admin/software/index.jsp?ID="+ID+"')"%>" |
---|
822 | tooltip="<%=hasSoftware ? "Administrate software" : "You do not have permission to administrate software"%>" |
---|
823 | enabled="<%=hasSoftware%>" |
---|
824 | /> |
---|
825 | <m:menuitem |
---|
826 | title="Hardware" |
---|
827 | onclick="<%="Menu.openUrl('"+root+"admin/hardware/index.jsp?ID="+ID+"')"%>" |
---|
828 | tooltip="<%=hasHardware ? "Administrate hardware" : "You do not have permission to administrate hardware"%>" |
---|
829 | enabled="<%=hasHardware%>" |
---|
830 | /> |
---|
831 | <m:menuitem |
---|
832 | title="Protocols" |
---|
833 | onclick="<%="Menu.openUrl('"+root+"admin/protocols/index.jsp?ID="+ID+"')"%>" |
---|
834 | tooltip="<%=hasProtocols ? "Administrate protocols" : "You do not have permission to administrate protocols"%>" |
---|
835 | enabled="<%=hasProtocols%>" |
---|
836 | /> |
---|
837 | <m:menuitem |
---|
838 | title="Clients" |
---|
839 | onclick="<%="Menu.openUrl('"+root+"admin/clients/index.jsp?ID="+ID+"')"%>" |
---|
840 | tooltip="<%=hasClients ? "Administrate client applications" : "You do not have permission to administrate client applications"%>" |
---|
841 | enabled="<%=hasClients%>" |
---|
842 | /> |
---|
843 | <m:menuitem |
---|
844 | title="News" |
---|
845 | onclick="<%="Menu.openUrl('"+root+"admin/news/index.jsp?ID="+ID+"')"%>" |
---|
846 | tooltip="<%=hasNews ? "Administrate news" : "You do not have permission to administrate news"%>" |
---|
847 | enabled="<%=hasNews%>" |
---|
848 | /> |
---|
849 | <m:menuseparator /> |
---|
850 | <m:submenu |
---|
851 | subid="platforms" |
---|
852 | title="Platforms" |
---|
853 | tooltip="Administrate experimental platforms" |
---|
854 | enabled="<%=hasTopPlatforms%>" |
---|
855 | /> |
---|
856 | <m:submenu |
---|
857 | subid="types" |
---|
858 | title="Types" |
---|
859 | tooltip="Administrate quota, file, hardware and software types" |
---|
860 | enabled="<%=hasTypes%>" |
---|
861 | /> |
---|
862 | <m:menuseparator /> |
---|
863 | <m:menuitem |
---|
864 | title="Disk usage" |
---|
865 | onclick="<%="Menu.openUrl('"+root+"admin/diskusage/index.jsp?ID="+ID+"')"%>" |
---|
866 | tooltip="<%=hasDiskUsage ? "Check disk usage" : "You do not have permission to check disk usage"%>" |
---|
867 | enabled="<%=hasDiskUsage%>" |
---|
868 | /> |
---|
869 | <m:menuitem |
---|
870 | title="Server settings…" |
---|
871 | onclick="<%="Main.openPopup('"+root+"admin/server/configure.jsp?ID="+ID+"', 'ServerSettings', 500, 400);"%>" |
---|
872 | tooltip="<%=hasServer ? "Configure the server" : "You do not have permission to configure the server"%>" |
---|
873 | enabled="<%=hasServer%>" |
---|
874 | /> |
---|
875 | <m:menuitem |
---|
876 | title="Restart BASE…" |
---|
877 | onclick="<%="Main.openPopup('"+root+"admin/server/restart.jsp?ID="+ID+"', 'RestartServer', 360, 200);"%>" |
---|
878 | tooltip="<%=hasServer ? "Restart the server" : "You do not have permission to restart the server"%>" |
---|
879 | enabled="<%=hasServer%>" |
---|
880 | /> |
---|
881 | </m:menu> |
---|
882 | <% |
---|
883 | } |
---|
884 | %> |
---|
885 | <% |
---|
886 | // Help menu |
---|
887 | final String helplink = Values.getStringOrNull(sc.getClientDefaultSetting("server.links.help")); |
---|
888 | final String faqlink = Values.getStringOrNull(sc.getClientDefaultSetting("server.links.faq")); |
---|
889 | final String reportbuglink = Values.getStringOrNull(sc.getClientDefaultSetting("server.links.reportbug")); |
---|
890 | %> |
---|
891 | <m:menu id="help" style="display: none"> |
---|
892 | <m:menuitem |
---|
893 | visible="<%=HTML.isValidUrl(helplink)%>" |
---|
894 | title="Help…" |
---|
895 | onclick="<%="window.open('"+helplink+"','Help')"%>" |
---|
896 | /> |
---|
897 | <m:menuitem |
---|
898 | visible="<%=HTML.isValidUrl(faqlink)%>" |
---|
899 | title="FAQ…" |
---|
900 | onclick="<%="window.open('"+faqlink+"','FAQ')"%>" |
---|
901 | /> |
---|
902 | <m:menuseparator /> |
---|
903 | |
---|
904 | <m:menuitem |
---|
905 | title="About…" |
---|
906 | onclick="<%="Main.openPopup('"+root+"info/about.jsp?ID="+ID+"&page=about', 'About', 500, 350)"%>" |
---|
907 | /> |
---|
908 | |
---|
909 | <m:menuitem |
---|
910 | title="License…" |
---|
911 | onclick="<%="Main.openPopup('"+root+"info/about.jsp?ID="+ID+"&page=license', 'About', 500, 350)"%>" |
---|
912 | |
---|
913 | /> |
---|
914 | <m:menuitem |
---|
915 | visible="<%=HTML.isValidUrl(reportbuglink)%>" |
---|
916 | title="Report a bug…" |
---|
917 | onclick="<%="window.open('"+reportbuglink+"','Reportbug')"%>" |
---|
918 | /> |
---|
919 | <m:menuseparator /> |
---|
920 | <m:menuitem |
---|
921 | title="Base project site" onclick="<%="Menu.openUrl('http://base.thep.lu.se', 'basesite')"%>" |
---|
922 | /> |
---|
923 | </m:menu> |
---|
924 | |
---|
925 | <% |
---|
926 | //Switch user/logout menu |
---|
927 | final boolean hasImpersonate = |
---|
928 | !sc.isImpersonated() && sc.hasSystemPermission(Permission.ACT_AS_ANOTHER_USER); |
---|
929 | %> |
---|
930 | <m:menu |
---|
931 | id="switchuser" |
---|
932 | style="display: none;" |
---|
933 | > |
---|
934 | <m:menuitem |
---|
935 | title="Switch user…" |
---|
936 | onclick="<%="Main.openPopup('"+root+"switch.jsp?ID="+ID+"', 'Switch', 360, 200);"%>" |
---|
937 | tooltip="Login as another user" |
---|
938 | /> |
---|
939 | <m:menuitem |
---|
940 | title="Impersonate…" |
---|
941 | onclick="<%="Main.openPopup('"+root+"impersonate.jsp?ID="+ID+"', 'Impersonate', 480, 240);"%>" |
---|
942 | tooltip="Login as another user without knowing the password" |
---|
943 | visible="<%=hasImpersonate%>" |
---|
944 | /> |
---|
945 | <m:menuitem |
---|
946 | title="Logout…" |
---|
947 | onclick="<%="Main.openPopup('"+root+"logout.jsp?ID="+ID+"', 'Logout', 360, 200);"%>" |
---|
948 | tooltip="Exit from BASE" |
---|
949 | /> |
---|
950 | </m:menu> |
---|
951 | |
---|
952 | <% |
---|
953 | // Extensions menu |
---|
954 | JspContext context = new JspContext(sc); |
---|
955 | ExtensionsInvoker<MenuItemAction> invoker = |
---|
956 | (ExtensionsInvoker<MenuItemAction>)ExtensionsControl.useExtensions(context, |
---|
957 | "net.sf.basedb.clients.web.menu.extensions"); |
---|
958 | ExtensionsControl ec = ExtensionsControl.get(dc); |
---|
959 | ActionIterator<MenuItemAction> items = invoker.iterate(); |
---|
960 | boolean addSeparator = false; |
---|
961 | %> |
---|
962 | <m:menu id="extensions" style="display: none"> |
---|
963 | <% |
---|
964 | while (items.hasNext()) |
---|
965 | { |
---|
966 | MenuItemAction item = items.next(); |
---|
967 | Extension extension = items.getExtension(); |
---|
968 | if (item.getType() == MenuItemAction.MenuType.SEPARATOR) |
---|
969 | { |
---|
970 | addSeparator = false; |
---|
971 | %> |
---|
972 | <m:menuseparator style="<%=item.getStyle()%>" visible="<%=item.isVisible()%>" /> |
---|
973 | <% |
---|
974 | } |
---|
975 | else if (item.getType() == MenuItemAction.MenuType.MENUITEM) |
---|
976 | { |
---|
977 | addSeparator = true; |
---|
978 | %> |
---|
979 | <m:menuitem |
---|
980 | style="<%=item.getStyle()%>" |
---|
981 | title="<%=item.getTitle()%>" |
---|
982 | icon="<%=item.getIcon()%>" |
---|
983 | iconabsolute="true" |
---|
984 | tooltip="<%=item.getTooltip()%>" |
---|
985 | enabled="<%=item.isEnabled()%>" |
---|
986 | visible="<%=item.isVisible()%>" |
---|
987 | onclick="<%=item.getOnClick()%>" |
---|
988 | /> |
---|
989 | <% |
---|
990 | } |
---|
991 | } |
---|
992 | if (addSeparator) |
---|
993 | { |
---|
994 | %> |
---|
995 | <m:menuseparator /> |
---|
996 | <% |
---|
997 | } |
---|
998 | %> |
---|
999 | <m:menuitem |
---|
1000 | title="Installed extensions" |
---|
1001 | onclick="<%="Menu.openUrl('"+root+"admin/extensions/index.jsp?ID="+ID+"')"%>" |
---|
1002 | tooltip="Display and administrate installed extensions" |
---|
1003 | /> |
---|
1004 | <m:menuitem |
---|
1005 | title="Manual scan…" |
---|
1006 | onclick="<%="Main.openPopup('"+root+"admin/extensions/manual_scan.jsp?ID=" + ID + "', 'ManualScan', 500, 400);"%>" |
---|
1007 | enabled="<%=ec.hasPermission(Permission.WRITE)%>" |
---|
1008 | tooltip="Start a manual scan for new, updated and deleted extensions" |
---|
1009 | /> |
---|
1010 | </m:menu> |
---|
1011 | |
---|
1012 | <% |
---|
1013 | // Main menu |
---|
1014 | %> |
---|
1015 | <m:menu |
---|
1016 | type="horizontal" |
---|
1017 | clazz="menu_horizontal" |
---|
1018 | id="menubar" |
---|
1019 | style="top: 10px; left: 8px; width: 98%" |
---|
1020 | open="click" |
---|
1021 | filltext="<%=fillText.toString()%>" |
---|
1022 | > |
---|
1023 | |
---|
1024 | <m:submenu |
---|
1025 | subid="file" |
---|
1026 | title="File" |
---|
1027 | /> |
---|
1028 | <m:submenu |
---|
1029 | subid="view" |
---|
1030 | title="View" |
---|
1031 | /> |
---|
1032 | <m:submenu |
---|
1033 | subid="lims" |
---|
1034 | title="Array LIMS" |
---|
1035 | /> |
---|
1036 | <m:submenu |
---|
1037 | subid="administrate" |
---|
1038 | title="Administrate" |
---|
1039 | visible="<%=hasAdministrate%>" |
---|
1040 | /> |
---|
1041 | <m:submenu |
---|
1042 | subid="extensions" |
---|
1043 | title="Extensions" |
---|
1044 | /> |
---|
1045 | <m:submenu |
---|
1046 | subid="help" |
---|
1047 | title="Help" |
---|
1048 | /> |
---|
1049 | </m:menu> |
---|
1050 | <br><br> |
---|
1051 | <% |
---|
1052 | } |
---|
1053 | finally |
---|
1054 | { |
---|
1055 | if (dc != null) dc.close(); |
---|
1056 | } |
---|
1057 | |
---|
1058 | } |
---|
1059 | %> |
---|
1060 | |
---|
1061 | |
---|
1062 | |
---|