Author: sylvain
Date: Sun Feb 20 13:45:05 2005
New Revision: 154563

URL: http://svn.apache.org/viewcvs?view=rev&rev=154563
Log:
Merge branches

Added:
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBinding.java
   (with props)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java
   (with props)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Group.java
   (with props)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinition.java
   (with props)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinitionBuilder.java
   (with props)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/carselector_success_jx.xml
   (with props)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/countryselector_success_jx.xml
   (with props)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form1_success_jx.xml
   (with props)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_success_jx.xml
   (with props)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/xhr_carselector_form.xml
   (with props)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/xhr_carselector_template.xml
   (with props)
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/xsl/xhr_carfilter.xsl 
  (with props)
Removed:
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/carselector_success.xsp
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/countryselector_success.xsp
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form1_success.xsp
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_success.xsp
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/sitemap.xmap
Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/conf/forms-binding.xconf
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/conf/forms-form.xconf
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/JavaSelectionListBuilder.java
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml
   (contents, props changed)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v3/ScriptableWidget.java
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Form.java
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/resources/mattkruse-lib/mattkruse-lib.js
   (contents, props changed)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/SimpleServiceSelector.java
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/XMLAdapter.java
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/flow/forms_flow_example.js
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/binding/06namespaced-bind.xml
   (props changed)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/binding/06namespaced-data.xml
   (contents, props changed)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/binding/06namespaced-def.xml
   (props changed)
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/messages/FormsMessages_zh_CN.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/sitemap.xmap
    cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/welcome.xml
    
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/test/org/apache/cocoon/forms/datatype/convertor/EnumConvertorBuilderTestCase.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/conf/forms-binding.xconf
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/conf/forms-binding.xconf?view=diff&r1=154562&r2=154563
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/conf/forms-binding.xconf 
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/conf/forms-binding.xconf Sun 
Feb 20 13:45:05 2005
@@ -37,6 +37,7 @@
       <binding name="new" 
src="org.apache.cocoon.forms.binding.NewJXPathBindingBuilder"/>
       <binding name="struct" 
src="org.apache.cocoon.forms.binding.StructJXPathBindingBuilder"/>
       <binding name="union" 
src="org.apache.cocoon.forms.binding.UnionJXPathBindingBuilder"/>
+      <binding name="group" 
src="org.apache.cocoon.forms.binding.GroupJXPathBindingBuilder"/>
     </bindings>
   </forms-binding>
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/conf/forms-form.xconf
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/conf/forms-form.xconf?view=diff&r1=154562&r2=154563
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/conf/forms-form.xconf 
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/conf/forms-form.xconf Sun Feb 
20 13:45:05 2005
@@ -40,6 +40,7 @@
       <widget name="new" 
src="org.apache.cocoon.forms.formmodel.NewDefinitionBuilder"/>
       <widget name="struct" 
src="org.apache.cocoon.forms.formmodel.StructDefinitionBuilder"/>
       <widget name="union" 
