01: /*
02:
03: This software is OSI Certified Open Source Software.
04: OSI Certified is a certification mark of the Open Source Initiative.
05:
06: The license (Mozilla version 1.0) can be read at the MMBase site.
07: See http://www.MMBase.org/license
08:
09: */
10: package org.mmbase.datatypes.processors;
11:
12: import org.mmbase.bridge.*;
13: import java.util.Date;
14:
15: /**
16: * This processor can be used as a 'commit' processor on a (datetime) field. The field will then be set
17: * to the current time when the node is committed.
18: *
19: * @author Michiel Meeuwissen
20: * @version $Id: LastModified.java,v 1.4 2006/02/14 22:46:41 michiel Exp $
21: * @since MMBase-1.8
22: * @see LastModifier
23: */
24:
25: public class LastModified implements CommitProcessor {
26:
27: private static final long serialVersionUID = 1L;
28:
29: public void commit(Node node, Field field) {
30: node.setValueWithoutProcess(field.getName(), new Date());
31: }
32:
33: public String toString() {
34: return "lastmodified";
35: }
36: }
|