Changeset 6942 for trunk/www/views/experiments/bioassays/view_bioassay.jsp
- Timestamp:
- Aug 31, 2015, 12:50:45 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/views/experiments/bioassays/view_bioassay.jsp
r6909 r6942 35 35 import="net.sf.basedb.core.RawBioAssay" 36 36 import="net.sf.basedb.core.RootRawBioAssay" 37 import="net.sf.basedb.core.Unit" 37 38 import="net.sf.basedb.core.Annotatable" 38 39 import="net.sf.basedb.core.AnnotationSet" … … 48 49 import="net.sf.basedb.core.query.Orders" 49 50 import="net.sf.basedb.core.query.Hql" 51 import="net.sf.basedb.core.snapshot.SnapshotManager" 52 import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot" 53 import="net.sf.basedb.core.snapshot.AnnotationSnapshot" 54 import="net.sf.basedb.core.snapshot.AnnotationTypeFilter" 50 55 import="net.sf.basedb.util.formatter.Formatter" 51 56 import="net.sf.basedb.clients.web.formatter.FormatterFactory" … … 202 207 <base:section 203 208 id="rawBioAssaySection" 204 title="<%="R aw bioassays (" + rawBioAssays.size() + ")"%>"209 title="<%="Root raw bioassays (" + rawBioAssays.size() + ")"%>" 205 210 context="<%=cc%>" 206 211 > … … 259 264 <tbl:rows> 260 265 <% 266 SnapshotManager manager = new SnapshotManager(); 267 AnnotationTypeFilter annotationTypeFilter = new AnnotationTypeFilter(); 261 268 for (RootRawBioAssay item : rawBioAssays) 262 269 { 263 270 RawBioAssay rba = item.getRawBioAssay(); 271 AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null; 272 AnnotationSetSnapshot snapshot = as == null ? null : manager.getSnapshot(dc, as.getId()); 264 273 %> 265 274 <tbl:row> 266 <tbl:cell column="name"><%=Base.getLinkedName(ID, rba, false, true)%></tbl:cell>275 <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 267 276 <tbl:cell column="spots"><%=rba.getSpots()%></tbl:cell> 268 <tbl:cell column="description"><%=HTML.encodeTags( rba.getDescription())%></tbl:cell>277 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 269 278 <% 270 AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null;271 279 for (AnnotationType at : experimentalFactors) 272 280 { 273 String value = "<i>- none -</i>"; 274 List<Annotation> all = as == null ? null : as.findAnnotations(dc, at, true); 275 Map<Annotatable, List> factorValues = new HashMap<Annotatable, List>(); 276 if (all != null && all.size() > 0) 277 { 278 for (Annotation a : all) 281 Unit unit = at.getDefaultUnit(); 282 String unitSymbol = unit == null ? "" : " " + unit.getDisplaySymbol(); 283 284 annotationTypeFilter.setAnnotationType(at); 285 List<AnnotationSnapshot> all = snapshot == null ? 286 null : manager.findAnnotations(dc, snapshot, annotationTypeFilter, true); 287 %> 288 <tbl:cell column="<%="at"+at.getId()%>"> 289 <% 290 if (all != null && all.size() > 0) 279 291 { 280 List values = a.getValues(); 281 Annotatable aItem = null; 282 try 292 for (AnnotationSnapshot a : all) 283 293 { 284 aItem = a.getAnnotationSet().getItem(); 285 } 286 catch (Throwable t) 287 {} 288 List toAdd = factorValues.get(aItem); 289 if (toAdd == null) 290 { 291 toAdd = new LinkedList(); 292 factorValues.put(aItem, toAdd); 293 } 294 toAdd.addAll(values); 295 } 296 } 297 %> 298 <tbl:cell column="<%="at"+at.getId()%>" 299 > 300 <% 301 for (Map.Entry<Annotatable, List> entry : factorValues.entrySet()) 302 { 303 Annotatable aItem = entry.getKey(); 304 List values = entry.getValue(); 305 %> 306 <tbl:cellvalue list="<%=values%>" /> 307 <% 308 if (aItem != null && aItem.hasPermission(Permission.WRITE)) 309 { 310 %>: <base:icon 311 subclass="link auto-init" 312 data-auto-init="edit-experimental-factor" 313 data-item-type="<%=aItem.getType().name()%>" 314 data-item-id="<%=aItem.getId()%>" 315 data-annotation-type="<%=at.getId()%>" 316 image="edit.png" 317 tooltip="Modify the values of this experimental factor" 318 /> 294 List values = a.getActualValues(); 295 %> 296 <tbl:cellvalue list="<%=values%>" suffix="<%=unitSymbol%>"/> 297 <base:icon 298 subclass="link auto-init" 299 data-auto-init="edit-experimental-factor" 300 data-item-type="<%=a.getThisItemType().name()%>" 301 data-item-id="<%=a.getThisItemId() %>" 302 data-annotation-type="<%=at.getId() %>" 303 data-annotation="<%=a.getThisAnnotationId()%>" 304 visible="<%=writePermission%>" 305 image="edit.png" 306 tooltip="Modify the values of this experimental factor" 307 /> 319 308 <% 320 309 }
Note: See TracChangeset
for help on using the changeset viewer.