src="org.apache.cocoon.forms.formmodel.UnionDefinitionBuilder"/>
+      <widget name="group" 
src="org.apache.cocoon.forms.formmodel.GroupDefinitionBuilder"/>
     </widgets>
   </forms-formmanager>
 </xconf>

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBinding.java
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBinding.java?view=auto&rev=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBinding.java
 (added)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBinding.java
 Sun Feb 20 13:45:05 2005
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.forms.binding;
+
+import org.apache.cocoon.forms.formmodel.Group;
+import org.apache.cocoon.forms.formmodel.Widget;
+import org.apache.commons.jxpath.JXPathContext;
+
+/**
+ * GroupJXPathBinding provides an implementation of a [EMAIL PROTECTED] 
Binding}
+ * that narrows the context towards provided childbindings.
+ * <p>
+ * NOTES: <ol>
+ * <li>This Binding assumes that the provided widget-id points to a widget
+ * that contains other widgets.</li>
+ * </ol>
+ *
+ * @version $Id$
+ */
+public class GroupJXPathBinding extends ComposedJXPathBindingBase {
+
+    private final String xpath;
+
+    private final String widgetId;
+
+    /**
+     * Constructs GroupJXPathBinding
+     * @param widgetId
+     * @param xpath
+     * @param childBindings
+     */
+    public GroupJXPathBinding(JXPathBindingBuilderBase.CommonAttributes 
commonAtts, String widgetId, String xpath, JXPathBindingBase[] childBindings) {
+        super(commonAtts, childBindings);
+        this.widgetId = widgetId;
+        this.xpath = xpath;
+    }
+
+    /**
+     * Narrows the scope on the form-model to the member widget-field, and
+     * narrows the scope on the object-model to the member xpath-context
+     * before continuing the binding over the child-bindings.
+     */
+    public void doLoad(Widget frmModel, JXPathContext jxpc) throws 
BindingException {
+        Group groupWidget = (Group)selectWidget(frmModel, this.widgetId);
+        JXPathContext subContext = 
jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
+        super.doLoad(groupWidget, subContext);
+        if (getLogger().isDebugEnabled()) {
+            getLogger().debug("done loading " + toString());
+        }
+    }
+
+    /**
+     * Narrows the scope on the form-model to the member widget-field, and
+     * narrows the scope on the object-model to the member xpath-context
+     * before continuing the binding over the child-bindings.
+     */
+    public void doSave(Widget frmModel, JXPathContext jxpc) throws 
BindingException {
+        Group groupWidget = (Group)selectWidget(frmModel, this.widgetId);
+        JXPathContext subContext = 
jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
+        super.doSave(groupWidget, subContext);
+        if (getLogger().isDebugEnabled()) {
+            getLogger().debug("done saving " + toString());
+        }
+    }
+
+    public String toString() {
+        return "GroupJXPathBinding [widget=" + this.widgetId + ", xpath=" + 
this.xpath + "]";
+    }
+}

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBinding.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java?view=auto&rev=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java
 (added)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java
 Sun Feb 20 13:45:05 2005
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.forms.binding;
+
+import org.apache.cocoon.forms.util.DomHelper;
+import org.w3c.dom.Element;
+
+/**
+ * GroupJXPathBindingBuilder provides a helper class for the Factory
+ * implemented in [EMAIL PROTECTED] JXPathBindingManager} that helps construct 
the
+ * actual [EMAIL PROTECTED] GroupJXPathBinding} out of the configuration in the
+ * provided configElement which looks like:
+ * <pre><code>
+ * &lt;fb:group id="<i>widget-id</i>" path="<i>xpath-expression</i>"
+ *     direction="<i>load|save</i>" lenient="<i>true|false</i>" &gt;
+ *   &lt;fb:field id="<i>sub-widget-id</i>" path="<i>relative-xpath</i>" />
+ * &lt;/fb:group&gt;
+ * </code></pre>
+ *
+ * @version $Id$
+ */
+public class GroupJXPathBindingBuilder
+    extends JXPathBindingBuilderBase {
+
+    public JXPathBindingBase buildBinding(Element bindingElm, 
JXPathBindingManager.Assistant assistant)
+            throws BindingException {
+        try {
+            String widgetId = DomHelper.getAttribute(bindingElm, "id");
+            CommonAttributes commonAtts = 
JXPathBindingBuilderBase.getCommonAttributes(bindingElm);
+            String xpath = DomHelper.getAttribute(bindingElm, "path");
+
+            JXPathBindingBase[] childBindings = 
assistant.makeChildBindings(bindingElm);
+
+            GroupJXPathBinding groupBinding =
+                new GroupJXPathBinding(commonAtts, widgetId, xpath, 
childBindings);
+            return groupBinding;
+        } catch (BindingException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new BindingException("Error building group binding defined 
at " + DomHelper.getLocation(bindingElm), e);
+        }
+    }
+}

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/GroupJXPathBindingBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java?view=diff&r1=154562&r2=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java
 Sun Feb 20 13:45:05 2005
@@ -86,7 +86,6 @@
                                        getLogger(),
                                        this.avalonContext,
                                        this.manager,
-                                       null, // RoleManager,
                                        configuration.getChild("bindings"));
     }
 

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/JavaSelectionListBuilder.java
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/JavaSelectionListBuilder.java?view=diff&r1=154562&r2=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/JavaSelectionListBuilder.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/JavaSelectionListBuilder.java
 Sun Feb 20 13:45:05 2005
