cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giac...@apache.org
Subject svn commit: r580312 [1/5] - in /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl: ./ src/main/java/org/apache/cocoon/forms/ src/main/java/org/apache/cocoon/forms/binding/ src/main/java/org/apache/cocoon/forms/binding/library/ src/main/java/org/apache...
Date Fri, 28 Sep 2007 11:33:18 GMT
Author: giacomo
Date: Fri Sep 28 04:33:12 2007
New Revision: 580312

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

Added:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilder.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/BooleanConvertorBuilder.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/DateConvertorBuilder.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/DecimalConvertorBuilder.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/DoubleConvertorBuilder.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/FloatConvertorBuilder.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/IntegerConvertorBuilder.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/LongConvertorBuilder.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/PlainBeanConvertorBuilder.java
      - copied, changed from r574825, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/BeanConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/PlainCharConvertorBuilder.java
      - copied, changed from r574825, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/CharConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/PlainEnumConvertorBuilder.java
      - copied, changed from r574825, cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/StringConvertorBuilder.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/ConfigurableWidgetListener.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/ConfigurableWidgetValidator.java   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/META-INF/cocoon/spring/cocoon-forms.xml   (with props)
Removed:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/CharConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/samples/
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/util/SimpleServiceSelector.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/META-INF/cocoon/avalon/
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/forms.roles
Modified:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/   (props changed)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/pom.xml
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/DefaultCacheManager.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/DefaultFormManager.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ComposedJXPathBindingBase.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/EnhancedRepeaterJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/RepeaterJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SetAttributeJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/SimpleRepeaterJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/TempRepeaterJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/UnionJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ValueJXPathBinding.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/Library.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/library/LibraryManagerImpl.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/AbstractJavaSelectionList.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/DatatypeBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/DefaultDatatypeManager.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/DefaultSelectionListBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionList.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/FlowJXPathSelectionListBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/JavaScriptSelectionList.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/JavaScriptSelectionListBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/JavaSelectionListBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/BeanConvertor.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/BeanConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/DummyStringConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertor.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/FormattingDateConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/FormattingDecimalConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/FormattingDoubleConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/FormattingFloatConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/FormattingIntegerConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/FormattingLongConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/HtmlCleaningConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/Icu4jDateConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/MillisDateConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/PlainBooleanConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/PlainDecimalConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/PlainDoubleConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/PlainFloatConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/PlainIntegerConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/convertor/PlainLongConvertorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/typeimpl/AbstractDatatypeBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/datatype/validationruleimpl/AbstractValidationRuleBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/impl/JavaClassWidgetListenerBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/impl/JavaScriptWidgetListener.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/impl/JavaScriptWidgetListenerBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/impl/RequiredControl.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/expression/DefaultExpressionManager.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AbstractDatatypeWidgetDefinition.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AbstractDatatypeWidgetDefinitionBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/AbstractWidgetDefinitionBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/CalculatedFieldDefinitionBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/CaptchaDefinitionBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/CaptchaField.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/CaptchaFieldDefinition.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/FormDefinitionBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/RepeaterFilterField.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/algorithms/AbstractBaseAlgorithm.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/algorithms/AbstractBaseAlgorithmBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/algorithms/JavaAlgorithmBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/algorithms/JavaScript.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/algorithms/RepeatedFormula.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/algorithms/SimpleFormula.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/algorithms/SimpleFormulaBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/library/Library.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/library/LibraryManagerImpl.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/DefaultTreeModel.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/JavaTreeModelDefinition.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/SourceTreeModel.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/JavaTreeModelDefinitionBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/SourceTreeModelDefinitionBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/formmodel/tree/builder/TreeDefinitionBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/util/DomHelper.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/util/JavaScriptHelper.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/AbstractJavaValidator.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/AssertValidatorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/CaptchaValidatorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/EmailValidatorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/JavaClassValidatorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidator.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidatorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/LengthValidatorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/Mod10ValidatorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/RangeValidatorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/RegExpValidatorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/validation/impl/ValueCountValidatorBuilder.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/test/java/org/apache/cocoon/forms/datatype/convertor/EnumConvertorBuilderTestCase.java
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/status.xml

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

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/pom.xml?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/pom.xml (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/pom.xml Fri Sep 28 04:33:12 2007
@@ -33,7 +33,7 @@
   </parent>
   <artifactId>cocoon-forms-impl</artifactId>
   <name>Cocoon Forms Block Implementation</name>
-  <version>1.0.0-RC2-SNAPSHOT</version>
+  <version>1.1.0-SNAPSHOT</version>
   <url>http://cocoon.apache.org/${docs.m.forms.relPath}</url>
 
   <build>

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/DefaultCacheManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/DefaultCacheManager.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/DefaultCacheManager.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/DefaultCacheManager.java Fri Sep 28 04:33:12 2007
@@ -18,10 +18,6 @@
 
 import java.util.Map;
 
-import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.component.Component;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceValidity;
 
@@ -32,8 +28,7 @@
  *
  * @version $Id$
  */
-public class DefaultCacheManager extends AbstractLogEnabled
-                                 implements CacheManager, Disposable, ThreadSafe, Component {
+public class DefaultCacheManager implements CacheManager {
     // NOTE: Component is there to allow this block to also run in the 2.1 branch
 
     // FIXME Unbounded map - the road to OOME
@@ -42,10 +37,6 @@
 
     public DefaultCacheManager() {
         this.cache = new FastHashMap();
-    }
-
-    public void dispose() {
-        this.cache = null;
     }
 
     public Object get(Source source, String prefix) {

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/DefaultFormManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/DefaultFormManager.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/DefaultFormManager.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/DefaultFormManager.java Fri Sep 28 04:33:12 2007
@@ -16,138 +16,51 @@
  */
 package org.apache.cocoon.forms;
 
-import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.component.Component;
-import org.apache.avalon.framework.configuration.Configurable;
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.container.ContainerUtil;
-import org.apache.avalon.framework.context.Context;
-import org.apache.avalon.framework.context.ContextException;
-import org.apache.avalon.framework.context.Contextualizable;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.avalon.framework.logger.Logger;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.Serviceable;
-import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 
+import org.apache.avalon.framework.context.Context;
+import org.apache.cocoon.core.xml.SAXParser;
 import org.apache.cocoon.forms.formmodel.Form;
 import org.apache.cocoon.forms.formmodel.FormDefinition;
 import org.apache.cocoon.forms.formmodel.FormDefinitionBuilder;
-import org.apache.cocoon.forms.formmodel.WidgetDefinitionBuilder;
-import org.apache.cocoon.forms.formmodel.library.LibraryManager;
-import org.apache.cocoon.forms.formmodel.library.LibraryManagerImpl;
 import org.apache.cocoon.forms.util.DomHelper;
-import org.apache.cocoon.forms.util.SimpleServiceSelector;
 import org.apache.cocoon.util.location.LocationImpl;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.xml.sax.InputSource;
 
+import java.util.Map;
+
 /**
  * Component implementing the {@link FormManager} role.
  *
  * @version $Id$
  */
-public class DefaultFormManager extends AbstractLogEnabled
-                                implements FormManager, Contextualizable, Serviceable, Configurable,
-                                           Disposable, ThreadSafe, Component {
+public class DefaultFormManager implements FormManager {
     // NOTE: Component is there to allow this block to run in the 2.1 branch
 
     private static final String PREFIX = "CocoonForms:";
-
-    private Context avalonContext;
-    protected ServiceManager manager;
-    protected SimpleServiceSelector widgetDefinitionBuilderSelector;
+    private static Log LOG = LogFactory.getLog( DefaultFormManager.class );
+    protected Map widgetDefinitionBuilders;
     protected CacheManager cacheManager;
+    private Context avalonContext;
 
-    protected LibraryManager libraryManager;
-
-    //
-    // Lifecycle
-    //
-
-    public DefaultFormManager() {
-        widgetDefinitionBuilderSelector = new SimpleServiceSelector("widget", WidgetDefinitionBuilder.class);
-        this.libraryManager = new LibraryManagerImpl();
-    }
-
-    /**
-     * @see org.apache.avalon.framework.logger.AbstractLogEnabled#enableLogging(org.apache.avalon.framework.logger.Logger)
-     */
-    public void enableLogging(Logger logger) {
-        super.enableLogging(logger);
-        widgetDefinitionBuilderSelector.enableLogging(getLogger());
-        ContainerUtil.enableLogging(this.libraryManager, getLogger().getChildLogger("library"));
-    }
-
-    /**
-     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
-     */
-    public void contextualize(Context context) throws ContextException {
-        this.avalonContext = context;
-        widgetDefinitionBuilderSelector.contextualize(avalonContext);
-        ContainerUtil.contextualize(this.libraryManager, avalonContext);
-    }
-
-    /** Temporary internal method, don't rely on it's existence! Needed to access the context from flowscript. */
-    // FIXME (SW). Extending the FOM is needed.
-    public Context getAvalonContext() {
-        return this.avalonContext;
-    }
-
-    /**
-     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
-     */
-    public void service(ServiceManager manager) throws ServiceException {
-        this.manager = manager;
-        this.cacheManager = (CacheManager) manager.lookup(CacheManager.ROLE);
-        widgetDefinitionBuilderSelector.service(new FormServiceManager());
-        ContainerUtil.service(this.libraryManager, new FormServiceManager());
-    }
-
-    /**
-     * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
-     */
-    public void configure(Configuration configuration) throws ConfigurationException {
-        ContainerUtil.configure(this.libraryManager, configuration.getChild("libraries"));
-        widgetDefinitionBuilderSelector.configure(configuration.getChild("widgets"));
-    }
-
-    /**
-     * @see org.apache.avalon.framework.activity.Disposable#dispose()
-     */
-    public void dispose() {
-        if (this.widgetDefinitionBuilderSelector != null) {
-            this.widgetDefinitionBuilderSelector.dispose();
-            this.widgetDefinitionBuilderSelector = null;
-        }
-        if (this.libraryManager != null) {
-            ContainerUtil.dispose(this.libraryManager);
-            this.libraryManager = null;
-        }
-        if (this.cacheManager != null) {
-            this.manager.release(this.cacheManager);
-            this.cacheManager = null;
-        }
-        this.manager = null;
-    }
+    private SourceResolver sourceResolver;
+    private SAXParser parser;
 
     //
     // Business Methods
     //
 
     public Form createForm(String uri) throws Exception {
-        SourceResolver resolver = null;
         Source source = null;
         try {
             try {
-                resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
-                source = resolver.resolveURI(uri);
+                source = sourceResolver.resolveURI(uri);
             } catch (Exception e) {
                 throw new FormsException("Could not resolve form definition URI.",
                                          e, new LocationImpl("[FormManager]", uri));
@@ -155,10 +68,7 @@
             return createForm(source);
         } finally {
             if (source != null) {
-                resolver.release(source);
-            }
-            if (resolver != null) {
-                manager.release(resolver);
+                sourceResolver.release(source);
             }
         }
     }
@@ -177,11 +87,9 @@
     }
 
     public FormDefinition createFormDefinition(String uri) throws Exception {
-        SourceResolver sourceResolver = null;
         Source source = null;
         try {
             try {
-                sourceResolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
                 source = sourceResolver.resolveURI(uri);
             } catch (Exception e) {
                 throw new FormsException("Could not resolve form definition.",
@@ -192,9 +100,6 @@
             if (source != null) {
                 sourceResolver.release(source);
             }
-            if (sourceResolver != null) {
-                manager.release(sourceResolver);
-            }
         }
     }
 
@@ -205,15 +110,15 @@
         }
 
         if (formDefinition == null) {
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("Building Form: " + source.getURI());
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Building Form: " + source.getURI());
             }
 
             Document formDocument;
             try {
                 InputSource inputSource = new InputSource(source.getInputStream());
                 inputSource.setSystemId(source.getURI());
-                formDocument = DomHelper.parse(inputSource, this.manager);
+                formDocument = DomHelper.parse(inputSource, parser);
             } catch (Exception e) {
                 throw new FormsException("Could not parse form definition.",
                                          e, new LocationImpl("[FormManager]", source.getURI()));
@@ -233,39 +138,41 @@
                                      DomHelper.getLocationObject(formElement));
         }
 
-        FormDefinitionBuilder builder = (FormDefinitionBuilder) widgetDefinitionBuilderSelector.select("form");
+        FormDefinitionBuilder builder = (FormDefinitionBuilder) widgetDefinitionBuilders.get("form");
+        if (builder == null) {
+            throw new Exception("Cannot find FormDefinitionBuilder 'form'");
+        }
         return (FormDefinition) builder.buildWidgetDefinition(formElement);
     }
 
 
-    private class FormServiceManager implements ServiceManager {
-        final String WIDGET_DEFINITION_BUILDER_SELECTOR_ROLE = WidgetDefinitionBuilder.class.getName() + "Selector";
-        final String LIBRARY_MANAGER_ROLE = LibraryManager.ROLE;
+    public void setWidgetDefinitionBuilders( Map widgetDefinitionBuilders )
+    {
+        this.widgetDefinitionBuilders = widgetDefinitionBuilders;
+    }
 
-        public Object lookup(String name) throws ServiceException {
-            if (WIDGET_DEFINITION_BUILDER_SELECTOR_ROLE.equals(name)) {
-                return widgetDefinitionBuilderSelector;
-            } else if(LIBRARY_MANAGER_ROLE.equals(name)) {
-                return libraryManager;
-            } else {
-                return manager.lookup(name);
-            }
-        }
+    public void setCacheManager( CacheManager cacheManager )
+    {
+        this.cacheManager = cacheManager;
+    }
 
-        public boolean hasService(String name) {
-            if (WIDGET_DEFINITION_BUILDER_SELECTOR_ROLE.equals(name)) {
-                return true;
-            } else if(LIBRARY_MANAGER_ROLE.equals(name)) {
-                return true;
-            } else {
-                return manager.hasService(name);
-            }
-        }
+    public void setParser( SAXParser parser )
+    {
+        this.parser = parser;
+    }
 
-        public void release(Object service) {
-            if (service != widgetDefinitionBuilderSelector && service != libraryManager) {
-                manager.release(service);
-            }
-        }
+    public void setSourceResolver( SourceResolver sourceResolver )
+    {
+        this.sourceResolver = sourceResolver;
+    }
+
+    public void setAvalonContext( Context avalonContext )
+    {
+        this.avalonContext = avalonContext;
+    }
+
+    public Context getAvalonContext()
+    {
+        return avalonContext;
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBinding.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/AggregateJXPathBinding.java Fri Sep 28 04:33:12 2007
@@ -20,6 +20,8 @@
 import org.apache.cocoon.forms.formmodel.Widget;
 
 import org.apache.commons.jxpath.JXPathContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * AggregateJXPathBinding provides an implementation of a {@link Binding}
@@ -34,6 +36,7 @@
  */
 public class AggregateJXPathBinding extends ComposedJXPathBindingBase {
 
+    private static Log LOG = LogFactory.getLog( AggregateJXPathBinding.class );
     private final String xpath;
 
     private final String widgetId;
@@ -69,8 +72,8 @@
                 jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
         super.doLoad(aggregate, subContext);
         aggregate.combineFields();
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Done loading " + this);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Done loading " + this);
         }
     }
 
@@ -86,8 +89,8 @@
         JXPathContext subContext =
                 jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
         super.doSave(aggregate, subContext);
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Done saving " + this);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Done saving " + this);
         }
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBinding.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CaseJXPathBinding.java Fri Sep 28 04:33:12 2007
@@ -20,6 +20,8 @@
 import org.apache.cocoon.forms.formmodel.Widget;
 
 import org.apache.commons.jxpath.JXPathContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * CaseJXPathBinding provides an implementation of a {@link Binding}
@@ -34,6 +36,7 @@
  */
 public class CaseJXPathBinding extends ComposedJXPathBindingBase {
 
+    private static Log LOG = LogFactory.getLog( CaseJXPathBinding.class );
     private final String xpath;
     private final String widgetId;
 
@@ -72,8 +75,8 @@
                     subBindings[i].loadFormFromModel(unionWidget, jxpc);
                 }
             }
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("done loading " + this);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("done loading " + this);
             }
         }
     }
