cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: rev 54862 - in cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms: datatype formmodel
Date Fri, 15 Oct 2004 18:25:54 GMT
Author: vgritsenko
Date: Fri Oct 15 11:25:54 2004
New Revision: 54862

Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/EnumSelectionList.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListBuilder.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Field.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/MultiValueField.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinitionBuilder.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinitionBuilder.java
Log:
Namespace prefix change: wd -> fd, wi -> fi


Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java
Fri Oct 15 11:25:54 2004
@@ -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.
@@ -38,19 +38,21 @@
 /**
  * Builds {@link SelectionList}s from an XML description or an URL.
  *
- * <p>Note: the class {@link DynamicSelectionList} also interprets the same wd:selection-list
XML, so if
- * anything changes here to how that XML is interpreted, it also needs to change over there
and vice versa.
- * 
- * @version CVS $Id: DefaultSelectionListBuilder.java,v 1.4 2004/05/06 14:59:44 bruno Exp
$
+ * <p>Note: the class {@link DynamicSelectionList} also interprets the same
+ * <code>fd:selection-list</code> XML, so if anything changes here to how
+ * that XML is interpreted, it also needs to change over there and vice
+ * versa.</p>
+ *
+ * @version CVS $Id$
  */
 public class DefaultSelectionListBuilder implements SelectionListBuilder, Serviceable {
-    
+
     private ServiceManager serviceManager;
 
     public void service(ServiceManager manager) throws ServiceException {
         this.serviceManager = manager;
     }
-    
+
     public SelectionList build(Element selectionListElement, Datatype datatype) throws Exception
{
         SelectionList selectionList;
         String src = selectionListElement.getAttribute("src");
@@ -66,10 +68,10 @@
             // selection list is defined inline
             selectionList = buildStaticList(selectionListElement, datatype);
         }
-        
+
         return selectionList;
     }
-   
+
     private  SelectionList buildStaticList(Element selectionListElement, Datatype datatype)
