KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > datatypes > processors > LastModifier


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.datatypes.processors;
11
12 import org.mmbase.bridge.*;
13
14 /**
15  * This processor can be used as a 'commit' processor on a string field. The field will then be set
16  * to the current user id when the node is committed.
17  *
18  * @author Michiel Meeuwissen
19  * @version $Id: LastModifier.java,v 1.4 2006/02/14 22:46:41 michiel Exp $
20  * @since MMBase-1.8
21  * @see LastModified
22  * @see Creator
23  */

24
25
26 public class LastModifier implements CommitProcessor {
27
28     private static final long serialVersionUID = 1L;
29
30     public void commit(Node node, Field field) {
31         node.setValueWithoutProcess(field.getName(),node.getCloud().getUser().getIdentifier());
32     }
33
34     public String JavaDoc toString() {
35         return "lastmodifier";
36     }
37 }
38
Popular Tags