--- \java\CVS\jakarta-turbine\src\java\org\apache\turbine\services\intake\xmlmodel\XmlField.java	Fri May 18 12:35:58 2001
+++ \java\jakarta-turbine\src\java\org\apache\turbine\services\intake\xmlmodel\XmlField.java	Fri Jun  8 13:53:46 2001
@@ -66,7 +66,7 @@
  * A Class for holding data about a property used in an Application.
  *
  * @author <a href="mailto:jmcnally@collab.net>John McNally</a>
- * @version $Id: XmlField.java,v 1.10 2001/05/18 19:35:58 jmcnally Exp $
+ * @version $Id: XmlField.java,v 1.7.4.5 2001/06/01 01:34:06 jvanzyl Exp $
  */
 public class XmlField
     implements java.io.Serializable
@@ -78,6 +78,7 @@
     private String name;
     private String key;
     private String type;
+    private String displayName;
     private String onError;
     private String multiValued;
     private XmlGroup parent;
@@ -170,6 +171,7 @@
         setName(attrib.getValue("name"));
         key = attrib.getValue("key");
         type = attrib.getValue("type");
+        displayName = attrib.getValue("displayName");
         //setOnError(attrib.getValue("onError"));
         setMultiValued(attrib.getValue("multiValued"));
 
@@ -213,6 +215,22 @@
     }
 
     /**
+     * Get the display name of the property
+     */
+    public String getDisplayName()
+    {
+        return displayName;
+    }
+
+    /**
+     * Set the display name of the property
+     */
+    public void setDisplayName(String newDisplayName)
+    {
+        displayName = newDisplayName;
+    }
+
+    /**
      * Set the parameter key of the property
      */
     public void setKey(String newKey)
@@ -486,6 +504,10 @@
         result.append(" key=\""+key+"\"");
         result.append(" type=\""+type+"\"");
 
+        if (displayName != null)
+        {
+            result.append(" displayName=\""+displayName+"\"");
+        }
         if (onError != null)
         {
             result.append(" onError=\""+onError+"\"");
--- \java\CVS\jakarta-turbine\src\java\org\apache\turbine\services\intake\model\Field.java	Tue May 29 18:08:52 2001
+++ \java\jakarta-turbine\src\java\org\apache\turbine\services\intake\model\Field.java	Sat Jun  9 14:25:24 2001
@@ -74,7 +74,7 @@
  * Base class for Intake generated input processing classes.
  *
  * @author <a href="mailto:jmcnally@collab.net>John McNally</a>
- * @version $Id: Field.java,v 1.13 2001/05/30 01:08:52 jmcnally Exp $
+ * @version $Id: Field.java,v 1.10.4.5 2001/06/01 01:33:58 jvanzyl Exp $
  */
 public abstract class Field
 {
@@ -84,6 +84,7 @@
     // the following are set from the xml file and are permanent (final)
     protected final String name;
     protected final String key;
+    protected final String displayName;
     protected final String mapToObject;
     protected Validator validator;
     protected final Method getter;
@@ -137,6 +138,7 @@
         this.group = group;
         key = field.getKey();
         name = field.getName();
+        displayName = field.getDisplayName();
         isMultiValued  = field.isMultiValued();
         String className = field.getValidator();
         if ( className == null && field.getRules().size() > 0 ) 
@@ -420,6 +422,29 @@
     }
 
     /**
+     * Get the display name of the field. Useful for building
+     * data entry forms. Returns name of field if no display
+     * name has been assigned to the field by xml input file
+     *
+     * @return a <code>String</code> value
+     */
+    public String getDisplayName()
+    {
+        return (displayName == null) ? name : displayName;
+    }
+
+    /**
+     * Set the display name of the field. Display names are
+     * used in building data entry forms and serve as a 
+     * user friendly description of the data contained in
+     * the field.
+     */
+    public void setDisplayName(String newDisplayName)
+    {
+        this.displayName = newDisplayName;
+    }
+
+    /**
      * Get any error message resulting from invalid input.
      *
      * @return a <code>String</code> value
@@ -486,6 +511,11 @@
                 try
                 {
                     validator.assertValidity(s);
+
+                    if ( set_flag ) 
+                    {
+                        doSetValue(pp);
+                    }                    
                 }
                 catch (ValidationException ve)
                 {
@@ -510,11 +540,6 @@
         }
         */
 
-        if ( set_flag ) 
-        {
-            doSetValue(pp);
-        }
-        
         return valid_flag;
     }
 
--- \java\CVS\jakarta-turbine\src\java\org\apache\turbine\services\intake\model\Group.java	Sat May  5 08:26:58 2001
+++ \java\jakarta-turbine\src\java\org\apache\turbine\services\intake\model\Group.java	Sat Jun  9 14:21:24 2001
@@ -371,6 +371,30 @@
     }
 
     /**
+     * Calls getter methods on objects that are known to Intake
+     * so that field values in forms can be initialized from 
+     * the values contained in the intake tool.
+     */
+    public void getProperties(Object obj)
+        throws Exception
+    {
+        Class cls = obj.getClass();
+        while (cls != null)
+        {
+            Field[] flds = (Field[])mapToObjectFields.get(cls.getName());
+            if( flds != null )
+            {
+                for (int i=flds.length-1; i>=0; i--)
+                {
+                    flds[i].getProperty(obj);
+                }
+            }
+
+            cls = cls.getSuperclass();
+        }
+    }
+
+    /**
      * Removes references to this group and its fields from the 
      * query parameters
      */

