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

Last change on this file since 1376 was 1376, checked in by Nicklas Nordborg, 12 years ago

Preparing for Reggie 1.5 release.

File size: 4.7 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  try
37  {
38    Role admin = Role.getById(dc, SystemItems.getId(Role.ADMINISTRATOR));
39    isAdmin = sc.isMemberOf(admin);
40  }
41  catch (RuntimeException ex)
42  {}
43  try
44  {
45    ItemQuery<Group> query = Group.getQuery();
46    query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string("PatientCurator")));
47    List<Group> result = query.list(dc);
48    if (result.size() == 1)
49    {
50      isPatientCurator = sc.isMemberOf(result.get(0));
51    }
52  }
53  catch (RuntimeException ex)
54  {}
55  try
56  {
57    if (sc.hasPermission(Permission.CREATE, Item.SAMPLE))
58    {
59      hasCreateSamplePermission = true;
60    }
61  }
62  catch(RuntimeException ex)
63  {}
64%>
65<base:page type="default" >
66<base:head styles="path.css">
67<style>
68dd
69{
70  margin-left: 0px;
71  margin-bottom: 10px;
72}
73</style>
74</base:head>
75<base:body>
76
77  <p:path style="margin-top: 20px; margin-bottom: 10px;">
78    <p:pathelement title="Reggie" />
79  </p:path>
80
81  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="margin-left: 20px;">
82  <tr valign="top">
83    <td width="50%">
84 
85    <h3 class="light">Reggie wizards</h3>
86    <div class="boxedbottom">
87      <dl>
88     
89      <%
90      if (isAdmin)
91      {
92        %>
93        <dt>
94          <table border="0" cellspacing="0" cellpadding="0">
95          <tr>
96            <td><base:icon image="configure.png" style="padding-right: 4px;"/></td>
97            <td><a href="install.jsp?ID=<%=ID%>">Installation wizard</a></td>
98          </tr>
99          </table>
100        </dt>
101        <dd>
102          <ul>
103          <li>Check that all annotation types and other items used by Reggie exists in BASE.
104          <li>Create missing items.
105          </ul>
106        </dd>
107        <%
108      }
109      if (isPatientCurator || isAdmin)
110      {
111        %>
112        <dt>
113          <table border="0" cellspacing="0" cellpadding="0">
114          <tr>
115            <td><base:icon image="share.gif" style="padding-right: 4px;"/></td>
116            <td><a href="persinfo.jsp?ID=<%=ID%>">Personal information registration wizard</a></td>
117          </tr>
118          </table>
119        </dt>
120        <dd>
121          <ul>
122          <li>Register new cases and patients.
123          <li>Update existing cases and specimen tubes.
124          </ul>
125        </dd>
126        <%
127      }
128      if (isPatientCurator || isAdmin)
129      {
130        %>
131        <dt>
132          <table border="0" cellspacing="0" cellpadding="0">
133          <tr>
134            <td><base:icon image="file.gif" style="padding-right: 4px;"/></td>
135            <td><a href="refform.jsp?ID=<%=ID%>">Referral form registration wizard</a></td>
136          </tr>
137          </table>
138        </dt>
139        <dd>
140          <ul>
141          <li>Link scanned referral forms to cases.
142          </ul>
143        </dd>
144        <%
145      }
146      if (isPatientCurator || isAdmin)
147      {
148        %>
149        <dt>
150          <table border="0" cellspacing="0" cellpadding="0">
151          <tr>
152            <td><base:icon image="file.gif" style="padding-right: 4px;"/></td>
153            <td><a href="consentform.jsp?ID=<%=ID%>">Consent form registration wizard</a></td>
154          </tr>
155          </table>
156        </dt>
157        <dd>
158          <ul>
159          <li>Register consent forms.
160          </ul>
161        </dd>
162        <%
163      }
164      if (hasCreateSamplePermission)
165      {
166        %>
167        <!--
168        <dt>
169          <table border="0" cellspacing="0" cellpadding="0">
170          <tr>
171            <td><base:icon image="file.gif" style="padding-right: 4px;"/></td>
172            <td><a href="specimentube.jsp?ID=<%=ID%>">Specimen tube registration wizard</a></td>
173          </tr>
174          </table>
175        </dt>
176        <dd>
177          <ul>
178          <li>Register new specimen tubes.
179          <li>Update existing specimen tubes.
180          </ul>
181        </dd>
182        -->
183        <%
184      }
185      %>
186      </dl>
187   
188    </div>
189    </td>
190    <td width="50%">
191    </td>
192  </tr>
193  </table>
194
195
196</base:body>
197</base:page>
198<%
199}
200finally
201{
202  if (dc != null) dc.close();
203}
204%>
Note: See TracBrowser for help on using the repository browser.