Author: michiel
Date: 2010-05-31 14:40:11 +0200 (Mon, 31 May 2010)
New Revision: 42332

Modified:
   
mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/datatypes/processors/Cookies.java
Log:
javadoc, toString

Modified: 
mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/datatypes/processors/Cookies.java
===================================================================
--- 
mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/datatypes/processors/Cookies.java
  2010-05-31 12:00:18 UTC (rev 42331)
+++ 
mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/datatypes/processors/Cookies.java
  2010-05-31 12:40:11 UTC (rev 42332)
@@ -17,9 +17,31 @@
 
 
 /**
- * This processor can be used on a field to return a certain function value of 
the node, if the
- * field is empty. Noticeably, this can be used on 'virtual' field, to map 
their value to a function
- * value, which can come in handy sometimes.
+ * Setter and Getter to make a virtual field which stores the actual value in 
a user's cookie.
+ * Also it can be used to store a default value for the next time a user 
creates on node of this type:
+ * <pre>
+    &lt;field name="from"&gt;
+      &lt;gui&gt;
+        &lt;guiname xml:lang="nl"&gt;Uw naam&lt;/guiname&gt;
+        &lt;guiname xml:lang="en"&gt;From&lt;/guiname&gt;
+      &lt;/gui&gt;
+      &lt;datatype base="eline" 
xmlns="http://www.mmbase.org/xmlns/datatypes"&gt;
+        &lt;required value="true" /&gt;
+        &lt;minLength value="3" /&gt;
+        &lt;maxLength value="32" /&gt;
+        &lt;defaultprocessor&gt;
+          &lt;class name="org.mmbase.datatypes.processors.Cookies$Getter"&gt;
+            &lt;param name="cookie"&gt;eo.miniforum.name&lt;/param&gt;
+          &lt;/class&gt;
+        &lt;/defaultprocessor&gt;
+        &lt;setprocessor&gt;
+          &lt;class name="org.mmbase.datatypes.processors.Cookies$Setter"&gt;
+            &lt;param name="cookie"&gt;eo.miniforum.name&lt;/param&gt;
+          &lt;/class&gt;
+        &lt;/setprocessor&gt;
+      &lt;/datatype&gt;
+    &lt;/field&gt;
+ </pre>
  *
  * @author Michiel Meeuwissen
  * @version $Id$
@@ -38,6 +60,11 @@
         public void setCookie(String s) {
             cookie = s;
         }
+
+        @Override
+        public String toString() {
+            return cookie;
+        }
     }
 
     public static class Getter extends CookieBase implements Processor {

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to