Changeset 1372
- Timestamp:
- May 23, 2011, 4:40:03 PM (11 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/META-INF/servlets.xml
r1354 r1372 17 17 <servlet-class>net.sf.basedb.reggie.servlet.ConsentFormServlet</servlet-class> 18 18 </servlet> 19 <servlet> 20 <servlet-name>SpecimenTubeRegistration</servlet-name> 21 <servlet-class>net.sf.basedb.reggie.servlet.SpecimenTubeServlet</servlet-class> 22 </servlet> 19 23 20 24 </servlets> -
extensions/net.sf.basedb.reggie/trunk/resources/index.jsp
r1342 r1372 7 7 import="net.sf.basedb.core.Group" 8 8 import="net.sf.basedb.core.DbControl" 9 import="net.sf.basedb.core.Item" 10 import="net.sf.basedb.core.Permission" 9 11 import="net.sf.basedb.core.SessionControl" 10 12 import="net.sf.basedb.core.SystemItems" … … 31 33 boolean isAdmin = false; 32 34 boolean isPatientCurator = false; 35 boolean hasCreateSamplePermission = false; 33 36 try 34 37 { … … 50 53 catch (RuntimeException ex) 51 54 {} 55 try 56 { 57 if (sc.hasPermission(Permission.CREATE, Item.SAMPLE)) 58 { 59 hasCreateSamplePermission = true; 60 } 61 } 62 catch(RuntimeException ex) 63 {} 52 64 %> 53 65 <base:page type="default" > … … 150 162 <% 151 163 } 164 if (hasCreateSamplePermission) 165 { 166 %> 167 <dt> 168 <table border="0" cellspacing="0" cellpadding="0"> 169 <tr> 170 <td><base:icon image="file.gif" style="padding-right: 4px;"/></td> 171 <td><a href="specimentube.jsp?ID=<%=ID%>">Specimen tube registration wizard</a></td> 172 </tr> 173 </table> 174 </dt> 175 <dd> 176 <ul> 177 <li>Register new specimen tubes. 178 <li>Update existing specimen tubes. 179 </ul> 180 </dd> 181 <% 182 } 152 183 %> 153 184 </dl> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/Reggie.java
r1365 r1372 118 118 public static final String ANNOTATION_CONSENT_DATE = "ConsentDate"; 119 119 120 /** 121 The name of the "ArrivalDate" annotation type, used 122 for samples (Specimen tube). It is a timestamp annotation. 123 */ 124 public static final String ANNOTATION_ARRIVAL_DATE = "ArrivalDate"; 125 126 /** 127 The name of the "NofDeliveredTubes" annotation type, used 128 for samples (Specimen tube). It is an Integer annotation type. 129 */ 130 public static final String ANNOTATION_NOF_DELIVERED_TUBES = "NofDeliveredTubes"; 120 131 121 132 /** -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/SpecimenTube.java
r1366 r1372 6 6 import net.sf.basedb.core.DbControl; 7 7 import net.sf.basedb.core.Include; 8 import net.sf.basedb.core.InvalidDataException; 8 9 import net.sf.basedb.core.ItemQuery; 9 10 import net.sf.basedb.core.Sample; … … 68 69 } 69 70 71 72 public static SpecimenTube findByTubeName(DbControl dc, String tubeName) 73 { 74 SpecimenTube tube = null; 75 76 ItemQuery<Sample> tubeQuery = Sample.getQuery(); 77 tubeQuery.restrict(Restrictions.like(Hql.property("name"), Expressions.string(tubeName))); 78 tubeQuery.order(Orders.desc(Hql.property("name"))); 79 tubeQuery.include(Include.ALL); 80 81 List<Sample> tubes = tubeQuery.list(dc); 82 if (tubes.size() > 1) 83 { 84 throw new InvalidDataException( 85 "More than one specimen tube with the name " + tubeName + " was found. " + 86 "This wizard can't be used until that is corrected."); 87 } 88 if (tubes.size() == 1) 89 { 90 tube = new SpecimenTube(tubes.get(0)); 91 } 92 return tube; 93 } 94 70 95 private SpecimenTube(Sample sample) 71 96 { -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java
r1360 r1372 125 125 jsonChecks.add(checkAnnotationType(dc, Reggie.ANNOTATION_CONSENT_DATE, Item.SAMPLE, Type.DATE, 1, 126 126 null, effectiveOptions, createIfMissing)); 127 jsonChecks.add(checkAnnotationType(dc, Reggie.ANNOTATION_ARRIVAL_DATE, Item.SAMPLE, Type.DATE, 1, 128 null, effectiveOptions, createIfMissing)); 129 jsonChecks.add(checkAnnotationType(dc, Reggie.ANNOTATION_NOF_DELIVERED_TUBES, Item.SAMPLE, Type.STRING, 1, 130 null, effectiveOptions, createIfMissing)); 127 131 128 132 json.put("checks", jsonChecks);
Note: See TracChangeset
for help on using the changeset viewer.