Changeset 95:acd44dfec9c8 in AnnotationManagerN4J for src


Ignore:
Timestamp:
Feb 10, 2015, 5:11:17 PM (9 years ago)
Author:
casties
Branch:
default
Message:

added last update field for annotations in database.

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  
    9696     */
    9797    protected String created;
     98
     99    /**
     100     * The last update date of this annotation.
     101     */
     102    protected String updated;
    98103
    99104    /**
     
    374379    }
    375380
    376     /**
     381    public String getUpdated() {
     382                return updated;
     383        }
     384
     385        public void setUpdated(String updated) {
     386                this.updated = updated;
     387        }
     388
     389        /**
    377390     * @return the adminPermission
    378391     */
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java

    r91 r95  
    611611         */
    612612        if (annot.getCreated() == null) {
    613             // set creation date
     613            // new - set creation date
    614614            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
    615615            String ct = format.format(Calendar.getInstance().getTime());
    616616            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);
    617625        }
    618626
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationResource.java

    r78 r95  
    6565    protected void doInit() throws ResourceException {
    6666        super.doInit();
    67         // id from URI /annotations/persons/{id}
     67        // id from URI /annotations/annotation/{id}
    6868        requestId = (String) getRequest().getAttributes().get("id");
    6969        logger.fine("annoation-id=" + requestId);
     
    8787
    8888    /**
    89      * GET with HTML content type. Shows the person.
     89     * GET with HTML content type. Shows the annotation.
    9090     *
    9191     * @param entity
     
    121121            */
    122122        } else {
    123             // output person content
     123            // output content
    124124            result = "<html><body>\n<h1>Annotation</h1>\n";
    125125            result += String.format("<p><a href=\"%s\">All annotations</a></p>", this.getReference().getParentRef());
     
    132132            result += String.format("<tr><td><b>resource</b></td><td>%s</td></tr>\n", annotation.getResourceUri());
    133133            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());
    134136            result += "</table>\n";
    135137            result += "<br/>\n";
Note: See TracChangeset for help on using the changeset viewer.