cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giac...@apache.org
Subject svn commit: r580314 - in /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample: ./ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/cocoon/ src/main/java/org/apache/cocoon/forms/ src/main/java/org/apache/cocoon/forms...
Date Fri, 28 Sep 2007 11:37:58 GMT
Author: giacomo
Date: Fri Sep 28 04:37:56 2007
New Revision: 580314

URL: http://svn.apache.org/viewvc?rev=580314&view=rev
Log:
Springified CForms (as much as possible)

Added:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/
      - copied from r578696, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/Contact.java
      - copied unchanged from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/Contact.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/CustomBirthDateValidator.java
      - copied, changed from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/CustomBirthDateValidator.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/DateTestJavaSelectionList.java
      - copied unchanged from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/DateTestJavaSelectionList.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/Form1Handler.java
      - copied unchanged from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/Form1Handler.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/Form2Bean.java
      - copied unchanged from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/Form2Bean.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/InitForm1Action.java
      - copied unchanged from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/InitForm1Action.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/PreferredContact.java
      - copied unchanged from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/PreferredContact.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/SampleTreeModel.java
  (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/Sex.java
      - copied unchanged from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/Sex.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/bindings/
      - copied from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/bindings/
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/dreamteam/
      - copied from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/dreamteam/
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/META-INF/cocoon/spring/local-springContext.xml
  (with props)
Modified:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/pom.xml
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/binding/05custom-bind.xml
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/form1.xml
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/form2_model.xml
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/sampletree_model.xml

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Sep 28 04:37:56 2007
@@ -7,3 +7,4 @@
 *.iml
 *.iws
 .settings
+.springBeans

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/pom.xml?rev=580314&r1=580313&r2=580314&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/pom.xml (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/pom.xml Fri Sep 28 04:37:56 2007
@@ -32,7 +32,7 @@
     <relativePath>../../pom.xml</relativePath>
   </parent>
   <artifactId>cocoon-forms-sample</artifactId>
-  <version>1.0.0-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
   <name>Cocoon Forms Block Samples</name>
 
   <dependencies>
@@ -55,6 +55,11 @@
     <dependency>
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-samples-style-default</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <scope>provided</scope>
     </dependency>
   </dependencies>
 

Copied: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/CustomBirthDateValidator.java
(from r580311, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/CustomBirthDateValidator.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/CustomBirthDateValidator.java?p2=cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/CustomBirthDateValidator.java&p1=cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/CustomBirthDateValidator.java&r1=580311&r2=580314&rev=580314&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/CustomBirthDateValidator.java
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/CustomBirthDateValidator.java
Fri Sep 28 04:37:56 2007
@@ -20,27 +20,29 @@
 import java.util.Date;
 import java.util.GregorianCalendar;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.cocoon.forms.formmodel.Widget;
 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.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Example of a custom validator.  Check that the given date is a valid birth date, i.e.

  * is at least 5 years before current date and no more than 100 years old.
  */
 public class CustomBirthDateValidator
-    extends AbstractLogEnabled
     implements WidgetValidator {
 
+    private static Log LOG = LogFactory.getLog( CustomBirthDateValidator.class );
+    
     /**
      * @see org.apache.cocoon.forms.validation.WidgetValidator#validate(org.apache.cocoon.forms.formmodel.Widget)
      */
     public boolean validate(Widget widget) {
         Date birthDate = (Date) widget.getValue();
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Validating date " + birthDate);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Validating date " + birthDate);
         }
         GregorianCalendar cal = new GregorianCalendar();
         cal.add(Calendar.YEAR, -5);

Added: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/SampleTreeModel.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/SampleTreeModel.java?rev=580314&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/SampleTreeModel.java
(added)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/SampleTreeModel.java
Fri Sep 28 04:37:56 2007
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.forms.samples;
+
+import org.apache.cocoon.forms.formmodel.tree.DefaultTreeModel;
+
+/**
+ * The classical Swing sample tree model, that can be used for demonstration purposes.
+ */
+public class SampleTreeModel extends DefaultTreeModel {
+    public SampleTreeModel() {
+        super(new DefaultTreeNode("root"));
+        DefaultTreeNode root = (DefaultTreeNode)getRoot();
+
+        DefaultTreeNode      parent;
+        
+        parent = new DefaultTreeNode("Colors");
+        root.add("colors", parent);
+        parent.add("blue", new DefaultTreeNode("Blue"));
+        parent.add("violet", new DefaultTreeNode("Violet"));
+        parent.add("red", new DefaultTreeNode("Red"));
+        parent.add("yellow", new DefaultTreeNode("Yellow"));
+
+        parent = new DefaultTreeNode("Sports");
+        root.add("sports", parent);
+        parent.add("basketball", new DefaultTreeNode("Basketball"));
+        parent.add("soccer", new DefaultTreeNode("Soccer"));
+        parent.add("football", new DefaultTreeNode("Football"));
+        parent.add("hockey", new DefaultTreeNode("Hockey"));
+
+        parent = new DefaultTreeNode("Food");
+        root.add("food", parent);
+        parent.add("hotdogs", new DefaultTreeNode("Hot Dogs"));
+        parent.add("pizza", new DefaultTreeNode("Pizza"));
+        parent.add("ravioli", new DefaultTreeNode("Ravioli"));
+        parent.add("bananas", new DefaultTreeNode("Bananas"));
+    }
+}

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/SampleTreeModel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/java/org/apache/cocoon/forms/samples/SampleTreeModel.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/binding/05custom-bind.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/binding/05custom-bind.xml?rev=580314&r1=580313&r2=580314&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/binding/05custom-bind.xml
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/binding/05custom-bind.xml
Fri Sep 28 04:37:56 2007
@@ -39,10 +39,10 @@
   </fb:javascript>
 
   <fb:custom id="custom" path="custom-value" 
-      class="org.apache.cocoon.forms.samples.bindings.CustomValueWrapBinding"/>
+      ref="org.apache.cocoon.forms.samples.bindings.CustomValueWrapBinding"/>
   
   <fb:custom id="config" path="config-value" 
-      builderclass="org.apache.cocoon.forms.samples.bindings.CustomValueWrapBinding"
+      builderref="org.apache.cocoon.forms.samples.bindings.CustomValueWrapBinding"
       factorymethod="createBinding" >
       <fb:config prefixchar="[" suffixchar="]" />      
   </fb:custom>

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/form1.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/form1.xml?rev=580314&r1=580313&r2=580314&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/form1.xml
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/form1.xml
Fri Sep 28 04:37:56 2007
@@ -261,7 +261,7 @@
       <fd:datatype base="date">
         <fd:convertor variant="date" style="full"/>
       </fd:datatype>
-      <fd:selection-list type="java" class="org.apache.cocoon.forms.samples.DateTestJavaSelectionList"
nullable="false"/>
+      <fd:selection-list type="java" ref="org.apache.cocoon.forms.samples.DateTestJavaSelectionList"
nullable="false"/>
     </fd:field>
 
     <fd:field id="dieselprice" required="true">

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/form2_model.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/form2_model.xml?rev=580314&r1=580313&r2=580314&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/form2_model.xml
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/form2_model.xml
Fri Sep 28 04:37:56 2007
@@ -78,7 +78,7 @@
         </fd:convertor>
       </fd:datatype>
       <fd:validation>
-          <fd:java class="org.apache.cocoon.forms.samples.CustomBirthDateValidator"/>
+          <fd:java ref="org.apache.cocoon.forms.samples.CustomBirthDateValidator"/>
       </fd:validation>
           
     </fd:field>
@@ -106,7 +106,7 @@
           <fd:enum>org.apache.cocoon.forms.samples.Sex</fd:enum>
         </fd:convertor>
       </fd:datatype>
-      <fd:selection-list type="enum" class="org.apache.cocoon.forms.samples.Sex"/>
+      <fd:selection-list type="enum" ref="org.apache.cocoon.forms.samples.Sex"/>
     </fd:field>
     
     <fd:booleanfield id="enable">
@@ -164,7 +164,7 @@
               <fd:enum>org.apache.cocoon.forms.samples.PreferredContact</fd:enum>
             </fd:convertor>
           </fd:datatype>
-          <fd:selection-list type="enum" class="org.apache.cocoon.forms.samples.PreferredContact"
nullable="true" null-text="Select..."/>
+          <fd:selection-list type="enum" ref="org.apache.cocoon.forms.samples.PreferredContact"
nullable="true" null-text="Select..."/>
         </fd:field>
         <fd:booleanfield id="select">
           <fd:label>Select</fd:label>

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/sampletree_model.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/sampletree_model.xml?rev=580314&r1=580313&r2=580314&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/sampletree_model.xml
(original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/sampletree_model.xml
Fri Sep 28 04:37:56 2007
@@ -29,7 +29,7 @@
     </fd:field>
     
     <fd:tree id="tree" root-visible="true">
-      <fd:tree-model type="java" class="org.apache.cocoon.forms.formmodel.tree.DefaultTreeModel$Sample"/>
+      <fd:tree-model type="java" ref="org.apache.cocoon.forms.samples.SampleTreeModel"/>
       <!-- no tree model given, to see the default one -->
       <fd:ttree-model type="source" src="context://samples/">
         <fd:fileset>
@@ -40,7 +40,7 @@
 
     <fd:tree id="tree2">
       <!-- sample tree model -->
-      <fd:tree-model type="java" class="org.apache.cocoon.forms.formmodel.tree.DefaultTreeModel$Sample"/>
+      <fd:tree-model type="java" ref="org.apache.cocoon.forms.samples.SampleTreeModel"/>
     </fd:tree>
 
     <fd:tree id="files" root-visible="false">

Added: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/META-INF/cocoon/spring/local-springContext.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/META-INF/cocoon/spring/local-springContext.xml?rev=580314&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/META-INF/cocoon/spring/local-springContext.xml
(added)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/META-INF/cocoon/spring/local-springContext.xml
Fri Sep 28 04:37:56 2007
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  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.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- @version $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:configurator="http://cocoon.apache.org/schema/configurator"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
+                           http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd">
+
+  <bean name="org.apache.cocoon.forms.samples.DateTestJavaSelectionList" 
+        class="org.apache.cocoon.forms.samples.DateTestJavaSelectionList"
+        scope="prototype"/>
+  
+  <bean name="org.apache.cocoon.forms.samples.CustomBirthDateValidator"
+        class="org.apache.cocoon.forms.samples.CustomBirthDateValidator"
+        scope="prototype"/>
+        
+  <bean name="org.apache.cocoon.forms.samples.bindings.CustomValueWrapBinding"
+        class="org.apache.cocoon.forms.samples.bindings.CustomValueWrapBinding"
+        scope="prototype"/>
+        
+  <bean name="org.apache.cocoon.forms.samples.SampleTreeModel"
+        class="org.apache.cocoon.forms.samples.SampleTreeModel"
+        scope="prototype"/>
+        
+  <bean name="org.apache.cocoon.forms.samples.Sex"
+        class="org.apache.cocoon.forms.samples.Sex"
+        scope="prototype"/>
+        
+  <bean name="org.apache.cocoon.forms.samples.PreferredContact"
+        class="org.apache.cocoon.forms.samples.PreferredContact"
+        scope="prototype"/>
+        
+</beans>

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/META-INF/cocoon/spring/local-springContext.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/META-INF/cocoon/spring/local-springContext.xml
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message