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> + <field name="from"> + <gui> + <guiname xml:lang="nl">Uw naam</guiname> + <guiname xml:lang="en">From</guiname> + </gui> + <datatype base="eline" xmlns="http://www.mmbase.org/xmlns/datatypes"> + <required value="true" /> + <minLength value="3" /> + <maxLength value="32" /> + <defaultprocessor> + <class name="org.mmbase.datatypes.processors.Cookies$Getter"> + <param name="cookie">eo.miniforum.name</param> + </class> + </defaultprocessor> + <setprocessor> + <class name="org.mmbase.datatypes.processors.Cookies$Setter"> + <param name="cookie">eo.miniforum.name</param> + </class> + </setprocessor> + </datatype> + </field> + </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