@@ -54,7 +54,7 @@
                                JavaSelectionList list = (JavaSelectionList) 
clasz
                                                .newInstance();
                                LifecycleHelper.setupComponent(list, 
getLogger(), null,
-                                               this.manager, null, null, true);
+                                               this.manager, null, true);
                                list.setDatatype(datatype);
                                list.setNullable(nullable);
                 // pass the attributes to the SelectionList

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml?view=diff&r1=154562&r2=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml
 Sun Feb 20 13:45:05 2005
@@ -1,143 +1,143 @@
-<!--
-  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.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<htmlcleaner>
-  <cleanup>
-    <!-- Span elements will only be retained if they have one of the classes 
listed belowed. -->
-    <allowed-span-classes>
-    </allowed-span-classes>
-
-    <!-- Div elements will only be retained if they have one of the classes 
listed belowed. -->
-    <allowed-div-classes>
-    </allowed-div-classes>
-
-    <!-- The class attribute of p elements will only be retained if they have 
one of the classes listed belowed. -->
-    <allowed-para-classes>
-      <class>note</class>
-      <class>warn</class>
-      <class>fixme</class>
-    </allowed-para-classes>
-
-    <!-- The class attribute of pre elements will only be retained if they 
have one of the classes listed belowed. -->
-    <allowed-pre-classes>
-      <class>query</class>
-      <class>include</class>
-      <class>query-and-include</class>      
-    </allowed-pre-classes>
-
-    <img-alternate-src-attr name="title"/>
-
-    <!-- Lists the allowed elements and their allowed attributes.
-
-         For the correct worker of the cleaner, some elements cannot be 
removed,
-         usch as html, body, p, some others...
-     -->
-    <allowed-elements>
-      <element name="html"/>
-      <element name="body"/>
-
-      <element name="div">
-        <attribute name="class"/>
-      </element>
-      <element name="span">
-        <attribute name="class"/>
-      </element>
-
-      <element name="p">
-        <attribute name="align"/>
-        <attribute name="class"/>
-      </element>
-      <element name="br"/>
-      <element name="pre">
-        <attribute name="class"/>
-      </element>
-
-      <!-- titles -->
-      <element name="h1"/>
-      <element name="h2"/>
-      <element name="h3"/>
-      <element name="h4"/>
-      <element name="h5"/>
-
-      <!-- linking -->
-      <element name="a">
-        <attribute name="href"/>
-      </element>
-
-      <!-- inline styles -->
-      <element name="strong"/>
-      <element name="em"/>
-      <element name="sup"/>
-      <element name="sub"/>
-
-      <!-- lists -->
-      <element name="ul"/>
-      <element name="ol"/>
-      <element name="li"/>
-
-      <element name="img">
-        <attribute name="src"/>
-        <attribute name="align"/>
-      </element>
-
-      <!-- tables -->
-      <element name="table">
-        <attribute name="class"/>
-      </element>
-      <element name="tbody"/>
-      <element name="tr"/>
-      <element name="td">
-        <attribute name="colspan"/>
-        <attribute name="rowspan"/>
-        <attribute name="valign"/>
-      </element>
-      <element name="th">
-        <attribute name="colspan"/>
-        <attribute name="rowspan"/>
-        <attribute name="valign"/>
-      </element>
-      <element name="hr"/>
-    </allowed-elements>
-  </cleanup>
-
-  <serialization>
-    <linewidth value="80"/>
-    <elements>
-      <!-- Note: to avoid unexpected results, mention all block-type tags here,
-           and NO inline tags. -->
-      <element name="html" afterOpen="1" beforeClose="1"/>
-      <element name="body" afterOpen="1" beforeClose="1"/>
-      <element name="p" beforeOpen="1" afterClose="1"/>
-      <element name="h1" beforeOpen="1" afterClose="1"/>
-      <element name="h2" beforeOpen="1" afterClose="1"/>
-      <element name="h3" beforeOpen="1" afterClose="1"/>
-      <element name="h4" beforeOpen="1" afterClose="1"/>
-      <element name="h5" beforeOpen="1" afterClose="1"/>
-      <element name="pre" beforeOpen="1" afterClose="1"/>
-      <element name="div" beforeOpen="1" afterClose="1"/>
-      <element name="ul" beforeOpen="1" beforeClose="1" afterClose="1"/>
-      <element name="ol" beforeOpen="1" beforeClose="1" afterClose="1"/>
-      <element name="li" beforeOpen="1"/>
-      <element name="table" beforeOpen="1" beforeClose="1" afterClose="1"/>
-      <element name="tbody" beforeOpen="1" beforeClose="1"/>
-      <element name="tr" beforeOpen="1" beforeClose="1"/>
-      <element name="td" beforeOpen="1"/>
-      <element name="th" beforeOpen="1"/>
-      <element name="br" afterClose="1"/>
-
-    </elements>
-  </serialization>
-
+<!--
+  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.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<htmlcleaner>
+  <cleanup>
+    <!-- Span elements will only be retained if they have one of the classes 
listed belowed. -->
+    <allowed-span-classes>
+    </allowed-span-classes>
+
+    <!-- Div elements will only be retained if they have one of the classes 
listed belowed. -->
+    <allowed-div-classes>
+    </allowed-div-classes>
+
+    <!-- The class attribute of p elements will only be retained if they have 
one of the classes listed belowed. -->
+    <allowed-para-classes>
+      <class>note</class>
+      <class>warn</class>
+      <class>fixme</class>
+    </allowed-para-classes>
+
+    <!-- The class attribute of pre elements will only be retained if they 
have one of the classes listed belowed. -->
+    <allowed-pre-classes>
+      <class>query</class>
+      <class>include</class>
+      <class>query-and-include</class>      
+    </allowed-pre-classes>
+
+    <img-alternate-src-attr name="title"/>
+
+    <!-- Lists the allowed elements and their allowed attributes.
+
+         For the correct worker of the cleaner, some elements cannot be 
removed,
+         usch as html, body, p, some others...
+     -->
+    <allowed-elements>
+      <element name="html"/>
+      <element name="body"/>
+
+      <element name="div">
+        <attribute name="class"/>
+      </element>
+      <element name="span">
+        <attribute name="class"/>
+      </element>
+
+      <element name="p">
+        <attribute name="align"/>
+        <attribute name="class"/>
+      </element>
+      <element name="br"/>
+      <element name="pre">
+        <attribute name="class"/>
+      </element>
+
+      <!-- titles -->
+      <element name="h1"/>
+      <element name="h2"/>
+      <element name="h3"/>
+      <element name="h4"/>
+      <element name="h5"/>
+
+      <!-- linking -->
+      <element name="a">
+        <attribute name="href"/>
+      </element>
+
+      <!-- inline styles -->
+      <element name="strong"/>
+      <element name="em"/>
+      <element name="sup"/>
+      <element name="sub"/>
+
+      <!-- lists -->
+      <element name="ul"/>
+      <element name="ol"/>
+      <element name="li"/>
+
+      <element name="img">
+        <attribute name="src"/>
+        <attribute name="align"/>
+      </element>
+
+      <!-- tables -->
+      <element name="table">
+        <attribute name="class"/>
+      </element>
+      <element name="tbody"/>
+      <element name="tr"/>
+      <element name="td">
+        <attribute name="colspan"/>
+        <attribute name="rowspan"/>
+        <attribute name="valign"/>
+      </element>
+      <element name="th">
+        <attribute name="colspan"/>
+        <attribute name="rowspan"/>
+        <attribute name="valign"/>
+      </element>
+      <element name="hr"/>
+    </allowed-elements>
+  </cleanup>
+
+  <serialization>
+    <linewidth value="80"/>
+    <elements>
+      <!-- Note: to avoid unexpected results, mention all block-type tags here,
+           and NO inline tags. -->
+      <element name="html" afterOpen="1" beforeClose="1"/>
+      <element name="body" afterOpen="1" beforeClose="1"/>
+      <element name="p" beforeOpen="1" afterClose="1"/>
+      <element name="h1" beforeOpen="1" afterClose="1"/>
+      <element name="h2" beforeOpen="1" afterClose="1"/>
+      <element name="h3" beforeOpen="1" afterClose="1"/>
+      <element name="h4" beforeOpen="1" afterClose="1"/>
+      <element name="h5" beforeOpen="1" afterClose="1"/>
+      <element name="pre" beforeOpen="1" afterClose="1"/>
+      <element name="div" beforeOpen="1" afterClose="1"/>
+      <element name="ul" beforeOpen="1" beforeClose="1" afterClose="1"/>
+      <element name="ol" beforeOpen="1" beforeClose="1" afterClose="1"/>
+      <element name="li" beforeOpen="1"/>
+      <element name="table" beforeOpen="1" beforeClose="1" afterClose="1"/>
+      <element name="tbody" beforeOpen="1" beforeClose="1"/>
+      <element name="tr" beforeOpen="1" beforeClose="1"/>
+      <element name="td" beforeOpen="1"/>
+      <element name="th" beforeOpen="1"/>
+      <element name="br" afterClose="1"/>
+
+    </elements>
+  </serialization>
+
 </htmlcleaner>

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v3/ScriptableWidget.java
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v3/ScriptableWidget.java?view=diff&r1=154562&r2=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v3/ScriptableWidget.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/v3/ScriptableWidget.java
 Sun Feb 20 13:45:05 2005
