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

Last change on this file since 1403 was 1403, checked in by Martin Svensson, 12 years ago

References #317 Added partition registration form.

File size: 5.4 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.Item"
10  import="net.sf.basedb.core.Permission"
11  import="net.sf.basedb.core.SessionControl"
12  import="net.sf.basedb.core.SystemItems"
13  import="net.sf.basedb.core.ItemQuery"
14  import="net.sf.basedb.core.query.Expressions"
15  import="net.sf.basedb.core.query.Hql"
16  import="net.sf.basedb.core.query.Restrictions"
17  import="net.sf.basedb.clients.web.Base"
18  import="net.sf.basedb.clients.web.util.HTML"
19  import="net.sf.basedb.util.Values"
20  import="java.util.List"
21%>
22<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
23<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
24<%
25final SessionControl sc = Base.getExistingSessionControl(request, true);
26final String ID = sc.getId();
27final float scale = Base.getScale(sc);
28DbControl dc = null;
29try
30{
31  dc = sc.newDbControl();
32  final User user = User.getById(dc, sc.getLoggedInUserId());
33  boolean isAdmin = false;
34  boolean isPatientCurator = false;
35  boolean hasCreateSamplePermission = false;
36  boolean hasCreateExtractPermission = false;
37  try
38  {
39    Role admin = Role.getById(dc, SystemItems.getId(Role.ADMINISTRATOR));
40    isAdmin = sc.isMemberOf(admin);
41  }
42  catch (RuntimeException ex)
43  {}
44  try
45  {
46    ItemQuery<Group> query = Group.getQuery();
47    query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string("PatientCurator")));
48    List<Group> result = query.list(dc);
49    if (result.size() == 1)
50    {
51      isPatientCurator = sc.isMemberOf(result.get(0));
52    }
53  }
54  catch (RuntimeException ex)
55  {}
56  try
57  {
58    if (sc.hasPermission(Permission.CREATE, Item.SAMPLE))
59    {
60      hasCreateSamplePermission = true;
61    }
62  }
63  catch(RuntimeException ex)
64  {}
65  try
66  {
67    if (sc.hasPermission(Permission.CREATE, Item.EXTRACT))
68    {
69      hasCreateExtractPermission = true;
70    }
71  }
72  catch(RuntimeException ex)
73  {}
74%>
75<base:page type="default" >
76<base:head styles="path.css">
77<style>
78dd
79{
80  margin-left: 0px;
81  margin-bottom: 10px;
82}
83</style>
84</base:head>
85<base:body>
86
87  <p:path style="margin-top: 20px; margin-bottom: 10px;">
88    <p:pathelement title="Reggie" />
89  </p:path>
90
91  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="margin-left: 20px;">
92  <tr valign="top">
93    <td width="50%">
94 
95    <h3 class="light">Reggie wizards</h3>
96    <div class="boxedbottom">
97      <dl>
98     
99      <%
100      if (isAdmin)
101      {
102        %>
103        <dt>
104          <table border="0" cellspacing="0" cellpadding="0">
105          <tr>
106            <td><base:icon image="configure.png" style="padding-right: 4px;"/></td>
107            <td><a href="install.jsp?ID=<%=ID%>">Installation wizard</a></td>
108          </tr>
109          </table>
110        </dt>
111        <dd>
112          <ul>
113          <li>Check that all annotation types and other items used by Reggie exists in BASE.
114          <li>Create missing items.
115          </ul>
116        </dd>
117        <%
118      }
119      if (isPatientCurator || isAdmin)
120      {
121        %>
122        <dt>
123          <table border="0" cellspacing="0" cellpadding="0">
124          <tr>
125            <td><base:icon image="share.gif" style="padding-right: 4px;"/></td>
126            <td><a href="persinfo.jsp?ID=<%=ID%>">Personal information registration wizard</a></td>
127          </tr>
128          </table>
129        </dt>
130        <dd>
131          <ul>
132          <li>Register new cases and patients.
133          <li>Update existing cases and specimen tubes.
134          </ul>
135        </dd>
136        <%
137      }
138      if (isPatientCurator || isAdmin)
139      {
140        %>
141        <dt>
142          <table border="0" cellspacing="0" cellpadding="0">
143          <tr>
144            <td><base:icon image="file.gif" style="padding-right: 4px;"/></td>
145            <td><a href="refform.jsp?ID=<%=ID%>">Referral form registration wizard</a></td>
146          </tr>
147          </table>
148        </dt>
149        <dd>
150          <ul>
151          <li>Link scanned referral forms to cases.
152          </ul>
153        </dd>
154        <%
155      }
156      if (isPatientCurator || isAdmin)
157      {
158        %>
159        <dt>
160          <table border="0" cellspacing="0" cellpadding="0">
161          <tr>
162            <td><base:icon image="file.gif" style="padding-right: 4px;"/></td>
163            <td><a href="consentform.jsp?ID=<%=ID%>">Consent form registration wizard</a></td>
164          </tr>
165          </table>
166        </dt>
167        <dd>
168          <ul>
169          <li>Register consent forms.
170          </ul>
171        </dd>
172        <%
173      }
174      if (hasCreateSamplePermission)
175      {
176        %>
177        <dt>
178          <table border="0" cellspacing="0" cellpadding="0">
179          <tr>
180            <td><base:icon image="file.gif" style="padding-right: 4px;"/></td>
181            <td><a href="specimentube.jsp?ID=<%=ID%>">Specimen tube registration wizard</a></td>
182          </tr>
183          </table>
184        </dt>
185        <dd>
186          <ul>
187          <li>Register new specimen tubes.
188          <li>Update existing specimen tubes.
189          </ul>
190        </dd>
191        <%
192      }
193      if (hasCreateSamplePermission && hasCreateExtractPermission)
194      {
195        %>
196        <dt>
197          <table border="0" cellspacing="0" cellpadding="0">
198          <tr>
199            <td><base:icon image="file.gif" style="padding-right: 4px;"/></td>
200            <td><a href="partitionform.jsp?ID=<%=ID%>">Partition registration wizard</a></td>
201          </tr>
202          </table>
203        </dt>
204        <dd>
205          <ul>
206          <li>Register new partitions of existing specimens.
207          </ul>
208        </dd>
209        <%
210      }
211      %>
212      </dl>
213   
214    </div>
215    </td>
216    <td width="50%">
217    </td>
218  </tr>
219  </table>
220
221
222</base:body>
223</base:page>
224<%
225}
226finally
227{
228  if (dc != null) dc.close();
229}
230%>
Note: See TracBrowser for help on using the repository browser.