Changeset 95:acd44dfec9c8 in AnnotationManagerN4J
- Timestamp:
- Feb 10, 2015, 5:11:17 PM (10 years ago)
- Branch:
- default
- Location:
- src/main/java/de/mpiwg/itgroup/annotations
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/de/mpiwg/itgroup/annotations/Annotation.java
r84 r95 96 96 */ 97 97 protected String created; 98 99 /** 100 * The last update date of this annotation. 101 */ 102 protected String updated; 98 103 99 104 /** … … 374 379 } 375 380 376 /** 381 public String getUpdated() { 382 return updated; 383 } 384 385 public void setUpdated(String updated) { 386 this.updated = updated; 387 } 388 389 /** 377 390 * @return the adminPermission 378 391 */ -
src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java
r91 r95 611 611 */ 612 612 if (annot.getCreated() == null) { 613 // set creation date613 // new - set creation date 614 614 SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); 615 615 String ct = format.format(Calendar.getInstance().getTime()); 616 616 annot.setCreated(ct); 617 } else { 618 /* 619 * update date 620 */ 621 // not new - set last update date 622 SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); 623 String ct = format.format(Calendar.getInstance().getTime()); 624 annot.setUpdated(ct); 617 625 } 618 626 -
src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationResource.java
r78 r95 65 65 protected void doInit() throws ResourceException { 66 66 super.doInit(); 67 // id from URI /annotations/ persons/{id}67 // id from URI /annotations/annotation/{id} 68 68 requestId = (String) getRequest().getAttributes().get("id"); 69 69 logger.fine("annoation-id=" + requestId); … … 87 87 88 88 /** 89 * GET with HTML content type. Shows the person.89 * GET with HTML content type. Shows the annotation. 90 90 * 91 91 * @param entity … … 121 121 */ 122 122 } else { 123 // output personcontent123 // output content 124 124 result = "<html><body>\n<h1>Annotation</h1>\n"; 125 125 result += String.format("<p><a href=\"%s\">All annotations</a></p>", this.getReference().getParentRef()); … … 132 132 result += String.format("<tr><td><b>resource</b></td><td>%s</td></tr>\n", annotation.getResourceUri()); 133 133 result += String.format("<tr><td><b>creator</b></td><td>%s</td></tr>\n", annotation.getCreatorName()); 134 result += String.format("<tr><td><b>created</b></td><td>%s</td></tr>\n", annotation.getCreated()); 135 result += String.format("<tr><td><b>updated</b></td><td>%s</td></tr>\n", annotation.getUpdated()); 134 136 result += "</table>\n"; 135 137 result += "<br/>\n";
Note: See TracChangeset
for help on using the changeset viewer.