@@ -94,8 +97,8 @@
                     subBindings[i].saveFormToModel(unionWidget, jxpc);
                 }
             }
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("done saving " + this);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("done saving " + this);
             }
         }
     }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ComposedJXPathBindingBase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ComposedJXPathBindingBase.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ComposedJXPathBindingBase.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ComposedJXPathBindingBase.java Fri Sep 28 04:33:12 2007
@@ -19,8 +19,6 @@
 import java.util.Collections;
 import java.util.HashMap;
 
-import org.apache.avalon.framework.logger.Logger;
-
 import org.apache.cocoon.forms.formmodel.Widget;
 
 import org.apache.commons.jxpath.JXPathContext;
@@ -49,19 +47,6 @@
         if (this.subBindings != null) {
             for (int i = 0; i < this.subBindings.length; i++) {
                 this.subBindings[i].setParent(this);
-            }
-        }
-    }
-
-    /**
-     * Receives the logger to use for logging activity, and hands it over to
-     * the nested children.
-     */
-    public void enableLogging(Logger logger) {
-        super.enableLogging(logger);
-        if (this.subBindings != null) {
-            for (int i = 0; i < this.subBindings.length; i++) {
-                this.subBindings[i].enableLogging(logger);
             }
         }
     }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBinding.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/ContextJXPathBinding.java Fri Sep 28 04:33:12 2007
