Update of /var/cvs/src/org/mmbase/datatypes/processors
In directory james.mmbase.org:/tmp/cvs-serv17540
Modified Files:
LastModified.java LastModifier.java
Log Message:
MMB-1737
See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/datatypes/processors
See also: http://www.mmbase.org/jira/browse/MMB-1737
Index: LastModified.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/datatypes/processors/LastModified.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- LastModified.java 15 Jul 2008 10:11:43 -0000 1.5
+++ LastModified.java 4 Nov 2008 16:47:59 -0000 1.6
@@ -17,7 +17,7 @@
* to the current time when the node is committed.
*
* @author Michiel Meeuwissen
- * @version $Id: LastModified.java,v 1.5 2008/07/15 10:11:43 michiel Exp $
+ * @version $Id: LastModified.java,v 1.6 2008/11/04 16:47:59 michiel Exp $
* @since MMBase-1.8
* @see LastModifier
*/
@@ -26,8 +26,20 @@
private static final long serialVersionUID = 1L;
+
+ private boolean setIfNotChanged = false;
+ /**
+ * On default the field is not changed if no other fields were changed.
You can override this
+ * using this property.
+ *
+ * @since MMBase-1.9.1
+ */
+ public void setIfNotChanged(boolean b) {
+ setIfNotChanged = b;
+ }
+
public void commit(Node node, Field field) {
- if (node.mayWrite()) {
+ if (node.mayWrite() && (setIfNotChanged || node.getChanged().size() >
0)) {
node.setValueWithoutProcess(field.getName(), new Date());
}
}
Index: LastModifier.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/datatypes/processors/LastModifier.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- LastModifier.java 15 Jul 2008 10:11:43 -0000 1.5
+++ LastModifier.java 4 Nov 2008 16:47:59 -0000 1.6
@@ -16,7 +16,7 @@
* to the current user id when the node is committed.
*
* @author Michiel Meeuwissen
- * @version $Id: LastModifier.java,v 1.5 2008/07/15 10:11:43 michiel Exp $
+ * @version $Id: LastModifier.java,v 1.6 2008/11/04 16:47:59 michiel Exp $
* @since MMBase-1.8
* @see LastModified
* @see Creator
@@ -27,8 +27,19 @@
private static final long serialVersionUID = 1L;
+ private boolean setIfNotChanged = false;
+ /**
+ * On default the field is not changed if no other fields were changed.
You can override this
+ * using this property.
+ *
+ * @since MMBase-1.9.1
+ */
+ public void setIfNotChanged(boolean b) {
+ setIfNotChanged = b;
+ }
+
public void commit(Node node, Field field) {
- if (node.mayWrite()) {
+ if (node.mayWrite() && (setIfNotChanged || node.getChanged().size() >
0)) {
node.setValueWithoutProcess(field.getName(),node.getCloud().getUser().getIdentifier());
}
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs