source: trunk/www/views/experiments/overview/overview.jsp @ 3045

Last change on this file since 3045 was 3045, checked in by Nicklas Nordborg, 15 years ago

References #262 and #340. The overview and validation is now complete.
Still missing possibility to save validation options as presets.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 5.6 KB
Line 
1<%-- $Id: overview.jsp 3045 2006-12-20 14:37:29Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) Authors contributing to this file.
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 2
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 this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA  02111-1307, USA.
22  ------------------------------------------------------------------
23
24  @author Nicklas
25  @version 2.0
26--%>
27<%@ page session="false"
28  import="net.sf.basedb.core.SessionControl"
29  import="net.sf.basedb.core.DbControl"
30  import="net.sf.basedb.core.Item"
31  import="net.sf.basedb.core.Permission"
32  import="net.sf.basedb.core.ItemContext"
33  import="net.sf.basedb.core.Experiment"
34  import="net.sf.basedb.util.Values"
35  import="net.sf.basedb.clients.web.Base"
36  import="net.sf.basedb.clients.web.util.HTML"
37%>
38<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
39<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
40<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
41<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
42<%!
43  private static final Item itemType = Item.EXPERIMENT;
44%>
45<%
46final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
47final String ID = sc.getId();
48final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
49final int itemId = cc.getId();
50final DbControl dc = sc.newDbControl();
51try
52{
53  Experiment experiment = Experiment.getById(dc, itemId);
54  %>
55  <base:page title="">
56  <base:head scripts="tabcontrol.js" styles="toolbar.css,headertabcontrol.css,path.css">
57    <script language="JavaScript">
58    var timer = 0;
59    var inCall = false;
60    function adjustIFrameSize()
61    {
62      if (inCall) return;
63      inCall = true;
64      var iframeElement = document.getElementById("idOverview");
65      // Find the top coordinate of the IFrame
66      var offsetTop = 10;
67      var offsetTrail = iframeElement;
68      while (offsetTrail)
69      {
70        offsetTop += offsetTrail.offsetTop;
71        offsetTrail = offsetTrail.offsetParent;
72      }
73 
74      // Find the browser window height
75      var windowHeight = Main.getWindowHeight();
76      iframeElement.height = windowHeight-offsetTop;
77 
78      // Adjust the height of the frames
79      var iframe = window.frames['overview'];
80      var tree = iframe.frames['tree'].document.getElementById('main');
81      if (tree) tree.style.height = (iframeElement.height-8)+'px';
82      var joust = iframe.frames['tree'].document.getElementById('joust');
83      if (joust) joust.style.height = (iframeElement.height-8)+'px';
84      var info = iframe.frames['info'].document.getElementById('main');
85      if (info) info.style.height = iframeElement.height+'px';
86      inCall = false;
87    }
88    function setTimer()
89    {
90      if (inCall) return;
91      if (timer) clearTimeout(timer);
92      timer = setTimeout('adjustIFrameSize()', 150);
93    }
94    function viewExperimentProperties()
95    {
96      location.href = '../index.jsp?ID=<%=ID%>&item_id=<%=itemId%>&cmd=ViewItem';
97    }
98    function viewBioAssaySets()
99    {
100      location.href = '../bioassaysets/index.jsp?ID=<%=ID%>&experiment_id=<%=itemId%>';
101    }
102    function switchTab(tabControlId, tabId)
103    {
104      if (tabId == 'properties')
105      {
106        viewExperimentProperties();
107      }
108      else if (tabId == 'bioassaysets')
109      {
110        viewBioAssaySets();
111      }
112      else
113      {
114        TabControl.setActiveTab(tabControlId, tabId);
115      }
116    }
117   
118    function expandAll()
119    {
120      frames['overview']['tree'].openAll();
121    }
122    function collapseAll()
123    {
124      frames['overview']['tree'].closeAll();
125    }
126    function revalidate()
127    {
128      location.href = 'index.jsp?ID=<%=ID%>&cmd=Overview&revalidate=1';
129    }
130    function validationOptions()
131    {
132      Main.openPopup('options.jsp?ID=<%=ID%>', 'ValidationOptions', 700, 500);
133    }
134    </script>
135  </base:head>
136  <base:body attributes="onresize='setTimer();'">
137    <p>
138    <p:path>
139      <p:pathelement title="Experiments" href="<%="../index.jsp?ID="+ID%>" />
140      <p:pathelement title="<%=HTML.encodeTags(experiment.getName())%>" />
141    </p:path>
142 
143    <t:tabcontrol id="main" active="overview" switch="switchTab">
144    <t:tab id="properties" title="Properties" />
145    <t:tab id="bioassaysets" title="Bioassay sets" />
146    <t:tab id="overview" title="Overview">
147   
148      <tbl:toolbar>
149        <tbl:button image="joust/plusonly.gif" title="Expand all"
150          onclick="expandAll()" tooltip="Expand entire tree"/>
151        <tbl:button image="joust/minusonly.gif" title="Collapse all" 
152          onclick="collapseAll()" tooltip="Collapse entire tree" />
153        <tbl:button image="refresh.gif" title="Revalidate" 
154          onclick="revalidate()" tooltip="Revalidate the experiment" />
155        <tbl:button image="configure.png" title="Validation options&hellip;" 
156          onclick="validationOptions()" tooltip="Change validation options" />
157        <tbl:button image="help.gif" title="Help&hellip;"
158          onclick="<%="Main.openHelp('" + ID +"', 'experiment.overview')"%>"
159          tooltip="Get help about this page"
160        /> 
161      </tbl:toolbar>
162      <iframe name="overview" id="idOverview" src="frameset.jsp?ID=<%=ID%>" width="100%" 
163        frameborder="0" vspace="0" hspace="0"
164        marginwidth="0" marginheight="0" scrolling="no" 
165        style="border: 1px solid #999999; border-top: 0px; overflow: visible"></iframe>
166    </t:tab>
167    </t:tabcontrol>
168  </base:body>
169  </base:page>
170  <%
171}
172finally
173{
174  if (dc != null) dc.close();
175}
176%>
Note: See TracBrowser for help on using the repository browser.