cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r462520 - in /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms: ./ formmodel/
Date Tue, 10 Oct 2006 19:39:16 GMT
Author: vgritsenko
Date: Tue Oct 10 12:39:14 2006
New Revision: 462520

URL: http://svn.apache.org/viewvc?view=rev&rev=462520
Log:
output widget to generate selection list and datatype info (same as field).
cleanup, properties.

Modified:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/FormContext.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AbstractContainerWidget.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AggregateField.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/BooleanField.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/EnhancedRepeater.java   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Field.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMap.java   (contents, props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapDefinition.java   (contents, props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapDefinitionBuilder.java   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapMarker.java   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapValue.java   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Group.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/ImageMap.java   (contents, props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/ImageMapDefinition.java   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/ImageMapDefinitionBuilder.java   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Messages.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/MultiValueField.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Output.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Repeater.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterField.java   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterFieldDefinition.java   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterFieldDefinitionBuilder.java   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Struct.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Union.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Upload.java

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/FormContext.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/FormContext.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/FormContext.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/FormContext.java Tue Oct 10 12:39:14 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,12 +22,12 @@
 
 /**
  * @version $Id$
- * 
  */
 public class FormContext {
-    
+
     protected Request request;
     protected Locale locale;
+
 
     public FormContext(Request request, Locale locale) {
         this.request = request;

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AbstractContainerWidget.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AbstractContainerWidget.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AbstractContainerWidget.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AbstractContainerWidget.java Tue Oct 10 12:39:14 2006
@@ -29,17 +29,18 @@
  *
  * @version $Id$
  */
-public abstract class AbstractContainerWidget extends AbstractWidget implements ContainerWidget {
+public abstract class AbstractContainerWidget extends AbstractWidget
+                                              implements ContainerWidget {
 
     /**
      * List of contained widgets.
      */
     protected WidgetList widgets;
-    
+
     /**
      * validation errors on container widgets
      */
-    protected ValidationError validationError;    
+    protected ValidationError validationError;
 
     /**
      * Constructs AbstractContainerWidget
@@ -59,7 +60,7 @@
         while(it.hasNext()) {
           ((Widget)it.next()).initialize();
         }
-        
+
         super.initialize();
     }
 
@@ -80,11 +81,11 @@
     public Iterator getChildren() {
         return widgets.iterator();
     }
-    
+
     public int getSize() {
         return widgets.getWidgetList().size();
     }
-    
+
     /**
      * Delegates the readFromRequest() down to the contained child-widgets.
      *

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AggregateField.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AggregateField.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AggregateField.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AggregateField.java Tue Oct 10 12:39:14 2006
@@ -26,7 +26,6 @@
 
 import org.apache.cocoon.forms.FormContext;
 import org.apache.cocoon.forms.FormsConstants;
-import org.apache.cocoon.forms.FormsRuntimeException;
 import org.apache.cocoon.forms.formmodel.AggregateFieldDefinition.SplitMapping;
 import org.apache.cocoon.forms.util.I18nMessage;
 import org.apache.cocoon.forms.validation.ValidationError;
@@ -251,6 +250,6 @@
     }
 
     public Widget getChild(String id) {
-        return (Widget)fieldsById.get(id);
+        return (Widget) fieldsById.get(id);
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/BooleanField.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/BooleanField.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/BooleanField.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/BooleanField.java Tue Oct 10 12:39:14 2006
@@ -139,6 +139,7 @@
 
         contentHandler.characters(stringValue.toCharArray(), 0, stringValue.length());
         contentHandler.endElement(FormsConstants.INSTANCE_NS, VALUE_EL, FormsConstants.INSTANCE_PREFIX_COLON + VALUE_EL);
+
         // validation message element: only present if the value is not valid
         if (validationError != null) {
             contentHandler.startElement(FormsConstants.INSTANCE_NS, VALIDATION_MSG_EL, FormsConstants.INSTANCE_PREFIX_COLON + VALIDATION_MSG_EL, XMLUtils.EMPTY_ATTRIBUTES);

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/EnhancedRepeater.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/EnhancedRepeater.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Field.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Field.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Field.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Field.java Tue Oct 10 12:39:14 2006
@@ -54,7 +54,8 @@
  * @version $Id$
  */
 public class Field extends AbstractWidget
-                   implements ValidationErrorAware, DataWidget, SelectableWidget, ValueChangedListenerEnabled {
+                   implements ValidationErrorAware, DataWidget, SelectableWidget,
+                              ValueChangedListenerEnabled {
 
     /**
      * If the field was rendered as a suggestion-list and the user chose one of the suggestions,
@@ -66,70 +67,77 @@
      */
     public static final String SUGGESTED_LABEL_ATTR = "suggested-label";
 
-    private static final String FIELD_EL = "field";
-    private static final String VALUE_EL = "value";
-    private static final String VALIDATION_MSG_EL = "validation-message";
-
-    /** Overrides selection list defined in FieldDefinition, if any. */
-    protected SelectionList selectionList;
-    /** Additional listeners to those defined as part of the widget definition (if any). */
-    private ValueChangedListener listener;
-
-    private final FieldDefinition fieldDefinition;
-
-    protected String enteredValue;
-    protected Object value;
-
-    protected boolean required;
-
     /**
      * Value state indicating that a new value has been read from the request,
      * but has not yet been parsed.
      */
-    protected final static int VALUE_UNPARSED = 0;
+    protected static final int VALUE_UNPARSED = 0;
 
     /**
      * Value state indicating that a value has been parsed, but needs to be
      * validated (that must occur before the value is given to the application)
      */
-    protected final static int VALUE_PARSED = 1;
+    protected static final int VALUE_PARSED = 1;
 
     /**
      * Value state indicating that a parse error was encountered but should not
      * yet be displayed.
      */
-    protected final static int VALUE_PARSE_ERROR = 2;
+    protected static final int VALUE_PARSE_ERROR = 2;
 
     /**
      * Value state indicating that validate() has been called when state was
      * VALUE_PARSE_ERROR. This makes the error visible on output.
      */
-    protected final static int VALUE_DISPLAY_PARSE_ERROR = 3;
+    protected static final int VALUE_DISPLAY_PARSE_ERROR = 3;
 
     /**
      * Transient value state indicating that validation is going on.
      *
      * @see #validate()
      */
-    protected final static int VALUE_VALIDATING = 4;
+    protected static final int VALUE_VALIDATING = 4;
 
     /**
      * Value state indicating that validation has occured, but that any error should not
      * yet be displayed.
      */
-    protected final static int VALUE_VALIDATED = 5;
+    protected static final int VALUE_VALIDATED = 5;
 
     /**
      * Value state indicating that value validation has occured, and the
      * validation error, if any, should be displayed.
      */
-    protected final static int VALUE_DISPLAY_VALIDATION = 6;
+    protected static final int VALUE_DISPLAY_VALIDATION = 6;
+
+    private static final String FIELD_EL = "field";
+    private static final String VALUE_EL = "value";
+    private static final String VALIDATION_MSG_EL = "validation-message";
+
+
+    /**
+     * Definition of the field.
+     */
+    private final FieldDefinition definition;
+
+    /**
+     * Overrides selection list defined in FieldDefinition, if any.
+     */
+    protected SelectionList selectionList;
+
+    /**
+     * Additional listeners to those defined as part of the widget definition (if any).
+     */
+    private ValueChangedListener listener;
+
+    protected String enteredValue;
+    protected Object value;
+
+    protected boolean required;
 
-    // At startup, we have no value to parse (both enteredValue and value are null),
-    // but need to validate (e.g. error if field is required)
     /**
      * Transient widget processing state indicating that the widget is currently validating
-     * (used to avoid endless loops when a validator calls getValue)
+     * (used to avoid endless loops when a validator calls getValue).
      */
     protected int valueState = VALUE_PARSED;
 
@@ -138,25 +146,32 @@
 
     public Field(FieldDefinition fieldDefinition) {
         super(fieldDefinition);
-        this.fieldDefinition = fieldDefinition;
+
+        this.definition = fieldDefinition;
         this.listener = fieldDefinition.getValueChangedListener();
+        /*
+         * At startup, we have no value to parse (both enteredValue and value are null),
+         * but still need to validate (e.g. error if field is required), so initial value
+         * is set to {@link #VALUE_PARSED}.
+         */
+        this.valueState = VALUE_PARSED;
     }
 
-    public final FieldDefinition getFieldDefinition() {
-        return this.fieldDefinition;
+    public WidgetDefinition getDefinition() {
+        return this.definition;
     }
 
-    public WidgetDefinition getDefinition() {
-        return this.fieldDefinition;
+    public final FieldDefinition getFieldDefinition() {
+        return this.definition;
     }
 
     public void initialize() {
-        Object value = this.fieldDefinition.getInitialValue();
+        Object value = this.definition.getInitialValue();
         if (value != null) {
             setValue(value);
         }
-        this.selectionList = this.fieldDefinition.getSelectionList();
-        this.required = this.fieldDefinition.isRequired();
+        this.selectionList = this.definition.getSelectionList();
+        this.required = this.definition.isRequired();
         super.initialize();
     }
 
@@ -178,7 +193,7 @@
      * @since 2.1.9
      */
     public void setSuggestionLabel(String label) {
-        if (this.fieldDefinition.getSuggestionList() == null) {
+        if (this.definition.getSuggestionList() == null) {
             throw new FormsRuntimeException("Field '" + getRequestParameterName() + "' has no suggestion list.",
                                             getLocation());
         }
@@ -193,7 +208,7 @@
      *         if there's not suggestion list.
      */
     public String getSuggestionLabel() {
-        return (String)this.getAttribute(SUGGESTED_LABEL_ATTR);
+        return (String) getAttribute(SUGGESTED_LABEL_ATTR);
     }
 
     public Object getValue() {
@@ -278,7 +293,7 @@
 
         String newEnteredValue = request.getParameter(paramName);
 
-        if (this.fieldDefinition.getSuggestionList() != null) {
+        if (this.definition.getSuggestionList() != null) {
             // The Dojo ComboBox sends the typed value or the chosen item's label in the
             // request parameter and sends an additional "*_selected" parameter containing
             // the value of the chosen item (if any).
@@ -541,7 +556,7 @@
         }
 
         // include some info about the datatype
-        fieldDefinition.getDatatype().generateSaxFragment(contentHandler, locale);
+        definition.getDatatype().generateSaxFragment(contentHandler, locale);
     }
 
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Form.java Tue Oct 10 12:39:14 2006
@@ -59,23 +59,24 @@
     private Locale locale = Locale.getDefault();
     private FormHandler formHandler;
     private Widget submitWidget;
-    private ProcessingPhase phase = ProcessingPhase.LOAD_MODEL;
-    private boolean isValid = false;
+    private boolean isValid;
     private ProcessingPhaseListener listener;
 
     //In the "readFromRequest" phase, events are buffered to ensure that all widgets had the chance
     //to read their value before events get fired.
-    private boolean bufferEvents = false;
+    private boolean bufferEvents;
     private CursorableLinkedList events;
 
-    // Widgets that need to be updated in the client when in AJAX mode
+    /** Widgets that need to be updated in the client when in AJAX mode */
     private Set updatedWidgets;
-    // Widgets that have at least one descendant that has to be updated
+
+    /** Widgets that have at least one descendant that has to be updated */
     private Set childUpdatedWidgets;
 
-    // Optional id which overrides the value from the form definition
+    /** Optional id which overrides the value from the form definition */
     private String id;
 
+
     public Form(FormDefinition definition) {
         super(definition);
         this.definition = definition;
@@ -309,8 +310,6 @@
         // Fire the binding phase events
         fireEvents();
 
-        this.phase = ProcessingPhase.PROCESSING_INITIALIZE;
-
         // setup processing
         this.submitWidget = null;
         this.locale = formContext.getLocale();
@@ -319,15 +318,12 @@
 
         // Notify the end of the current phase
         if (this.listener != null) {
-            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
+            this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.PROCESSING_INITIALIZE));
         }
 
-        this.phase = ProcessingPhase.READ_FROM_REQUEST;
-
         try {
             // Start buffering events
             this.bufferEvents = true;
-
             this.submitWidget = null;
 
             doReadFromRequest(formContext);
@@ -365,8 +361,9 @@
 
         // Notify the end of the current phase
         if (this.listener != null) {
-            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
+            this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.READ_FROM_REQUEST));
         }
+
         if (this.endProcessing != null) {
             return this.endProcessing.booleanValue();
         }
@@ -383,7 +380,7 @@
         // Set the indicator that terminates the form processing.
         // If redisplayForm is true, interaction is not finished and process() must
         // return false, hence the negation below.
-        this.endProcessing = BooleanUtils.toBooleanObject( !redisplayForm );
+        this.endProcessing = BooleanUtils.toBooleanObject(!redisplayForm);
     }
 
     /**
@@ -426,7 +423,6 @@
      */
     public boolean validate() {
         // Validate the form
-        this.phase = ProcessingPhase.VALIDATE;
         this.isValid = super.validate();
 
         // FIXME: Is this check needed, before invoking the listener?
@@ -437,8 +433,9 @@
 
         // Notify the end of the current phase
         if (this.listener != null) {
-            this.listener.phaseEnded(new ProcessingPhaseEvent(this, this.phase));
+            this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.VALIDATE));
         }
+
         if (this.endProcessing != null) {
             // De-validate the form if one of the listeners asked to end the processing
             // This allows for additional application-level validation.
@@ -446,6 +443,7 @@
             this.wasValid = this.endProcessing.booleanValue();
             return this.wasValid;
         }
+
         this.wasValid = this.isValid && this.validationError == null;
         return this.wasValid;
     }
@@ -458,7 +456,7 @@
      * @see org.apache.cocoon.forms.formmodel.AbstractWidget#getId()
      */
     public String getId() {
-        if ( this.id != null ) {
+        if (this.id != null) {
             return this.id;
         }
         return super.getId();

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMap.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMap.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMap.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMap.java Tue Oct 10 12:39:14 2006
@@ -24,10 +24,13 @@
 import org.apache.cocoon.forms.event.ValueChangedEvent;
 import org.apache.cocoon.forms.event.WidgetEvent;
 import org.apache.cocoon.xml.AttributesImpl;
-import org.xml.sax.Attributes;
+
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 
+/**
+ * @version $Id$
+ */
 public class GoogleMap extends AbstractWidget   {
 
     private static final String GOOGLEMAP_FIELD_EL = "googlemap";
@@ -39,7 +42,7 @@
 
     private GoogleMapValue value;
     private final GoogleMapDefinition definition;
-    
+
 
     public GoogleMap(GoogleMapDefinition definition) {
         super(definition);
@@ -63,38 +66,38 @@
             return;
         }
 
-        GoogleMapValue oldValue = value;
-        String paramLng = formContext.getRequest().getParameter(getRequestParameterName()+"_lng");
-        String paramLat = formContext.getRequest().getParameter(getRequestParameterName()+"_lat");
-        String paramZoom = formContext.getRequest().getParameter(getRequestParameterName()+"_zoom");
-        String currentMarker = formContext.getRequest().getParameter(getRequestParameterName()+"_current");
-        String userMarkerLng = formContext.getRequest().getParameter(getRequestParameterName()+"_usermarker-lng");
-        String userMarkerLat = formContext.getRequest().getParameter(getRequestParameterName()+"_usermarker-lat");
-        
-        GoogleMapValue googleMapValue = new GoogleMapValue();
-        googleMapValue.setLng(Float.valueOf(paramLng).floatValue());
-        googleMapValue.setLat(Float.valueOf(paramLat).floatValue());
-        googleMapValue.setZoom(Integer.valueOf(paramZoom).intValue());
-        googleMapValue.setCurrentMarker(Integer.valueOf(currentMarker).intValue());
-        googleMapValue.setMarkers(this.value.getMarkers());
-        
+        final String prefix = getRequestParameterName();
+        String paramLng = formContext.getRequest().getParameter(prefix + "_lng");
+        String paramLat = formContext.getRequest().getParameter(prefix + "_lat");
+        String paramZoom = formContext.getRequest().getParameter(prefix + "_zoom");
+        String currentMarker = formContext.getRequest().getParameter(prefix + "_current");
+        String userMarkerLng = formContext.getRequest().getParameter(prefix + "_usermarker-lng");
+        String userMarkerLat = formContext.getRequest().getParameter(prefix + "_usermarker-lat");
+
+        GoogleMapValue newValue = new GoogleMapValue();
+        newValue.setLng(Float.valueOf(paramLng).floatValue());
+        newValue.setLat(Float.valueOf(paramLat).floatValue());
+        newValue.setZoom(Integer.valueOf(paramZoom).intValue());
+        newValue.setCurrentMarker(Integer.valueOf(currentMarker).intValue());
+        newValue.setMarkers(this.value.getMarkers());
+
         if (userMarkerLng != null && userMarkerLat != null) {
-            GoogleMapMarker usermarker = new GoogleMapMarker();
             try {
-                usermarker.setLng(Float.valueOf(userMarkerLng).floatValue());
-                usermarker.setLat(Float.valueOf(userMarkerLat).floatValue());
-            } catch (NumberFormatException e) {}
-            googleMapValue.setUsermarker(usermarker);
-        }
-        
-        value = googleMapValue;
-        
+                GoogleMapMarker marker = new GoogleMapMarker();
+                marker.setLng(Float.valueOf(userMarkerLng).floatValue());
+                marker.setLat(Float.valueOf(userMarkerLat).floatValue());
+                newValue.setUsermarker(marker);
+            } catch (NumberFormatException e) { /* ignored */ }
+        }
+
+        GoogleMapValue oldValue = this.value;
+        value = newValue;
+
         if (!value.equals(oldValue)) {
             getForm().addWidgetEvent(new ValueChangedEvent(this, oldValue, value));
         }
     }
 
-
     /**
      * @return "googlemap"
      */
@@ -102,11 +105,6 @@
         return GOOGLEMAP_FIELD_EL;
     }
 
-    protected AttributesImpl getXMLElementAttributes() {
-        AttributesImpl attrs = super.getXMLElementAttributes();
-        return attrs;
-    }
-
     public void generateItemSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException {
         // value element
         AttributesImpl attributesImpl = new AttributesImpl();
@@ -114,9 +112,9 @@
         attributesImpl.addAttribute("","lat","lat","CDATA",this.value.getLat()+"");
         attributesImpl.addAttribute("","zoom","zoom","CDATA",this.value.getZoom()+"");
         attributesImpl.addAttribute("","current","current","CDATA",this.value.getCurrentMarker()+"");
-        
+
         contentHandler.startElement(FormsConstants.INSTANCE_NS, VALUE_EL, FormsConstants.INSTANCE_PREFIX_COLON + VALUE_EL, attributesImpl);
-        
+
         // usermarker
         if (this.value.getUsermarker() != null) {
             attributesImpl = new AttributesImpl();
@@ -125,7 +123,7 @@
             contentHandler.startElement(FormsConstants.INSTANCE_NS, USERMARKER_EL, FormsConstants.INSTANCE_PREFIX_COLON + USERMARKER_EL, attributesImpl);
             contentHandler.endElement(FormsConstants.INSTANCE_NS, USERMARKER_EL, FormsConstants.INSTANCE_PREFIX_COLON + USERMARKER_EL);
         }
-        
+
         // markers
         List markers = this.value.getMarkers();
         if (markers != null) {
@@ -139,7 +137,7 @@
                 contentHandler.startElement(FormsConstants.INSTANCE_NS, MARKER_TEXT_EL, FormsConstants.INSTANCE_PREFIX_COLON + MARKER_TEXT_EL, new AttributesImpl());
                 marker.getText().toSAX(contentHandler);
                 contentHandler.endElement(FormsConstants.INSTANCE_NS, MARKER_TEXT_EL, FormsConstants.INSTANCE_PREFIX_COLON + MARKER_TEXT_EL);
-                contentHandler.endElement(FormsConstants.INSTANCE_NS, MARKER_EL, FormsConstants.INSTANCE_PREFIX_COLON + MARKER_EL);    
+                contentHandler.endElement(FormsConstants.INSTANCE_NS, MARKER_EL, FormsConstants.INSTANCE_PREFIX_COLON + MARKER_EL);
             }
             contentHandler.endElement(FormsConstants.INSTANCE_NS, MARKERS_EL, FormsConstants.INSTANCE_PREFIX_COLON + MARKERS_EL);
         }
@@ -155,7 +153,6 @@
      * (see class comment).
      */
     public void setValue(Object object) {
-        
         if (!(object instanceof GoogleMapValue)) {
             throw new RuntimeException("Cannot set value of googlemap \"" + getRequestParameterName() + "\" to a non-GoogleMapValue.");
         }
@@ -167,7 +164,7 @@
             form.addWidgetUpdate(this);
         }
     }
-    
+
     public void broadcastEvent(WidgetEvent event) {
         if (event instanceof ValueChangedEvent) {
             //

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMap.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapDefinition.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapDefinition.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapDefinition.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapDefinition.java Tue Oct 10 12:39:14 2006
@@ -1,12 +1,12 @@
 /*
  * Copyright 1999-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,41 +15,42 @@
  */
 package org.apache.cocoon.forms.formmodel;
 
+import org.apache.cocoon.forms.FormsException;
+
 /**
  * The {@link WidgetDefinition} part of a GoogleMap widget, see {@link GoogleMap} for more information.
  */
 public class GoogleMapDefinition extends AbstractWidgetDefinition {
-    
+
     private GoogleMapValue initialValue;
-    
+
 
     public Widget createInstance() {
         return new GoogleMap(this);
     }
-    
+
     /**
      * initialize this definition with the other, sort of like a copy constructor
      */
     public void initializeFrom(WidgetDefinition definition) throws Exception {
-    	super.initializeFrom(definition);
-    	
-    	if(definition instanceof GoogleMapDefinition) {
-            GoogleMapDefinition other = (GoogleMapDefinition)definition;
-    		
-    		this.initialValue = other.initialValue;
-    		
-    	} else {
-    		throw new Exception("Definition to inherit from is not of the right type! (at "+getLocation()+")");
-    	}
+        super.initializeFrom(definition);
+
+        if (!(definition instanceof GoogleMapDefinition)) {
+            throw new FormsException("Ancestor definition " + definition.getClass().getName() + " is not a GoogleMapDefinition.",
+                                     getLocation());
+        }
+
+        GoogleMapDefinition other = (GoogleMapDefinition) definition;
+
+        this.initialValue = other.initialValue;
     }
-    
+
     public void setInitialValue(GoogleMapValue value) {
         checkMutable();
         this.initialValue = value;
     }
-    
+
     public GoogleMapValue getInitialValue() {
         return this.initialValue;
     }
-    
 }

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapDefinition.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapDefinition.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapMarker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapMarker.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapValue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/GoogleMapValue.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Group.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Group.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Group.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Group.java Tue Oct 10 12:39:14 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,24 +23,26 @@
  * @version $Id$
  */
 public class Group extends AbstractContainerWidget {
+
     private static final String GROUP_EL = "group";
-    
-    private final GroupDefinition definition; 
+
+    private final GroupDefinition definition;
+
 
     public Group(GroupDefinition definition) {
         super(definition);
         this.definition = definition;
     }
-    
+
     public WidgetDefinition getDefinition() {
         return this.definition;
     }
-    
+
     /**
      * @return "group"
      */
     public String getXMLElementName() {
         return GROUP_EL;
     }
-    
+
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/ImageMap.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/ImageMap.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/ImageMap.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/ImageMap.java Tue Oct 10 12:39:14 2006
@@ -34,18 +34,19 @@
  */
 public class ImageMap extends AbstractWidget implements ActionListenerEnabled {
 
-    private final ImageMapDefinition definition;
-    private ActionListener listener;
-    private String imgURI; // URI of widget's image
-    private int x; // Mouse x coordinate
-    private int y; // Mouse y coordinate
-
     // XML element and attributes
     public static final String COMMAND_AT = "command";
     public static final String VALUE_EL = "imageuri";
     public static final String ONACTION_EL = "on-action";
     public static final String IMAGEMAP_EL = "imagemap";
 
+    private final ImageMapDefinition definition;
+    private ActionListener listener;
+    private String imgURI; // URI of widget's image
+    private int x; // Mouse x coordinate
+    private int y; // Mouse y coordinate
+
+    
     public ImageMap(ImageMapDefinition definition) {
         super(definition);
         this.definition = definition;

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/ImageMap.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/ImageMapDefinition.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/ImageMapDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Messages.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Messages.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Messages.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Messages.java Tue Oct 10 12:39:14 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,19 +34,22 @@
  *
  * <p>This widget is typically used to communicate extra validation errors or other messages
  * to the user, that aren't associated with any other widget in particular.
- * 
+ *
  * @version $Id$
  */
 public class Messages extends AbstractWidget {
-    private ArrayList messages = new ArrayList();
-    private final MessagesDefinition definition;
 
     private static final String MESSAGES_EL = "messages";
     private static final String MESSAGE_EL = "message";
 
+    private final MessagesDefinition definition;
+    private ArrayList messages;
+
+
     protected Messages(MessagesDefinition definition) {
         super(definition);
         this.definition = definition;
+        this.messages = new ArrayList();
     }
 
     public WidgetDefinition getDefinition() {
@@ -87,18 +90,18 @@
         messages.add(message);
         getForm().addWidgetUpdate(this);
     }
-    
+
     /**
      * @return "messages"
      */
     public String getXMLElementName() {
         return MESSAGES_EL;
     }
-    
+
     public void generateItemSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException {
-        Iterator messagesIt = messages.iterator();
-        while (messagesIt.hasNext()) {
-            XMLizable message = (XMLizable)messagesIt.next();
+        Iterator i = messages.iterator();
+        while (i.hasNext()) {
+            XMLizable message = (XMLizable) i.next();
             contentHandler.startElement(FormsConstants.INSTANCE_NS, MESSAGE_EL, FormsConstants.INSTANCE_PREFIX_COLON + MESSAGE_EL, XMLUtils.EMPTY_ATTRIBUTES);
             message.toSAX(contentHandler);
             contentHandler.endElement(FormsConstants.INSTANCE_NS, MESSAGE_EL, FormsConstants.INSTANCE_PREFIX_COLON + MESSAGE_EL);

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/MultiValueField.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/MultiValueField.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/MultiValueField.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/MultiValueField.java Tue Oct 10 12:39:14 2006
@@ -51,7 +51,8 @@
  * @version $Id$
  */
 public class MultiValueField extends AbstractWidget
-                             implements ValidationErrorAware, SelectableWidget, DataWidget, ValueChangedListenerEnabled {
+                             implements ValidationErrorAware, SelectableWidget, DataWidget,
+                                        ValueChangedListenerEnabled {
 
     private static final String MULTIVALUEFIELD_EL = "multivaluefield";
     private static final String VALUES_EL = "values";
@@ -67,6 +68,7 @@
     private ValidationError validationError;
     private ValueChangedListener listener;
 
+
     public MultiValueField(MultiValueFieldDefinition definition) {
         super(definition);
         this.definition = definition;
@@ -83,8 +85,9 @@
     }
 
     public void readFromRequest(FormContext formContext) {
-        if (!getCombinedState().isAcceptingInputs())
+        if (!getCombinedState().isAcceptingInputs()) {
             return;
+        }
 
         enteredValues = formContext.getRequest().getParameterValues(getRequestParameterName());
         invalidEnteredValue = null;
@@ -184,16 +187,20 @@
         }
         contentHandler.endElement(FormsConstants.INSTANCE_NS, VALUES_EL, FormsConstants.INSTANCE_PREFIX_COLON + VALUES_EL);
 
-        // the selection list
-        if (this.selectionList != null)
-            this.selectionList.generateSaxFragment(contentHandler, locale);
-
         // validation message element
         if (validationError != null) {
             contentHandler.startElement(FormsConstants.INSTANCE_NS, VALIDATION_MSG_EL, FormsConstants.INSTANCE_PREFIX_COLON + VALIDATION_MSG_EL, XMLUtils.EMPTY_ATTRIBUTES);
             validationError.generateSaxFragment(contentHandler);
             contentHandler.endElement(FormsConstants.INSTANCE_NS, VALIDATION_MSG_EL, FormsConstants.INSTANCE_PREFIX_COLON + VALIDATION_MSG_EL);
         }
+
+        // the selection list
+        if (this.selectionList != null) {
+            this.selectionList.generateSaxFragment(contentHandler, locale);
+        }
+
+        // include some info about the datatype
+        definition.getDatatype().generateSaxFragment(contentHandler, locale);
     }
 
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Output.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Output.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Output.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Output.java Tue Oct 10 12:39:14 2006
@@ -21,6 +21,7 @@
 import org.apache.cocoon.forms.FormsConstants;
 import org.apache.cocoon.forms.FormContext;
 import org.apache.cocoon.forms.datatype.Datatype;
+import org.apache.cocoon.forms.datatype.SelectionList;
 import org.apache.cocoon.forms.event.ValueChangedEvent;
 import org.apache.cocoon.forms.event.ValueChangedListener;
 import org.apache.cocoon.forms.event.ValueChangedListenerEnabled;
@@ -40,19 +41,13 @@
  *
  * @version $Id$
  */
-public class Output extends AbstractWidget implements DataWidget, ValueChangedListenerEnabled {
+public class Output extends AbstractWidget
+                    implements DataWidget, ValueChangedListenerEnabled {
 
     private final OutputDefinition definition;
     private Object value;
     private ValueChangedListener listener;
 
-    public OutputDefinition getOutputDefinition() {
-        return definition;
-    }
-
-    public Datatype getDatatype() {
-        return definition.getDatatype();
-    }
 
     public Output(OutputDefinition definition) {
         super(definition);
@@ -60,10 +55,18 @@
         this.listener = definition.getValueChangedListener();
     }
 
+    public Datatype getDatatype() {
+        return definition.getDatatype();
+    }
+
     public WidgetDefinition getDefinition() {
         return definition;
     }
 
+    public OutputDefinition getOutputDefinition() {
+        return definition;
+    }
+
     public void initialize() {
         Object value = this.definition.getInitialValue();
         if (value != null) {
@@ -110,6 +113,15 @@
             contentHandler.characters(stringValue.toCharArray(), 0, stringValue.length());
             contentHandler.endElement(FormsConstants.INSTANCE_NS, VALUE_EL, FormsConstants.INSTANCE_PREFIX_COLON + VALUE_EL);
         }
+
+        // generate selection list, if any
+        SelectionList selectionList = definition.getSelectionList();
+        if (selectionList != null) {
+            selectionList.generateSaxFragment(contentHandler, locale);
+        }
+
+        // include some info about the datatype
+        definition.getDatatype().generateSaxFragment(contentHandler, locale);
     }
 
     public Object getValue() {

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Repeater.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Repeater.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Repeater.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Repeater.java Tue Oct 10 12:39:14 2006
@@ -112,7 +112,7 @@
         broadcastEvent(new RepeaterEvent(this, RepeaterEventAction.ROW_ADDED, rows.size() - 1));
         return repeaterRow;
     }
-    
+
     public RepeaterRow addRow(int index) {
         RepeaterRow repeaterRow = new RepeaterRow(definition);
         if (index >= this.rows.size()) {
@@ -586,9 +586,9 @@
         public void initialize() {
             // Initialize children but don't call super.initialize() that would call the repeater's
             // on-create handlers for each row.
-            Iterator it = this.getChildren();
-            while(it.hasNext()) {
-              ((Widget)it.next()).initialize();
+            Iterator i = getChildren();
+            while (i.hasNext()) {
+                ((Widget) i.next()).initialize();
             }
         }
 
@@ -609,13 +609,13 @@
         }
 
         public void generateDisplayData(ContentHandler contentHandler)
-                throws SAXException {
+        throws SAXException {
             // this widget has its display-data generated in the context of the repeater
         }
 
         public void broadcastEvent(WidgetEvent event) {
             throw new UnsupportedOperationException("Widget " + this + " doesn't handle events.");
         }
-    }	
-    
+    }
+
 }

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterField.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterField.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterFieldDefinition.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterFieldDefinition.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterFieldDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterFieldDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Struct.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Struct.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Struct.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Struct.java Tue Oct 10 12:39:14 2006
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,16 +16,16 @@
  */
 package org.apache.cocoon.forms.formmodel;
 
-
 /**
  * A container {@link Widget} which can hold zero or more child widgets.
- * 
+ *
  * @deprecated replaced by {@link Group}
  * @version $Id$
  */
 public class Struct extends Group {
+
     private static final String STRUCT_EL = "struct";
-    
+
     public Struct(GroupDefinition definition) {
         super(definition);
     }
@@ -36,5 +36,4 @@
     public String getXMLElementName() {
         return STRUCT_EL;
     }
-    
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Union.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Union.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Union.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Union.java Tue Oct 10 12:39:14 2006
@@ -44,6 +44,7 @@
 
     private final UnionDefinition definition;
 
+
     public Union(UnionDefinition definition) {
         super(definition);
         this.definition = definition;
@@ -68,7 +69,7 @@
                                             getLocation());
         }
 
-        ((ValueChangedListenerEnabled)caseWidget).addValueChangedListener(
+        ((ValueChangedListenerEnabled) caseWidget).addValueChangedListener(
             new ValueChangedListener() {
                 public void valueChanged(ValueChangedEvent event) {
                     String newValue = (String)event.getNewValue();
@@ -135,6 +136,7 @@
             this.wasValid = true;
             return true;
         }
+
         Widget widget;
         boolean valid = true;
         // Read current case from request

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Upload.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Upload.java?view=diff&rev=462520&r1=462519&r2=462520
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Upload.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/Upload.java Tue Oct 10 12:39:14 2006
@@ -59,23 +59,24 @@
     private static final String VALUE_EL = "value";
     private static final String VALIDATION_MSG_EL = "validation-message";
 
-    private final UploadDefinition uploadDefinition;
+    private final UploadDefinition definition;
     private Part part;
     private ValidationError validationError;
     private ValueChangedListener listener;
 
+
     public Upload(UploadDefinition uploadDefinition) {
         super(uploadDefinition);
-        this.uploadDefinition = uploadDefinition;
+        this.definition = uploadDefinition;
         this.listener = uploadDefinition.getValueChangedListener();
     }
 
-    public UploadDefinition getUploadDefinition() {
-        return this.uploadDefinition;
+    public WidgetDefinition getDefinition() {
+        return this.definition;
     }
 
-    public WidgetDefinition getDefinition() {
-        return this.uploadDefinition;
+    public UploadDefinition getUploadDefinition() {
+        return this.definition;
     }
 
     public Object getValue() {
@@ -153,7 +154,7 @@
     }
 
     private boolean validateMimeType() {
-        String mimeTypes = this.uploadDefinition.getMimeTypes();
+        String mimeTypes = this.definition.getMimeTypes();
         if (mimeTypes != null) {
             StringTokenizer tok = new StringTokenizer(mimeTypes, ", ");
             String contentType = this.part.getMimeType();
@@ -198,7 +199,7 @@
         }
 
         if (this.part == null) {
-            if (this.uploadDefinition.isRequired()) {
+            if (this.definition.isRequired()) {
                 I18nMessage i18nMessage = new I18nMessage("general.field-required", FormsConstants.I18N_CATALOGUE);
                 setValidationError(new ValidationError(i18nMessage));
             }
@@ -272,9 +273,9 @@
     public AttributesImpl getXMLElementAttributes() {
         AttributesImpl attrs = super.getXMLElementAttributes();
         attrs.addCDATAAttribute("id", getRequestParameterName());
-        attrs.addCDATAAttribute("required", String.valueOf(this.uploadDefinition.isRequired()));
-        if (this.uploadDefinition.getMimeTypes() != null) {
-            attrs.addCDATAAttribute("mime-types", this.uploadDefinition.getMimeTypes());
+        attrs.addCDATAAttribute("required", String.valueOf(this.definition.isRequired()));
+        if (this.definition.getMimeTypes() != null) {
+            attrs.addCDATAAttribute("mime-types", this.definition.getMimeTypes());
         }
         return attrs;
     }



Mime
View raw message