source: extensions/net.sf.basedb.reggie/trunk/resources/index.jsp @ 1335

Last change on this file since 1335 was 1335, checked in by Nicklas Nordborg, 11 years ago

References #303: Automatic attachment of files to sample (Case) items

The functionality is more or less in place. Just need some more polishing up in the gui and error handling.

File size: 3.6 KB
Line 
1<%@ page
2  pageEncoding="UTF-8"
3  session="false"
4  import="net.sf.basedb.core.Application"
5  import="net.sf.basedb.core.User"
6  import="net.sf.basedb.core.Role"
7  import="net.sf.basedb.core.Group"
8  import="net.sf.basedb.core.DbControl"
9  import="net.sf.basedb.core.SessionControl"
10  import="net.sf.basedb.core.SystemItems"
11  import="net.sf.basedb.core.ItemQuery"
12  import="net.sf.basedb.core.query.Expressions"
13  import="net.sf.basedb.core.query.Hql"
14  import="net.sf.basedb.core.query.Restrictions"
15  import="net.sf.basedb.clients.web.Base"
16  import="net.sf.basedb.clients.web.util.HTML"
17  import="net.sf.basedb.util.Values"
18  import="java.util.List"
19%>
20<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
21<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
22<%
23final SessionControl sc = Base.getExistingSessionControl(request, true);
24final String ID = sc.getId();
25final float scale = Base.getScale(sc);
26DbControl dc = null;
27try
28{
29  dc = sc.newDbControl();
30  final User user = User.getById(dc, sc.getLoggedInUserId());
31  boolean isAdmin = false;
32  boolean isPatientCurator = false;
33  try
34  {
35    Role admin = Role.getById(dc, SystemItems.getId(Role.ADMINISTRATOR));
36    isAdmin = sc.isMemberOf(admin);
37  }
38  catch (RuntimeException ex)
39  {}
40  try
41  {
42    ItemQuery<Group> query = Group.getQuery();
43    query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string("PatientCurator")));
44    List<Group> result = query.list(dc);
45    if (result.size() == 1)
46    {
47      isPatientCurator = sc.isMemberOf(result.get(0));
48    }
49  }
50  catch (RuntimeException ex)
51  {}
52%>
53<base:page type="default" >
54<base:head styles="path.css">
55<style>
56dd
57{
58  margin-left: 0px;
59  margin-bottom: 10px;
60}
61</style>
62</base:head>
63<base:body>
64
65  <p:path style="margin-top: 20px; margin-bottom: 10px;">
66    <p:pathelement title="Reggie" />
67  </p:path>
68
69  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="margin-left: 20px;">
70  <tr valign="top">
71    <td width="50%">
72 
73    <h3 class="light">Reggie wizards</h3>
74    <div class="boxedbottom">
75      <dl>
76     
77      <%
78      if (isAdmin)
79      {
80        %>
81        <dt>
82          <table border="0" cellspacing="0" cellpadding="0">
83          <tr>
84            <td><base:icon image="configure.png" style="padding-right: 4px;"/></td>
85            <td><a href="install.jsp?ID=<%=ID%>">Installation wizard</a></td>
86          </tr>
87          </table>
88        </dt>
89        <dd>
90          <ul>
91          <li>Check that all annotation types and other items used by Reggies exists in BASE.
92          <li>Create missing items.
93          </ul>
94        </dd>
95        <%
96      }
97      if (isPatientCurator || isAdmin)
98      {
99        %>
100        <dt>
101          <table border="0" cellspacing="0" cellpadding="0">
102          <tr>
103            <td><base:icon image="share.gif" style="padding-right: 4px;"/></td>
104            <td><a href="persinfo.jsp?ID=<%=ID%>">Personal information registration wizard</a></td>
105          </tr>
106          </table>
107        </dt>
108        <dd>
109          <ul>
110          <li>Register new cases and patients.
111          <li>Update existing cases and specimen tubes.
112          </ul>
113        </dd>
114        <%
115      }
116      if (isPatientCurator || isAdmin)
117      {
118        %>
119        <dt>
120          <table border="0" cellspacing="0" cellpadding="0">
121          <tr>
122            <td><base:icon image="file.gif" style="padding-right: 4px;"/></td>
123            <td><a href="refform.jsp?ID=<%=ID%>">Referral form registration wizard</a></td>
124          </tr>
125          </table>
126        </dt>
127        <dd>
128          <ul>
129          <li>Link scanned referral forms to cases.
130          </ul>
131        </dd>
132        <%
133      }
134      %>
135      </dl>
136   
137    </div>
138    </td>
139    <td width="50%">
140    </td>
141  </tr>
142  </table>
143
144
145</base:body>
146</base:page>
147<%
148}
149finally
150{
151  if (dc != null) dc.close();
152}
153%>
Note: See TracBrowser for help on using the repository browser.