Changeset 6962
- Timestamp:
- Oct 1, 2015, 2:29:38 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/snapshot/AnnotationSnapshot.java
r6939 r6962 524 524 525 525 /** 526 A primary or inherited annotation is always up-to-date. A cloned annotation 527 is up-to-date if the link to the source annotation exists and the source 528 annotation has a date equal to or before the cloned annotation. 529 @since 3.6 530 */ 531 public boolean isUpToDate() 532 { 533 boolean upToDate = true; 534 if (source == Annotation.Source.CLONED) 535 { 536 AnnotationSnapshot inherited = getInheritedFrom(); 537 Date cloned = getThisLastUpdate(); 538 Date source = inherited != null ? inherited.getThisLastUpdate() : null; 539 upToDate = cloned != null && source != null && !source.after(cloned); 540 } 541 return upToDate; 542 } 543 544 /** 526 545 Get the id of the item this annotation belongs to. 527 546 @deprecated In 3.6, use {@link #getThisItemId()} or -
trunk/www/common/annotations/list_annotations.jsp
r6939 r6962 510 510 String description = HTML.encodeTags(at.getDescription()); 511 511 Date lastModified = a.getThisLastUpdate(); 512 boolean isUpToDate = true;512 boolean isUpToDate = a.isUpToDate(); 513 513 514 514 // Which item are we inheriting from? … … 522 522 { 523 523 lastModified = from.getThisLastUpdate(); 524 }525 else526 {527 isUpToDate = !lastModified.before(from.getThisLastUpdate());528 524 } 529 525 try … … 557 553 <%=values == null || values.size() == 0 ? 558 554 "<i>- no values -</i>" : Values.getString(values, ", ", true, formatter)%> 559 <base:icon image="edit.png" subclass="edit-annotation auto-init link" 555 <base:icon image="<%=isUpToDate ? "edit.png" : "edit-outofsync.png"%>" 556 subclass="edit-annotation auto-init link" 560 557 data-auto-init="edit-annotation" 561 558 data-annotation="<%= a.getThisAnnotationId()%>" -
trunk/www/common/overview/info.jsp
r6939 r6962 449 449 // Inheritance information 450 450 Date lastModified = snapshot.getThisLastUpdate(); 451 boolean isUpToDate = true;451 boolean isUpToDate = snapshot.isUpToDate(); 452 452 AnnotationSnapshot inherited = snapshot.getInheritedFrom(); 453 453 Annotatable inheritedFrom = null; … … 457 457 { 458 458 lastModified = inherited.getThisLastUpdate(); 459 }460 else461 {462 isUpToDate = !lastModified.before(inherited.getThisLastUpdate());463 459 } 464 460 try … … 481 477 <%=Values.getString(values, ", ", true, formatter)%> 482 478 <base:icon id="<%=Integer.toString(snapshot.getThisAnnotationId())%>" 483 image="edit.png" subclass="edit-annotation auto-init" data-auto-init="edit-annotation" 479 image="<%=isUpToDate ? "edit.png" : "edit-outofsync.png"%>" 480 subclass="edit-annotation auto-init" 481 data-auto-init="edit-annotation" 484 482 data-item-type="<%=annotatable.getType().name()%>" 485 483 data-item-id="<%=annotatable.getId()%>" -
trunk/www/views/experiments/bioassays/view_bioassay.jsp
r6942 r6962 293 293 { 294 294 List values = a.getActualValues(); 295 boolean isUpToDate = a.isUpToDate(); 295 296 %> 296 297 <tbl:cellvalue list="<%=values%>" suffix="<%=unitSymbol%>"/> … … 303 304 data-annotation="<%=a.getThisAnnotationId()%>" 304 305 visible="<%=writePermission%>" 305 image=" edit.png"306 image="<%=isUpToDate ? "edit.png" : "edit-outofsync.png"%>" 306 307 tooltip="Modify the values of this experimental factor" 307 308 /> -
trunk/www/views/experiments/rootrawbioassays/view_bioassay.jsp
r6942 r6962 105 105 manager.getSnapshot(dc, bioAssay.getAnnotationSet().getId()) : null; 106 106 107 Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); 107 108 final boolean writePermission = bioAssay.hasPermission(Permission.WRITE); 108 109 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); … … 244 245 id="note" 245 246 title="Note" 247 /> 248 <tbl:columndef 249 id="lastModified" 250 title="Last modified" 251 formatter="<%=dateTimeFormatter %>" 246 252 /> 247 253 <tbl:columndef … … 283 289 284 290 Date lastModified = a.getThisLastUpdate(); 285 boolean isUpToDate = true;291 boolean isUpToDate = a.isUpToDate(); 286 292 AnnotationSnapshot inherited = a.getInheritedFrom(); 287 293 if (inherited != null) … … 291 297 { 292 298 lastModified = inherited.getThisLastUpdate(); 293 }294 else295 {296 isUpToDate = !lastModified.before(inherited.getThisLastUpdate());297 299 } 298 300 try … … 323 325 <%=Values.getString(values, ", ", true, formatter)%> 324 326 <base:icon id="<%=Integer.toString(a.getThisAnnotationId())%>" 325 image="edit.png" subclass="edit-experimental-factor auto-init" data-auto-init="edit-experimental-factor" 327 image="<%=isUpToDate ? "edit.png" : "edit-outofsync.png"%>" 328 subclass="edit-experimental-factor auto-init" 329 data-auto-init="edit-experimental-factor" 326 330 data-item-type="ROOTRAWBIOASSAY" 327 331 data-item-id="<%=itemId%>" … … 348 352 </tbl:cell> 349 353 <tbl:cell column="note"><%=a.getSource() == Annotation.Source.CLONED ? "Cloned" + (isUpToDate ? "; up-to-date" : "; modified") : "" %></tbl:cell> 354 <tbl:cell column="lastModified" value="<%=lastModified %>" /> 350 355 </tbl:row> 351 356 <% -
trunk/www/views/experiments/view_experiment.jsp
r6942 r6962 556 556 factorValuesCount.put(at, factorValuesCount.get(at)+1); 557 557 List values = a.getActualValues(); 558 boolean isUpToDate = a.isUpToDate(); 558 559 usedFactorValues.get(at).addAll(values); 559 560 %> … … 567 568 data-annotation="<%=a.getThisAnnotationId()%>" 568 569 visible="<%=writePermission%>" 569 image=" edit.png"570 image="<%=isUpToDate ? "edit.png" : "edit-outofsync.png"%>" 570 571 tooltip="Modify the values of this experimental factor" 571 572 />
Note: See TracChangeset
for help on using the changeset viewer.