@@ -16,14 +16,14 @@
  */
 package org.apache.cocoon.forms.binding;
 
-import org.apache.avalon.framework.CascadingRuntimeException;
-
 import org.apache.cocoon.forms.formmodel.Widget;
 import org.apache.cocoon.util.ClassUtils;
 
 import org.apache.commons.jxpath.AbstractFactory;
 import org.apache.commons.jxpath.JXPathContext;
 import org.apache.commons.jxpath.Pointer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * ContextJXPathBinding provides an implementation of a {@link Binding}
@@ -34,6 +34,8 @@
  */
 public class ContextJXPathBinding extends ComposedJXPathBindingBase {
 
+    private static Log LOG = LogFactory.getLog( ContextJXPathBinding.class );
+    
     /**
      * the relative contextPath for the sub-bindings of this context
      */
@@ -68,7 +70,7 @@
             try {
                 this.factory = (AbstractFactory) ClassUtils.newInstance(factoryClassName);
             } catch (Exception e) {
-                throw new CascadingRuntimeException("Cannot create an instance of " + factoryClassName, e);
+                throw new RuntimeException("Cannot create an instance of " + factoryClassName, e);
             }
         }
     }
@@ -86,12 +88,12 @@
         if (ptr.getNode() != null) {
             JXPathContext subContext = jxpc.getRelativeContext(ptr);
             super.doLoad(frmModel, subContext);
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("done loading " + this);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("done loading " + this);
             }
         } else {
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("non-existent path: skipping " + this);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("non-existent path: skipping " + this);
             }
         }
     }
@@ -112,8 +114,8 @@
         }
         JXPathContext subContext = jxpc.getRelativeContext(ptr);
         super.doSave(frmModel, subContext);
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done saving " + this);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("done saving " + this);
         }
     }
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBinding.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBinding.java Fri Sep 28 04:33:12 2007
@@ -16,10 +16,6 @@
  */
 package org.apache.cocoon.forms.binding;
 
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.Serviceable;
-
 import org.apache.cocoon.forms.binding.JXPathBindingBuilderBase.CommonAttributes;
 import org.apache.cocoon.forms.formmodel.Widget;
 