@@ -48,7 +48,6 @@
 import org.apache.cocoon.forms.validation.ValidationError;
 import org.apache.cocoon.forms.validation.ValidationErrorAware;
 import org.apache.cocoon.forms.validation.WidgetValidator;
-import org.apache.commons.lang.BooleanUtils;
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.Function;
 import org.mozilla.javascript.JavaScriptException;
@@ -391,7 +390,7 @@
             delegate.setValue(value);
         } else if (delegate instanceof BooleanField) {
             BooleanField field = (BooleanField)delegate;
-            
field.setValue(BooleanUtils.toBooleanObject(Context.toBoolean(value)));
+            field.setValue(Boolean.valueOf(Context.toBoolean(value)));
         } else if (delegate instanceof Repeater) {
             Repeater repeater = (Repeater)delegate;
             if (value instanceof NativeArray) {

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java?view=diff&r1=154562&r2=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/BooleanField.java
 Sun Feb 20 13:45:05 2005
@@ -25,7 +25,6 @@
 import org.xml.sax.SAXException;
 import org.apache.cocoon.forms.validation.ValidationErrorAware;
 import org.apache.cocoon.forms.validation.ValidationError;
-import org.apache.commons.lang.BooleanUtils;
 
 /**
  * A widget to select a boolean value. Usually rendered as a checkbox.
@@ -70,7 +69,7 @@
         validationError = null;
         Object oldValue = value;
         String param = 
formContext.getRequest().getParameter(getRequestParameterName());
-        value = BooleanUtils.toBooleanObject(BooleanUtils.toBoolean(param));
+        value = Boolean.valueOf(param);
         if (!value.equals(oldValue)) {
             getForm().addWidgetEvent(new ValueChangedEvent(this, oldValue, 
value));
         }

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Form.java
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Form.java?view=diff&r1=154562&r2=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Form.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Form.java
 Sun Feb 20 13:45:05 2005
@@ -26,7 +26,6 @@
 import org.apache.cocoon.forms.event.WidgetEvent;
 import org.apache.cocoon.forms.event.WidgetEventMulticaster;
 import org.apache.commons.collections.list.CursorableLinkedList;
-import org.apache.commons.lang.BooleanUtils;
 
 /**
  * A widget that serves as a container for other widgets, the top-level widget 
in
@@ -87,7 +86,7 @@
      * Fire the events that have been queued.
      * Note that event handling can fire new events.
      */
-    private void fireWidgetEvents() {
+    private void fireEvents() {
         if (this.events != null) {
             CursorableLinkedList.Cursor cursor = this.events.cursor();
             while(cursor.hasNext()) {
@@ -188,7 +187,7 @@
     public boolean process(FormContext formContext) {
 
         // Fire the binding phase events
-        fireWidgetEvents();
+        fireEvents();
 
         // setup processing
         this.submitWidget = null;
@@ -226,7 +225,7 @@
 
             // Fire events, still buffering them: this ensures they will be 
handled in the same
             // order as they were added.
-            fireWidgetEvents();
+            fireEvents();
         } finally {
             // No need for buffering in the following phases
             this.bufferEvents = false;
@@ -249,7 +248,7 @@
      * @param redisplayForm indicates if the form should be redisplayed to the 
user.
      */
     public void endProcessing(boolean redisplayForm) {
-        this.endProcessing = BooleanUtils.toBooleanObject(!redisplayForm);
+        this.endProcessing = Boolean.valueOf(!redisplayForm);
     }
 
     /**

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Group.java
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Group.java?view=auto&rev=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Group.java
 (added)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Group.java
 Sun Feb 20 13:45:05 2005
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.forms.formmodel;
+
+
+/**
+ * A container [EMAIL PROTECTED] Widget} which can hold zero or more child 
widgets.
+ *
+ * @version $Id$
+ */
+public class Group extends AbstractContainerWidget {
+    private static final String GROUP_EL = "group";
+    
+    private final GroupDefinition definition; 
+
+    public Group(GroupDefinition definition) {
+        super(definition);
+        this.definition = definition;
+    }
+    
+    protected WidgetDefinition getDefinition() {
+        return this.definition;
+    }
+    
+    /**
+     * @return "group"
+     */
+    public String getXMLElementName() {
+        return GROUP_EL;
+    }
+    
+}

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Group.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Group.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinition.java
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinition.java?view=auto&rev=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinition.java
 (added)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinition.java
 Sun Feb 20 13:45:05 2005
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.forms.formmodel;
+
+/**
+ * The [EMAIL PROTECTED] WidgetDefinition} corresponding to a [EMAIL 
PROTECTED] Group} widget.
+ *
+ * @version $Id$
+ */
+public class GroupDefinition extends AbstractContainerDefinition {
+
+    public Widget createInstance() {
+        Group groupWidget = new Group(this);
+        createWidgets(groupWidget);
+        return groupWidget;
+    }
+}

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinition.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinition.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinitionBuilder.java
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinitionBuilder.java?view=auto&rev=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinitionBuilder.java
 (added)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinitionBuilder.java
 Sun Feb 20 13:45:05 2005
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.forms.formmodel;
+
+import org.w3c.dom.Element;
+import org.apache.cocoon.forms.Constants;
+import org.apache.cocoon.forms.util.DomHelper;
+
+/**
+ * Builds {GroupDefinition}s.
+ *
+ * @version $Id$
+ */
+public class GroupDefinitionBuilder extends AbstractWidgetDefinitionBuilder {
+
+    public WidgetDefinition buildWidgetDefinition(Element element) throws 
Exception {
+        GroupDefinition definition = new GroupDefinition();
+        setCommonProperties(element, definition);
+        setDisplayData(element, definition);
+        setValidators(element, definition);
+
+        Element widgetsElement = DomHelper.getChildElement(element, 
Constants.DEFINITION_NS, "widgets", true);
+        // All child elements of the widgets element are widgets
+        Element[] widgetElements = DomHelper.getChildElements(widgetsElement, 
Constants.DEFINITION_NS);
+        for (int i = 0; i < widgetElements.length; i++) {
+            Element widgetElement = widgetElements[i];
+            WidgetDefinition widgetDefinition = 
buildAnotherWidgetDefinition(widgetElement);
+            definition.addWidgetDefinition(widgetDefinition);
+        }
+
+        return definition;
+    }
+}

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/GroupDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml
URL: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml?view=diff&r1=154562&r2=154563
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml
 Sun Feb 20 13:45:05 2005
@@ -93,6 +93,20 @@
     </jx:macro>
 
     <!--
+        ft:group : just increase the nesting level
+    -->
+    <jx:macro name="group" 
targetNamespace="http://apache.org/cocoon/forms/1.0#template";>
+      <jx:parameter name="id"/>
+
+      <jx:set var="widget" value="${cformsHelper.getWidget(widget, id)}"/>
+      <jx:if test="${cformsHelper.isVisible(widget)}">
+        <fi:group id="${widget.getRequestParameterName()}">
+          <jx:evalBody/>
+        </fi:group>
+      </jx:if>
+    </jx:macro>
+
+    <!--
         ft:new
     -->
     <jx:macro name="new" 
targetNamespace="http://apache.org/cocoon/forms/1.0#template";>


Reply via email to