source: trunk/www/common/overview/overview.jsp @ 4830

Last change on this file since 4830 was 4830, checked in by Martin Svensson, 14 years ago

References #1240. Some adjustments on menuitems' tooltip- and cursor- behavior. The validate-toolbutton is decided to validate the whole tree and not only already loaded nodes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 5.0 KB
Line 
1<%-- $Id: overview.jsp 4830 2009-03-23 15:46:46Z martin $
2  ------------------------------------------------------------------
3  Copyright (C) 2009 Nicklas Nordborg
4
5  This file is part of BASE - BioArray Software Environment.
6  Available at http://base.thep.lu.se/
7
8  BASE is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License
10  as published by the Free Software Foundation; either version 3
11  of the License, or (at your option) any later version.
12
13  BASE is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with BASE. If not, see <http://www.gnu.org/licenses/>.
20  ------------------------------------------------------------------
21
22--%>
23<%@ page session="false"
24  import="net.sf.basedb.core.SessionControl"
25  import="net.sf.basedb.core.DbControl"
26  import="net.sf.basedb.core.Item"
27  import="net.sf.basedb.core.BasicItem"
28  import="net.sf.basedb.core.Permission"
29  import="net.sf.basedb.core.ItemContext"
30  import="net.sf.basedb.core.Project"
31  import="net.sf.basedb.util.Values"
32  import="net.sf.basedb.clients.web.Base"
33  import="net.sf.basedb.clients.web.util.HTML"
34  import="net.sf.basedb.util.overview.GenericOverview"
35  import="net.sf.basedb.util.overview.OverviewUtil"
36%>
37<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
38<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
39<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
40<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
41<%
42final Item itemType = Item.valueOf(request.getParameter("item_type"));
43final int itemId = Values.getInt(request.getParameter("item_id"));
44final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
45final String ID = sc.getId();
46final DbControl dc = null;
47final String root = request.getContextPath();
48try
49{
50  %>
51  <base:page type="include">
52  <base:body>
53    <script language="JavaScript">
54    var timer = 0;
55    var inCall = false;
56    function adjustIFrameSize()
57    {
58      if (inCall) return;
59      inCall = true;
60      var iframeElement = document.getElementById("idOverview");
61      // Find the top coordinate of the IFrame
62      var offsetTop = 10;
63      var offsetTrail = iframeElement;
64      while (offsetTrail)
65      {
66        offsetTop += offsetTrail.offsetTop;
67        offsetTrail = offsetTrail.offsetParent;
68      }
69 
70      // Find the browser window height
71      var windowHeight = Main.getWindowHeight();
72      iframeElement.height = windowHeight-offsetTop;
73 
74      // Adjust the height of the frames
75      var iframe = window.frames['overview'];
76      var tree = iframe.frames['tree'].document.getElementById('main');
77      if (tree) tree.style.height = (iframeElement.height-8)+'px';
78      var joust = iframe.frames['tree'].document.getElementById('joust');
79      if (joust) joust.style.height = (iframeElement.height-8)+'px';
80      var info = iframe.frames['info'].document.getElementById('main');
81      if (info) info.style.height = iframeElement.height+'px';
82      inCall = false;
83    }
84    function setTimer()
85    {
86      if (inCall) return;
87      if (timer) clearTimeout(timer);
88      timer = setTimeout('adjustIFrameSize()', 150);
89    }
90    function expandAll()
91    {
92      frames['overview']['tree'].openAll();
93    }
94    function collapseAll()
95    {
96      frames['overview']['tree'].closeAll();
97    }
98    function revalidate()
99    {
100      var url = '<%=root%>/common/overview/index.jsp?ID=<%=ID%>';
101      url += '&cmd=Revalidate';
102      url += '&item_type=<%=itemType.name()%>';
103      url += '&item_id=<%=itemId%>';
104      frames['overview'].location.href = url;
105    }
106    function validationOptions()
107    {
108      frames['overview'].Main.openPopup('<%=root%>/common/overview/options.jsp?ID=<%=ID%>', 'ValidationOptions', 700, 500);
109    }
110    if (window.addEventListener)
111    {
112      window.addEventListener('resize', setTimer, false);
113    }
114    else if (window.attachEvent)
115    {
116      window.attachEvent('onresize', setTimer);
117    }
118    </script>
119      <tbl:toolbar>
120        <tbl:button image="joust/plusonly.gif" title="Expand all"
121          onclick="expandAll()" tooltip="Expand entire tree"/>
122        <tbl:button image="joust/minusonly.gif" title="Collapse all" 
123          onclick="collapseAll()" tooltip="Collapse entire tree" />
124        <tbl:button image="refresh.gif" title="Validate" 
125          onclick="revalidate()" tooltip="Validate the whole tree" />
126        <tbl:button image="configure.png" title="Validation options&hellip;" 
127          onclick="validationOptions()" tooltip="Change validation options" />
128        <tbl:button image="help.gif" title="Help&hellip;"
129          onclick="<%="Main.openHelp('" + ID +"', 'item.overview')"%>"
130          tooltip="Get help about this page"
131        /> 
132      </tbl:toolbar>
133      <iframe name="overview" id="idOverview" 
134        src="<%=root%>/common/overview/index.jsp?ID=<%=ID%>&cmd=Overview&item_type=<%=itemType.name()%>&item_id=<%=itemId%>" 
135        frameborder="0" vspace="0" hspace="0"
136        marginwidth="0" marginheight="0" scrolling="no" 
137        style="width: 100%; border: 1px solid #999999; border-top: 0px; overflow: visible"></iframe>
138
139  </base:body>
140  </base:page>
141  <%
142}
143finally
144{
145  if (dc != null) dc.close();
146}
147%>
Note: See TracBrowser for help on using the repository browser.