@@ -28,8 +24,7 @@
 /**
  * CustomJXPathBinding
  */
-public class CustomJXPathBinding extends JXPathBindingBase
-                                 implements Serviceable {
+public class CustomJXPathBinding extends JXPathBindingBase {
 
     /**
      * The id of the cforms widget
@@ -91,14 +86,5 @@
     public void doSave(Widget frmModel, JXPathContext jxpc) throws BindingException {
         Widget selectedWidget = selectWidget(frmModel, this.widgetId);
         this.wrappedBinding.saveFormToModel(selectedWidget, jxpc);
-    }
-
-    /**
-     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
-     */
-    public void service(ServiceManager manager) throws ServiceException {
-        if (wrappedBinding instanceof Serviceable) {
-            ((Serviceable) wrappedBinding).service(manager);
-        }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBindingBuilder.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/CustomJXPathBindingBuilder.java Fri Sep 28 04:33:12 2007
@@ -18,10 +18,14 @@
 
 import java.lang.reflect.Method;
 
-import org.apache.cocoon.components.LifecycleHelper;
 import org.apache.cocoon.forms.binding.JXPathBindingManager.Assistant;
 import org.apache.cocoon.forms.util.DomHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
 import org.w3c.dom.Element;
 
 /**
@@ -51,8 +55,11 @@
  *
  * @version $Id$
  */
-public class CustomJXPathBindingBuilder extends JXPathBindingBuilderBase {
+public class CustomJXPathBindingBuilder extends JXPathBindingBuilderBase implements BeanFactoryAware {
 
+    private BeanFactory beanFactory;
+
+    private static Log LOG = LogFactory.getLog( ValueJXPathBinding.class );
     private static final Class[] DOMELEMENT_METHODARGS;
     private static final Class[] EMPTY_METHODARGS;
 
@@ -61,6 +68,12 @@
         DOMELEMENT_METHODARGS[0] = Element.class;
         EMPTY_METHODARGS = null;
     }
+    
+    public void setBeanFactory( BeanFactory beanFactory )
+                                                  throws BeansException
+    {
+        this.beanFactory = beanFactory;
+    }
 
     /**
      * Builds the custom Binding class and wraps it into a CustomJXPathBinding
@@ -74,6 +87,18 @@
     throws BindingException {
 
         try {
+            // hard way deprecation
+            if (DomHelper.getAttribute(bindingElm, "class", null) != null) {
+                throw new RuntimeException("The 'class' attribute is not supported anymore at "
+                                           + DomHelper.getLocationObject( bindingElm )
+                                           + ". Use a 'ref' attribute to address a Spring bean");
+            }
+            if (DomHelper.getAttribute(bindingElm, "builderclass", null) != null) {
+                throw new RuntimeException("The 'builderclass' attribute is not supported anymore at "
+                                           + DomHelper.getLocationObject( bindingElm )
+                                           + ". Use a 'builderref' attribute to address a Spring bean");
+            }
+
             CommonAttributes commonAtts =
                 JXPathBindingBuilderBase.getCommonAttributes(bindingElm);
             String xpath = DomHelper.getAttribute(bindingElm, "path", ".");
@@ -81,26 +106,26 @@
 
             Object bindingInstance = null;
 
-            String className = DomHelper.getAttribute(bindingElm, "class", null);
-            if(className != null) {
-                Class clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
-                bindingInstance = clazz.newInstance();
+            
+            String beanRef = DomHelper.getAttribute(bindingElm, "ref", null);
+            if(beanRef != null) {
+                bindingInstance = beanFactory.getBean( beanRef );
 
             } else {
-                String builderClassName =
-                    DomHelper.getAttribute(bindingElm, "builderclass", null);
+                String builderRefName =
+                    DomHelper.getAttribute(bindingElm, "builderref", null);
                 String factoryMethodName =
                     DomHelper.getAttribute(bindingElm, "factorymethod", null);
                 Element configNode =
                     DomHelper.getChildElement(bindingElm, BindingManager.NAMESPACE, "config");
 
                 // only do it if attributes exist
-                if (builderClassName != null && factoryMethodName != null) {
-	                Class builderClass = Class.forName(builderClassName);
+                if (builderRefName != null && factoryMethodName != null) {
+	                Object builder = beanFactory.getBean( builderRefName );
 	                Method factoryMethod;
 	                Object[] args = null;
 	                try {
-	                    factoryMethod = builderClass.getMethod(factoryMethodName, DOMELEMENT_METHODARGS);
+	                    factoryMethod = builder.getClass().getMethod(factoryMethodName, DOMELEMENT_METHODARGS);
 	                    args = new Object[1];
 	                    args[0] = configNode;
 	                } catch (NoSuchMethodException e) {
@@ -108,7 +133,7 @@
 	                }
 
 	                if (factoryMethod == null) {
-	                    factoryMethod = builderClass.getMethod(factoryMethodName, EMPTY_METHODARGS);
+	                    factoryMethod = builder.getClass().getMethod(factoryMethodName, EMPTY_METHODARGS);
 	                    args = null;
 	                }
 
@@ -135,9 +160,6 @@
 
             CustomJXPathBinding customBinding =
                 new CustomJXPathBinding(commonAtts, widgetId, xpath, (AbstractCustomBinding)bindingInstance);
-
-            // Fire Avalon-setup for the custom binding
-            LifecycleHelper.setupComponent(customBinding, getLogger(), null, assistant.getServiceManager(), null);
 
             return customBinding;
         } catch (BindingException e) {

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/EnhancedRepeaterJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/EnhancedRepeaterJXPathBinding.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/EnhancedRepeaterJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/EnhancedRepeaterJXPathBinding.java Fri Sep 28 04:33:12 2007
@@ -18,8 +18,6 @@
 
 import java.util.Iterator;
 
-import org.apache.avalon.framework.CascadingRuntimeException;
-
 import org.apache.cocoon.forms.binding.JXPathBindingBuilderBase.CommonAttributes;
 import org.apache.cocoon.forms.formmodel.EnhancedRepeater;
 import org.apache.cocoon.forms.formmodel.Repeater;
@@ -60,7 +58,7 @@
 			try {
 				adapter = (RepeaterAdapter) Thread.currentThread().getContextClassLoader().loadClass(this.adapterClass).newInstance();
 			} catch (Exception e) {
-				throw new CascadingRuntimeException("Cannot instantiate adapter class for advanced repeater binding", e);
+				throw new RuntimeException("Cannot instantiate adapter class for advanced repeater binding", e);
 			}
 		} else {
 			adapter = new RepeaterJXPathAdapter();

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBinding.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertBeanJXPathBinding.java Fri Sep 28 04:33:12 2007
@@ -18,11 +18,11 @@
 
 import java.lang.reflect.Method;
 
-import org.apache.avalon.framework.CascadingRuntimeException;
-
 import org.apache.cocoon.forms.formmodel.Widget;
 
 import org.apache.commons.jxpath.JXPathContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * InsertBeanJXPathBinding provides an implementation of a {@link Binding}
@@ -38,6 +38,8 @@
  */
 public class InsertBeanJXPathBinding extends JXPathBindingBase {
 
+    private static Log LOG = LogFactory.getLog( InsertBeanJXPathBinding.class );
+    
     private final String className;
     private final String addMethodName;
 
@@ -93,11 +95,11 @@
             // invoke this method with this new beast.
             addMethod.invoke(parent, args);
 
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("InsertBean performed.");
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("InsertBean performed.");
             }
         } catch (Exception e) {
-            throw new CascadingRuntimeException("InsertBean failed.", e);
+            throw new RuntimeException("InsertBean failed.", e);
         }
 
         // jxpc.setFactory(new AbstractFactory() {

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBinding.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBinding.java Fri Sep 28 04:33:12 2007
@@ -19,6 +19,8 @@
 import org.apache.cocoon.forms.formmodel.Widget;
 
 import org.apache.commons.jxpath.JXPathContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentFragment;
 import org.w3c.dom.Node;
@@ -37,6 +39,8 @@
  */
 public class InsertNodeJXPathBinding extends JXPathBindingBase {
 
+    private static Log LOG = LogFactory.getLog( InsertNodeJXPathBinding.class );
+    
     private final DocumentFragment template;
 
     /**
@@ -70,8 +74,8 @@
         Node toInsert = targetDoc.importNode(this.template, true);
         parentNode.appendChild(toInsert);
 
-        if (getLogger().isDebugEnabled())
-            getLogger().debug("InsertNode executed.");
+        if (LOG.isDebugEnabled())
+            LOG.debug("InsertNode executed.");
 
         // jxpc.setFactory(new AbstractFactory() {
         //     public boolean createObject(JXPathContext context, Pointer pointer,

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBindingBuilder.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/InsertNodeJXPathBindingBuilder.java Fri Sep 28 04:33:12 2007
@@ -16,7 +16,6 @@
  */
 package org.apache.cocoon.forms.binding;
 
-import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.excalibur.xml.xpath.XPathProcessor;
@@ -47,6 +46,9 @@
  */
 public class InsertNodeJXPathBindingBuilder extends JXPathBindingBuilderBase {
 
+    private SourceResolver sourceResolver;
+    private XPathProcessor xpathProcessor;
+    
     /**
      * Creates an instance of {@link InsertNodeJXPathBinding} configured
      * with the nested template of the bindingElm.
@@ -62,8 +64,6 @@
 
             String src = DomHelper.getAttribute(bindingElm, "src", null);
             if (src != null) {
-                ServiceManager manager = assistant.getServiceManager();
-                SourceResolver sourceResolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
                 Source source = null;
                 try {
                     source = sourceResolver.resolveURI(src);
@@ -72,21 +72,16 @@
 
                     String xpath = DomHelper.getAttribute(bindingElm, "xpath", null);
                     if (xpath != null) {
-                        XPathProcessor xpathProcessor = (XPathProcessor) manager.lookup(XPathProcessor.ROLE);
-                        try {
-                            Node node = xpathProcessor.selectSingleNode(document, xpath);
-                            if (node == null) {
-                                throw new BindingException("XPath expression '" + xpath + "' didn't return a result.",
-                                                           DomHelper.getLocationObject(bindingElm));
-                            }
-                            if (!(node instanceof Element)) {
-                                throw new BindingException("XPath expression '" + xpath + "' did not return an element node.",
-                                                           DomHelper.getLocationObject(bindingElm));
-                            }
-                            element = (Element) node;
-                        } finally {
-                            manager.release(xpathProcessor);
+                        Node node = xpathProcessor.selectSingleNode(document, xpath);
+                        if (node == null) {
+                            throw new BindingException("XPath expression '" + xpath + "' didn't return a result.",
+                                                       DomHelper.getLocationObject(bindingElm));
                         }
+                        if (!(node instanceof Element)) {
+                            throw new BindingException("XPath expression '" + xpath + "' did not return an element node.",
+                                                       DomHelper.getLocationObject(bindingElm));
+                        }
+                        element = (Element) node;
                     }
                     domTemplate = document.createDocumentFragment();
                     domTemplate.appendChild(element);
@@ -94,7 +89,6 @@
                     if (source != null) {
                         sourceResolver.release(source);
                     }
-                    manager.release(sourceResolver);
                 }
             } else if (bindingElm.hasChildNodes()) {
                 // FIXME: using the binding's document prevents it to be garbage collected.
@@ -128,5 +122,15 @@
             throw new BindingException("Error building the insert-node binding", e,
                                        DomHelper.getLocationObject(bindingElm));
         }
+    }
+
+    public void setSourceResolver( SourceResolver sourceResolver )
+    {
+        this.sourceResolver = sourceResolver;
+    }
+
+    public void setXpathProcessor( XPathProcessor pathProcessor )
+    {
+        xpathProcessor = pathProcessor;
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBase.java Fri Sep 28 04:33:12 2007
@@ -20,8 +20,6 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-
 import org.apache.cocoon.forms.binding.library.Library;
 import org.apache.cocoon.forms.formmodel.Widget;
 import org.apache.cocoon.util.jxpath.DOMFactory;
@@ -32,6 +30,8 @@
 import org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer;
 import org.apache.commons.jxpath.util.TypeUtils;
 import org.apache.commons.lang.exception.NestableRuntimeException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Provides a base class for hooking up Binding implementations that use the
@@ -40,9 +40,9 @@
  *
  * @version $Id$
  */
-public abstract class JXPathBindingBase extends AbstractLogEnabled
-                                        implements Binding {
+public abstract class JXPathBindingBase implements Binding {
 
+    private static Log LOG = LogFactory.getLog( JXPathBindingBase.class );
     /**
      * the local library, if this is the top binding
      */
@@ -100,7 +100,7 @@
         try {
             return !this.enclosingLibrary.dependenciesHaveChanged();
         } catch (Exception e) {
-            getLogger().error("Error checking dependencies!", e);
+            LOG.error("Error checking dependencies!", e);
             throw new NestableRuntimeException("Error checking dependencies!", e);
         }
     }

Added: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilder.java?rev=580312&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilder.java (added)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilder.java Fri Sep 28 04:33:12 2007
@@ -0,0 +1,35 @@
+/*
+ * 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.binding;
+
+import org.w3c.dom.Element;
+
+public interface JXPathBindingBuilder
+{
+    /**
+     * Builds a configured binding object based on the configuration as
+     * described in the bindingElement.  The BuilderMap can be used to
+     * find appropriate builders for possible subBinders.
+     *
+     * @param bindingElm
+     * @param assistant
+     * @return JXPathBindingBase
+     */
+    JXPathBindingBase buildBinding(Element bindingElm, JXPathBindingManager.Assistant assistant)
+    throws BindingException;
+
+}

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

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

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingBuilderBase.java Fri Sep 28 04:33:12 2007
@@ -18,11 +18,7 @@
 
 import java.util.Map;
 
-import org.apache.avalon.framework.logger.LogEnabled;
-import org.apache.avalon.framework.logger.Logger;
-
 import org.apache.cocoon.forms.util.DomHelper;
-
 import org.apache.commons.jxpath.AbstractFactory;
 import org.apache.commons.lang.BooleanUtils;
 import org.w3c.dom.Element;
@@ -41,42 +37,7 @@
  *
  * @version $Id$
  */
-public abstract class JXPathBindingBuilderBase implements LogEnabled {
-
-    private Logger logger;
-
-
-    /**
-     * Receives the Avalon logger to use.
-     */
-    public void enableLogging(Logger logger) {
-        this.logger = logger;
-        if (logger.isDebugEnabled()) {
-            logger.debug("JXPathBindingBuilderBase got logger...");
-        }
-    }
-
-
-    /**
-     * Makes the logger available to the subclasses.
-     * @return Logger
-     */
-    protected Logger getLogger() {
-        return this.logger;
-    }
-
-    /**
-     * Builds a configured binding object based on the configuration as
-     * described in the bindingElement.  The BuilderMap can be used to
-     * find appropriate builders for possible subBinders.
-     *
-     * @param bindingElm
-     * @param assistant
-     * @return JXPathBindingBase
-     */
-    public abstract JXPathBindingBase buildBinding(Element bindingElm,
-                                                   JXPathBindingManager.Assistant assistant)
-    throws BindingException;
+public abstract class JXPathBindingBuilderBase implements JXPathBindingBuilder {
 
     /**
      * Helper method for interpreting the common attributes which are supported

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java Fri Sep 28 04:33:12 2007
@@ -17,26 +17,13 @@
 package org.apache.cocoon.forms.binding;
 
 import java.util.ArrayList;
+import java.util.Map;
 import java.util.Stack;
 
-import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.activity.Initializable;
-import org.apache.avalon.framework.configuration.Configurable;
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.context.Context;
-import org.apache.avalon.framework.context.ContextException;
-import org.apache.avalon.framework.context.Contextualizable;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.avalon.framework.logger.Logger;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.Serviceable;
-import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 
-import org.apache.cocoon.components.LifecycleHelper;
+import org.apache.cocoon.core.xml.SAXParser;
 import org.apache.cocoon.forms.CacheManager;
 import org.apache.cocoon.forms.binding.library.Library;
 import org.apache.cocoon.forms.binding.library.LibraryException;
@@ -44,10 +31,11 @@
 import org.apache.cocoon.forms.binding.library.LibraryManagerImpl;
 import org.apache.cocoon.forms.datatype.DatatypeManager;
 import org.apache.cocoon.forms.util.DomHelper;
-import org.apache.cocoon.forms.util.SimpleServiceSelector;
 import org.apache.cocoon.util.location.LocationAttributes;
 
 import org.apache.commons.lang.exception.NestableRuntimeException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.xml.sax.InputSource;
@@ -59,67 +47,23 @@
  *
  * @version $Id$
  */
-public class JXPathBindingManager extends AbstractLogEnabled
-                                  implements BindingManager, Contextualizable, Serviceable,
-                                             Configurable, Initializable, Disposable, ThreadSafe {
+public class JXPathBindingManager implements BindingManager {
 
+    private static Log LOG = LogFactory.getLog( JXPathBindingManager.class );
+    
     private static final String PREFIX = "CocoonFormBinding:";
 
-    protected ServiceManager manager;
-
     protected DatatypeManager datatypeManager;
 
-    private Configuration configuration;
-
-    protected SimpleServiceSelector bindingBuilderSelector;
+    protected Map bindingBuilders;
 
     private CacheManager cacheManager;
 
-    private Context avalonContext;
-
     protected LibraryManagerImpl libraryManager;
 
-
-    /**
-     * Java 1.3 logger access method.
-     * <br>
-     * Access to {#getLogger} from inner class on Java 1.3 causes NoSuchMethod error.  
-     */
-    protected Logger getMyLogger() {
-        return getLogger();
-    }
-
-    public void contextualize(Context context) throws ContextException {
-        this.avalonContext = context;
-    }
-
-    public void service(ServiceManager manager) throws ServiceException {
-        this.manager = manager;
-        this.datatypeManager = (DatatypeManager) manager.lookup(DatatypeManager.ROLE);
-        this.cacheManager = (CacheManager) manager.lookup(CacheManager.ROLE);
-    }
-
-    public void configure(Configuration configuration)
-    throws ConfigurationException {
-        this.configuration = configuration;
-    }
-
-    public void initialize() throws Exception {
-        bindingBuilderSelector = new SimpleServiceSelector("binding", JXPathBindingBuilderBase.class);
-        LifecycleHelper.setupComponent(bindingBuilderSelector,
-                                       getLogger(),
-                                       this.avalonContext,
-                                       this.manager,
-                                       configuration.getChild("bindings"));
-
-        libraryManager = new LibraryManagerImpl();
-        libraryManager.setBindingManager(this);
-        LifecycleHelper.setupComponent(libraryManager,
-                                       getLogger(),
-                                       this.avalonContext,
-                                       this.manager,
-                                       configuration.getChild("library"));
-    }
+    private SourceResolver sourceResolver;
+    
+    private SAXParser parser;
 
     public Binding createBinding(Source source) throws BindingException {
 
@@ -134,7 +78,7 @@
                 InputSource is = new InputSource(source.getInputStream());
                 is.setSystemId(source.getURI());
 
-                Document doc = DomHelper.parse(is, this.manager);
+                Document doc = DomHelper.parse(is, parser);
                 binding = createBinding(doc.getDocumentElement());
                 this.cacheManager.set(binding, source, PREFIX);
             } catch (BindingException e) {
@@ -148,12 +92,10 @@
     }
 
     public Binding createBinding(String bindingURI) throws BindingException {
-        SourceResolver sourceResolver = null;
         Source source = null;
 
         try {
             try {
-                sourceResolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
                 source = sourceResolver.resolveURI(bindingURI);
             } catch (Exception e) {
                 throw new BindingException("Error resolving binding source: " + bindingURI);
@@ -163,9 +105,6 @@
             if (source != null) {
                 sourceResolver.release(source);
             }
-            if (sourceResolver != null) {
-                manager.release(sourceResolver);
-            }
         }
     }
 
@@ -173,13 +112,12 @@
         Binding binding = null;
         if (BindingManager.NAMESPACE.equals(bindingElement.getNamespaceURI())) {
             binding = getBuilderAssistant().getBindingForConfigurationElement(bindingElement);
-            ((JXPathBindingBase) binding).enableLogging(getLogger());
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("Creation of new binding finished. " + binding);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Creation of new binding finished. " + binding);
             }
         } else {
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("Root Element of said binding file is in wrong namespace.");
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Root Element of said binding file is in wrong namespace.");
             }
         }
         return binding;
@@ -189,18 +127,6 @@
         return new Assistant();
     }
 
-    public void dispose() {
-        if (this.bindingBuilderSelector != null) {
-            this.bindingBuilderSelector.dispose();
-            this.bindingBuilderSelector = null;
-        }
-        this.manager.release(this.datatypeManager);
-        this.datatypeManager = null;
-        this.manager.release(this.cacheManager);
-        this.cacheManager = null;
-        this.manager = null;
-    }
-
     /**
      * Assistant Inner class discloses enough features to the created
      * childBindings to recursively
@@ -214,13 +140,13 @@
         private BindingBuilderContext context = new BindingBuilderContext();
         private Stack contextStack = new Stack();
 
-        private JXPathBindingBuilderBase getBindingBuilder(String bindingType)
+        private JXPathBindingBuilder getBindingBuilder(String bindingType)
         throws BindingException {
-            try {
-                return (JXPathBindingBuilderBase) bindingBuilderSelector.select(bindingType);
-            } catch (ServiceException e) {
-                throw new BindingException("Cannot handle binding element '" + bindingType + "'.", e);
+            JXPathBindingBuilder builder = (JXPathBindingBuilder) bindingBuilders.get(bindingType);
+            if (builder == null) {
+                throw new BindingException("Cannot handle binding element '" + bindingType + "'.");
             }
+            return builder;
         }
 
         /**
@@ -230,13 +156,12 @@
         public JXPathBindingBase getBindingForConfigurationElement(Element configElm)
         throws BindingException {
             String bindingType = configElm.getLocalName();
-            JXPathBindingBuilderBase bindingBuilder = getBindingBuilder(bindingType);
+            JXPathBindingBuilder bindingBuilder = getBindingBuilder(bindingType);
 
             boolean flag = false;
             if (context.getLocalLibrary() == null) {
                 // FIXME Use newLibrary()?
                 Library lib = new Library(libraryManager, getBuilderAssistant());
-                lib.enableLogging(getMyLogger());
                 context.setLocalLibrary(lib);
                 lib.setSourceURI(LocationAttributes.getURI(configElm));
                 flag = true;
@@ -258,10 +183,6 @@
                 childBinding.setEnclosingLibrary(context.getLocalLibrary());
             }
 
-            // this might get called unnecessarily, but solves issues with the libraries
-            if (childBinding != null) {
-                childBinding.enableLogging(getMyLogger());
-            }
             return childBinding;
         }
 
@@ -367,10 +288,6 @@
             return datatypeManager;
         }
 
-        public ServiceManager getServiceManager() {
-            return manager;
-        }
-
         public LibraryManager getLibraryManager() {
             return libraryManager;
         }
@@ -391,5 +308,35 @@
                 context = new BindingBuilderContext();
             }
         }
+    }
+
+    public void setDatatypeManager( DatatypeManager datatypeManager )
+    {
+        this.datatypeManager = datatypeManager;
+    }
+
+    public void setCacheManager( CacheManager cacheManager )
+    {
+        this.cacheManager = cacheManager;
+    }
+
+    public void setBindingBuilders( Map bindingBuilders )
+    {
+        this.bindingBuilders = bindingBuilders;
+    }
+
+    public void setParser( SAXParser parser )
+    {
+        this.parser = parser;
+    }
+
+    public void setLibraryManager( LibraryManagerImpl libraryManager )
+    {
+        this.libraryManager = libraryManager;
+    }
+
+    public void setSourceResolver( SourceResolver sourceResolver )
+    {
+        this.sourceResolver = sourceResolver;
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java Fri Sep 28 04:33:12 2007
@@ -19,16 +19,15 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.avalon.framework.CascadingRuntimeException;
-import org.apache.avalon.framework.context.Context;
-
-import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.components.flow.javascript.ScriptableMap;
 import org.apache.cocoon.forms.formmodel.Widget;
 import org.apache.cocoon.forms.util.JavaScriptHelper;
+import org.apache.cocoon.processing.ProcessInfoProvider;
 
 import org.apache.commons.jxpath.JXPathContext;
 import org.apache.commons.jxpath.Pointer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.mozilla.javascript.Function;
 import org.mozilla.javascript.Scriptable;
 
@@ -41,16 +40,18 @@
     final static String[] LOAD_PARAMS = { "widget", "jxpathPointer", "jxpathContext", "childBindings" };
     final static String[] SAVE_PARAMS = { "widget", "jxpathPointer", "jxpathContext", "childBindings" };
 
-    private final Context avalonContext;
+    private static Log LOG = LogFactory.getLog( JavaScriptJXPathBinding.class );
+    
     private final String id;
     private final String path;
     private final Function loadScript;
     private final Function saveScript;
     private final Scriptable childBindings;
     private final Map childBindingsMap;
+    private ProcessInfoProvider processInfoProvider;
 
 
-    public JavaScriptJXPathBinding(Context context,
+    public JavaScriptJXPathBinding(ProcessInfoProvider processInfoProvider,
                                    JXPathBindingBuilderBase.CommonAttributes commonAtts,
                                    String id,
                                    String path,
@@ -62,7 +63,7 @@
         this.path = path;
         this.loadScript = loadScript;
         this.saveScript = saveScript;
-        this.avalonContext = context;
+        this.processInfoProvider = processInfoProvider;
 
         // Set parent on child bindings
         for (Iterator i = childBindings.values().iterator(); i.hasNext();) {
@@ -75,7 +76,6 @@
 
     public String getPath() { return path; }
     public String getId() { return id; }
-    public Context getContext() { return avalonContext; }
     public Function getLoadScript() { return loadScript; }
     public Function getSaveScript() { return saveScript; }
     public Map getChildBindingsMap() { return childBindingsMap; }
@@ -87,7 +87,7 @@
             // Move to widget context
             Pointer pointer = jctx.getPointer(this.path);
 
-            Map objectModel = ContextHelper.getObjectModel(this.avalonContext);
+            Map objectModel = processInfoProvider.getObjectModel();
 
             try {
                 JXPathContext newCtx = pointer.getNode() == null ? null :
@@ -100,11 +100,11 @@
                 // rethrow
                 throw re;
             } catch (Exception e) {
-                throw new CascadingRuntimeException("Error invoking JavaScript event handler", e);
+                throw new RuntimeException("Error invoking JavaScript event handler", e);
             }
         } else {
-            if (getLogger().isInfoEnabled()) {
-                getLogger().info("[Javascript Binding] - loadForm: No javascript code available. Widget id=" + this.getId());
+            if (LOG.isInfoEnabled()) {
+                LOG.info("[Javascript Binding] - loadForm: No javascript code available. Widget id=" + this.getId());
             }
         }
     }
@@ -117,7 +117,7 @@
             Pointer pointer = jctx.createPath(this.path);
             JXPathContext widgetCtx = jctx.getRelativeContext(pointer);
             try {
-                Map objectModel = ContextHelper.getObjectModel(this.avalonContext);
+                Map objectModel = processInfoProvider.getObjectModel();
 
                 JavaScriptHelper.callFunction(this.saveScript, widget,
                         new Object[]{widget, pointer, widgetCtx, this.childBindings}, objectModel);
@@ -126,11 +126,11 @@
                 // rethrow
                 throw re;
             } catch (Exception e) {
-                throw new CascadingRuntimeException("Error invoking JavaScript event handler", e);
+                throw new RuntimeException("Error invoking JavaScript event handler", e);
             }
         } else {
-            if (getLogger().isInfoEnabled()) {
-                getLogger().info("[Javascript Binding] - saveForm: No code available on the javascript binding with id '" + getId() + "'");
+            if (LOG.isInfoEnabled()) {
+                LOG.info("[Javascript Binding] - saveForm: No code available on the javascript binding with id '" + getId() + "'");
             }
         }
     }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBindingBuilder.java Fri Sep 28 04:33:12 2007
@@ -21,13 +21,12 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.avalon.framework.context.Context;
-import org.apache.avalon.framework.context.ContextException;
-import org.apache.avalon.framework.context.Contextualizable;
-
 import org.apache.cocoon.forms.binding.JXPathBindingManager.Assistant;
 import org.apache.cocoon.forms.util.DomHelper;
 import org.apache.cocoon.forms.util.JavaScriptHelper;
+import org.apache.cocoon.processing.ProcessInfoProvider;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.mozilla.javascript.Function;
 import org.w3c.dom.Element;
@@ -70,15 +69,11 @@
  *
  * @version $Id$
  */
-public class JavaScriptJXPathBindingBuilder extends JXPathBindingBuilderBase
-                                            implements Contextualizable {
-
-    private Context avalonContext;
+public class JavaScriptJXPathBindingBuilder extends JXPathBindingBuilderBase {
 
+    private static Log LOG = LogFactory.getLog( JavaScriptJXPathBindingBuilder.class );
 
-    public void contextualize(Context context) throws ContextException {
-        this.avalonContext = context;
-    }
+    private ProcessInfoProvider processInfoProvider;
 
     public JXPathBindingBase buildBinding(Element element, Assistant assistant)
     throws BindingException {
@@ -160,14 +155,12 @@
                     }
 
                     ComposedJXPathBindingBase composedBinding = new ComposedJXPathBindingBase(commonAtts, bindings);
-                    composedBinding.enableLogging(getLogger());
                     childBindings.put(name, composedBinding);
                 }
             }
 
-            JXPathBindingBase result = new JavaScriptJXPathBinding(this.avalonContext, commonAtts, id, path, loadScript, saveScript,
+            JXPathBindingBase result = new JavaScriptJXPathBinding(this.processInfoProvider, commonAtts, id, path, loadScript, saveScript,
                     Collections.unmodifiableMap(childBindings));
-            result.enableLogging(getLogger());
             return result;
 
         } catch (BindingException e) {
@@ -176,5 +169,10 @@
             throw new BindingException("Cannot build binding", e,
                                        DomHelper.getLocationObject(element));
         }
+    }
+
+    public void setProcessInfoProvider( ProcessInfoProvider processInfoProvider )
+    {
+        this.processInfoProvider = processInfoProvider;
     }
 }

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java?rev=580312&r1=580311&r2=580312&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java Fri Sep 28 04:33:12 2007
@@ -20,14 +20,14 @@
 import java.util.LinkedList;
 import java.util.Locale;
 
-import org.apache.avalon.framework.logger.Logger;
-
 import org.apache.cocoon.forms.datatype.convertor.ConversionResult;
 import org.apache.cocoon.forms.datatype.convertor.Convertor;
 import org.apache.cocoon.forms.formmodel.Widget;
 
 import org.apache.commons.jxpath.JXPathContext;
 import org.apache.commons.jxpath.Pointer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * Simple binding for multi fields: on save, first deletes the target data
@@ -37,6 +37,7 @@
  */
 public class MultiValueJXPathBinding extends JXPathBindingBase {
 
+    private static Log LOG = LogFactory.getLog( MultiValueJXPathBinding.class );
     private final String multiValueId;
     private final String multiValuePath;
     private final String rowPath;
@@ -61,11 +62,6 @@
         this.convertorLocale = convertorLocale;
     }
 
-    public void enableLogging(Logger logger) {
-        super.enableLogging(logger);
-        this.updateBinding.enableLogging(logger);
-    }
-
     public String getId() { return multiValueId; }
     public String getMultiValuePath() { return multiValuePath; }
     public String getRowPath() { return rowPath; }
@@ -102,7 +98,7 @@
                         else
                             value = null;
                     } else {
-                        getLogger().warn("Convertor ignored on backend-value which isn't of type String.");
+                        LOG.warn("Convertor ignored on backend-value which isn't of type String.");
                     }
                 }
 
@@ -112,8 +108,8 @@
             widget.setValue(list.toArray());
         }
 
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done loading values " + this);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("done loading values " + this);
         }
     }
 
@@ -167,8 +163,8 @@
         }
 
 
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("done saving " + this + " -- on-update == " + update);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("done saving " + this + " -- on-update == " + update);
         }
 
 



Mime
View raw message