throws Exception {
         StaticSelectionList selectionList = new StaticSelectionList(datatype);
         Convertor convertor = null;
@@ -127,8 +129,12 @@
             inputSource.setSystemId(source.getURI());
             Document document = DomHelper.parse(inputSource);
             Element selectionListElement = document.getDocumentElement();
-            if (!Constants.DEFINITION_NS.equals(selectionListElement.getNamespaceURI()) ||
!"selection-list".equals(selectionListElement.getLocalName()))
-                throw new Exception("Excepted a wd:selection-list element at " + DomHelper.getLocation(selectionListElement));
+            if (!Constants.DEFINITION_NS.equals(selectionListElement.getNamespaceURI()) ||
+                    !"selection-list".equals(selectionListElement.getLocalName())) {
+                throw new Exception("Excepted a fd:selection-list element at " +
+                                    DomHelper.getLocation(selectionListElement));
+            }
+
             return selectionListElement;
         } finally {
             if (source != null) {

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java
Fri Oct 15 11:25:54 2004
@@ -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.
@@ -39,10 +39,11 @@
  * SelectionList implementation that always reads its content from the source
  * each time it is requested.
  *
- * <p>Note: the class {@link SelectionListBuilder} also interprets the same wd:selection-list
XML, so if
- * anything changes here to how that XML is interpreted, it also needs to change over there
and vice versa.
- * 
- * @version $Id: DynamicSelectionList.java,v 1.3 2004/05/06 14:59:44 bruno Exp $
+ * <p>Note: the class {@link SelectionListBuilder} also interprets the same
+ * <code>fd:selection-list</code> XML, so if anything changes here to how that
+ * XML is interpreted, it also needs to change over there and vice versa.</p>
+ *
+ * @version $Id$
  */
 public class DynamicSelectionList implements SelectionList {
     private String src;
@@ -61,9 +62,10 @@
 
     /*
      * This method is only used by a test case and by the public version
-     * of generateSaxFragment. 
+     * of generateSaxFragment.
      */
-    void generateSaxFragment(ContentHandler contentHandler, Locale locale, Source source)
throws ProcessingException, SAXException, IOException {
+    void generateSaxFragment(ContentHandler contentHandler, Locale locale, Source source)
+    throws ProcessingException, SAXException, IOException {
         SelectionListHandler handler = new SelectionListHandler(locale);
         handler.setContentHandler(contentHandler);
         SourceUtil.toSAX(serviceManager, source, null, handler);

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/EnumSelectionList.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/EnumSelectionList.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/EnumSelectionList.java
Fri Oct 15 11:25:54 2004
@@ -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.
@@ -30,34 +30,36 @@
  * corresponding to the possible instances of an {@link org.apache.cocoon.forms.datatype.typeimpl.EnumType}.
  * <p>Example usage:</p>
  * <pre>
- * &lt;wd:selection-list type="enum" class="com.example.Sex"/>
+ * &lt;fd:selection-list type="enum" class="com.example.Sex"/&gt;
  * </pre>
  * <p>Produces the following output:</p>
  * <pre>
- * &lt;wi:selection-list>
- *   &lt;wi:item value=""/>
- *   &lt;wi:item value="com.example.Sex.MALE">
- *     &lt;wi:label>
- *       &lt;i18n:text>com.example.Sex.MALE</i18n:text>
- *     &lt;/wi:label>
- *   &lt;/wi:item>
- *   &lt;wi:item value="com.example.Sex.FEMALE">
- *     &lt;wi:label>
- *       &lt;i18n:text>com.example.Sex.FEMALE</i18n:text>
- *     &lt;/wi:label>
- *   &lt;/wi:item>
- * &lt;/wi:selection-list>
+ * &lt;fi:selection-list&gt;
+ *   &lt;fi:item value=""/&gt;
+ *   &lt;fi:item value="com.example.Sex.MALE"&gt;
+ *     &lt;fi:label&gt;
+ *       &lt;i18n:text&gt;com.example.Sex.MALE&lt;/i18n:text&gt;
+ *     &lt;/fi:label&gt;
+ *   &lt;/fi:item&gt;
+ *   &lt;fi:item value="com.example.Sex.FEMALE"&gt;
+ *     &lt;fi:label&gt;
+ *       &lt;i18n:text&gt;com.example.Sex.FEMALE&lt;/i18n:text&gt;
+ *     &lt;/fi:label&gt;
+ *   &lt;/fi:item&gt;
+ * &lt;/fi:selection-list&gt;
  * </pre>
- * <p>If you don't want an initial null value, add a nullable="false"
- * attribute to the wd:selection-list element.
- * 
- * @version CVS $Id: EnumSelectionList.java,v 1.4 2004/03/09 13:17:26 cziegeler Exp $
+ *
+ * <p>If you don't want an initial null value, add a
+ * <code>nullable="false"</code> attribute to the
+ * <code>fd:selection-list</code> element.</p>
+ *
+ * @version CVS $Id$
  */
 public class EnumSelectionList implements SelectionList {
     public static final String I18N_NS = "http://apache.org/cocoon/i18n/2.1";
     public static final String I18N_PREFIX_COLON = "i18n:";
     public static final String TEXT_EL = "text";
-    
+
     private Datatype datatype;
     private Class clazz;
     private boolean nullable;
@@ -82,10 +84,9 @@
     /* (non-Javadoc)
      * @see org.apache.cocoon.forms.datatype.SelectionList#generateSaxFragment(org.xml.sax.ContentHandler,
java.util.Locale)
      */
-    public void generateSaxFragment(
-        ContentHandler contentHandler,
-        Locale locale)
-        throws SAXException {
+    public void generateSaxFragment(ContentHandler contentHandler,
+                                    Locale locale)
+    throws SAXException {
         try {
             contentHandler.startElement(Constants.INSTANCE_NS, SELECTION_LIST_EL, Constants.INSTANCE_PREFIX_COLON
+ SELECTION_LIST_EL, XMLUtils.EMPTY_ATTRIBUTES);
             Field fields[] = clazz.getDeclaredFields();
@@ -95,7 +96,7 @@
                 voidAttrs.addCDATAAttribute("value", "");
                 contentHandler.startElement(Constants.INSTANCE_NS, ITEM_EL, Constants.INSTANCE_PREFIX_COLON
+ ITEM_EL, voidAttrs);
                 contentHandler.endElement(Constants.INSTANCE_NS, ITEM_EL, Constants.INSTANCE_PREFIX_COLON
+ ITEM_EL);
-            }            
+            }
             for (int i = 0 ; i < fields.length ; ++i) {
                 int mods = fields[i].getModifiers();
                 if (Modifier.isPublic(mods) && Modifier.isStatic(mods)
@@ -120,5 +121,4 @@
             throw new SAXException("Got exception trying to get enum's values", e);
         }
     }
-
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListBuilder.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListBuilder.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListBuilder.java
Fri Oct 15 11:25:54 2004
@@ -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.
@@ -22,14 +22,15 @@
 import org.w3c.dom.Element;
 
 /**
- * Builds a selection list that will take its values from the flow page data. The items list
and,
- * for each item, its value and label, are fetched using JXPath expressions.
- * <p>
- * If an item has no label, its value is used as the label.
- * <p>
- * Example:
+ * Builds a selection list that will take its values from the flow page data.
+ * The items list and, for each item, its value and label, are fetched using
+ * JXPath expressions.
+ *
+ * <p>If an item has no label, its value is used as the label.
+ *
+ * <p>Example:
  * <pre>
- *   &lt;wd:selection-list type="flow-jxpath"
+ *   &lt;fd:selection-list type="flow-jxpath"
  *       list-path="selectList" value-path="value" label-path="label"/gt;
  * </pre>
  * Flow script:
@@ -39,25 +40,25 @@
  *   };
  *   form.showForm("form.html", data);
  * </pre>
- * 
+ *
  * @see org.apache.cocoon.forms.datatype.FlowJXPathSelectionList
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
- * @version CVS $Id: FlowJXPathSelectionListBuilder.java,v 1.2 2004/03/09 11:31:11 joerg
Exp $
+ * @version CVS $Id$
  */
 public class FlowJXPathSelectionListBuilder implements SelectionListBuilder, Contextualizable
{
 
     private Context context;
-    
+
     public void contextualize(Context context) throws ContextException {
         this.context = context;
     }
 
     public SelectionList build(Element selectionListElement, Datatype datatype) throws Exception
{
-        
+
         String listPath = DomHelper.getAttribute(selectionListElement, "list-path");
         String keyPath = DomHelper.getAttribute(selectionListElement, "value-path");
         String valuePath = DomHelper.getAttribute(selectionListElement, "label-path");
-        
+
         return new FlowJXPathSelectionList(context, listPath, keyPath, valuePath, datatype);
     }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Field.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Field.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Field.java
Fri Oct 15 11:25:54 2004
@@ -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.
@@ -317,7 +317,7 @@
     private static final String FIELD_EL = "field";
     private static final String VALUE_EL = "value";
     private static final String VALIDATION_MSG_EL = "validation-message";
-    
+
 
     /**
      * @return "field"
@@ -325,7 +325,7 @@
     public String getXMLElementName() {
         return FIELD_EL;
     }
-    
+
     /**
      * Adds the @required attribute
      */
@@ -333,8 +333,8 @@
         AttributesImpl attrs = super.getXMLElementAttributes();
         attrs.addCDATAAttribute("required", String.valueOf(isRequired()));
         return attrs;
-    }    
-    
+    }
+
     public void generateItemSaxFragment(ContentHandler contentHandler, Locale locale) throws
SAXException {
         if (enteredValue != null || value != null) {
             contentHandler.startElement(Constants.INSTANCE_NS, VALUE_EL, Constants.INSTANCE_PREFIX_COLON
+ VALUE_EL, XMLUtils.EMPTY_ATTRIBUTES);
@@ -385,7 +385,7 @@
      * All Cocoon-supported protocols can be used.
      * The format of the XML produced by the source should be the
      * same as in case of inline specification of the selection list,
-     * thus the root element should be a <code>wd:selection-list</code>
+     * thus the root element should be a <code>fd:selection-list</code>
      * element.
      * @param uri The URI of the source.
      */
@@ -399,8 +399,8 @@
      * (Java collection or array, or Javascript array) of objects. Each object
      * belonging to the collection should have a <em>value</em> property and
a
      * <em>label</em> property, whose values are used to specify the <code>value</code>
-     * attribute and the contents of the <code>wd:label</code> child element
-     * of every <code>wd:item</code> in the list.
+     * attribute and the contents of the <code>fd:label</code> child element
+     * of every <code>fd:item</code> in the list.
      * <p>Access to the values of the above mentioned properties is done
      * via <a href="http://jakarta.apache.org/commons/jxpath/users-guide.html">XPath</a>
expressions.
      * @param model The collection used as a model for the selection list.

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/MultiValueField.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/MultiValueField.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/MultiValueField.java
Fri Oct 15 11:25:54 2004
@@ -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.
@@ -40,18 +40,18 @@
  * instead use the ValueCountValidationRule to check how many items the user
  * has selected.
  *
- * <p>A MultiValueField also has a {@link org.apache.cocoon.forms.datatype.Datatype
Datatype}
- * associated with it. In case of MultiValueFields, this Datatype will always be an array
- * type, thus {@link org.apache.cocoon.forms.datatype.Datatype#isArrayType()} will
- * always return true, and this in return has an influence on the kind of validation rules
that
- * can be used with the Datatype (see {@link org.apache.cocoon.forms.datatype.Datatype Datatype}
- * description for more information).
- * 
+ * <p>A MultiValueField also has a {@link Datatype} associated with it. In
+ * case of MultiValueFields, this Datatype will always be an array
+ * type, thus {@link Datatype#isArrayType()} will always return true, and
+ * this in return has an influence on the kind of validation rules that
+ * can be used with the Datatype (see {@link Datatype} description for more
+ * information).</p>
+ *
  * @version $Id$
  */
 public class MultiValueField extends AbstractWidget implements ValidationErrorAware, SelectableWidget
{
     private final MultiValueFieldDefinition definition;
-    
+
     private SelectionList selectionList;
     private String[] enteredValues;
     private Object[] values;
@@ -118,8 +118,8 @@
      */
     public String getXMLElementName() {
         return MULTIVALUEFIELD_EL;
-    }   
-    
+    }
+
     public void generateItemSaxFragment(ContentHandler contentHandler, Locale locale) throws
SAXException {
         contentHandler.startElement(Constants.INSTANCE_NS, VALUES_EL, Constants.INSTANCE_PREFIX_COLON
+ VALUES_EL, XMLUtils.EMPTY_ATTRIBUTES);
         if (values != null) {
@@ -154,7 +154,7 @@
         }
     }
 
-    
+
     public Object getValue() {
         return values;
     }
@@ -197,7 +197,7 @@
      * All Cocoon-supported protocols can be used.
      * The format of the XML produced by the source should be the
      * same as in case of inline specification of the selection list,
-     * thus the root element should be a <code>wd:selection-list</code>
+     * thus the root element should be a <code>fd:selection-list</code>
      * element.
      * @param uri The URI of the source.
      */
@@ -211,8 +211,8 @@
      * (Java collection or array, or Javascript array) of objects. Each object
      * belonging to the collection should have a <em>value</em> property and
a
      * <em>label</em> property, whose values are used to specify the <code>value</code>
-     * attribute and the contents of the <code>wd:label</code> child element
-     * of every <code>wd:item</code> in the list.
+     * attribute and the contents of the <code>fd:label</code> child element
+     * of every <code>fd:item</code> in the list.
      * <p>Access to the values of the above mentioned properties is done
      * via <a href="http://jakarta.apache.org/commons/jxpath/users-guide.html">XPath</a>
expressions.
      * @param model The collection used as a model for the selection list.

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinitionBuilder.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinitionBuilder.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinitionBuilder.java
Fri Oct 15 11:25:54 2004
@@ -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.
@@ -23,24 +23,29 @@
 import org.w3c.dom.Element;
 
 /**
- * Builds a <code>&lt;wd:repeater-action/></code>
- * <p>
- * Two actions are defined :
+ * Builds a <code>&lt;fd:repeater-action/&gt;</code>
+ *
+ * <p>Two actions are defined:
  * <ul>
- * <li><code>&lt;wd:repeater-action id="add" action-command="add-row" repeater="repeater-id"/></code>
:
- *   when activated, adds a row to the sibling repeater named "repeater-id".
+ * <li>
+ *   <code>&lt;fd:repeater-action id="add" action-command="add-row"
+ *   repeater="repeater-id"/&gt;</code>: when activated, adds a row to the
+ *   sibling repeater named "repeater-id".
  * </li>
- * <li><code>&lt;wd:repeater-action id="rm" action-command="delete-rows"
repeater="repeater-id"
- *   select="select-id"/></code> : removes the selected rows from the sibling repeater
named "repeater-id".
- *   The selected rows are identified by the boolean field "select-id" present in each row.
+ * <li>
+ *   <code>&lt;fd:repeater-action id="rm" action-command="delete-rows"
+ *   repeater="repeater-id" select="select-id"/&gt;</code>: removes the
+ *   selected rows from the sibling repeater named "repeater-id". The
+ *   selected rows are identified by the boolean field "select-id" present
+ *   in each row.
  * </ul>
- * 
+ *
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
  * @version CVS $Id$
  */
 public class RepeaterActionDefinitionBuilder extends AbstractWidgetDefinitionBuilder {
-    
-    
+
+
     public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception
{
         String actionCommand = DomHelper.getAttribute(widgetElement, "action-command");
         RepeaterActionDefinition definition = createDefinition(widgetElement, actionCommand);
@@ -64,9 +69,9 @@
 
         return definition;
     }
-    
+
     protected RepeaterActionDefinition createDefinition(Element element, String actionCommand)
throws Exception {
-        
+
         if ("delete-rows".equals(actionCommand)) {
             String repeater = DomHelper.getAttribute(element, "repeater");
             String select = DomHelper.getAttribute(element, "select");
@@ -75,7 +80,7 @@
         } else if ("add-row".equals(actionCommand)) {
             String repeater = DomHelper.getAttribute(element, "repeater");
             return new AddRowActionDefinition(repeater);
-            
+
         } else {
             throw new Exception("Unknown repeater action '" + actionCommand + "' at " + DomHelper.getLineLocation(element));
         }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinitionBuilder.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinitionBuilder.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinitionBuilder.java
Fri Oct 15 11:25:54 2004
@@ -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.
@@ -19,24 +19,25 @@
 import org.w3c.dom.Element;
 
 /**
- * Builds a <code>&lt;wd:submit></code> widget. A submit is an action
that terminates
- * the current form. It can either require the form to be valid (in which case it will
- * be redisplayed if not valid) or terminate it without validation (e.g. a "cancel" button).
- * <p>
- * The syntax is as follows :
+ * Builds a <code>&lt;fd:submit&gt;</code> widget. A submit is an action
that
+ * terminates the current form. It can either require the form to be valid
+ * (in which case it will be redisplayed if not valid) or terminate it without
+ * validation (e.g. a "cancel" button).
+ *
+ * <p>The syntax is as follows:
  * <pre>
- *   &lt;wd:submit id="sub-id" action-command="cmd" validate="false">
+ *   &lt;wd:submit id="sub-id" action-command="cmd" validate="false"&gt;
  * </pre>
- * The "validate" attribute can have the value <code>true</code> or <code>false</code>
- * and determines if the form is to be validated (defaults to true).
- * 
+ * The "validate" attribute can have the value <code>true</code> or
+ * <code>false</code> and determines if the form is to be validated
+ * (defaults to true).</p>
+ *
  * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
- * @version CVS $Id: SubmitDefinitionBuilder.java,v 1.1 2004/03/09 10:33:50 reinhard Exp
$
+ * @version CVS $Id$
  */
 public class SubmitDefinitionBuilder  extends ActionDefinitionBuilder {
-    
+
     public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception
{
-        
         SubmitDefinition definition = (SubmitDefinition)super.buildWidgetDefinition(widgetElement);
         definition.setValidateForm(DomHelper.getAttributeAsBoolean(widgetElement, "validate",
true));
         return definition;

Mime
View raw message