cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding ComposedJXPathBindingBase.java SimpleRepeaterJXPathBinding.java ContextJXPathBinding.java StructJXPathBinding.java Binding.java AggregateJXPathBinding.java UnionJXPathBinding.java NewJXPathBinding.java CaseJXPathBinding.java TempRepeaterJXPathBinding.java ValueJXPathBinding.java JXPathBindingManager.java RepeaterJXPathBinding.java JXPathBindingBase.java
Date Tue, 03 Feb 2004 12:22:09 GMT
joerg       2004/02/03 04:22:08

  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/binding
                        ComposedJXPathBindingBase.java
                        SimpleRepeaterJXPathBinding.java
                        ContextJXPathBinding.java StructJXPathBinding.java
                        Binding.java AggregateJXPathBinding.java
                        UnionJXPathBinding.java NewJXPathBinding.java
                        CaseJXPathBinding.java
                        TempRepeaterJXPathBinding.java
                        ValueJXPathBinding.java JXPathBindingManager.java
                        RepeaterJXPathBinding.java JXPathBindingBase.java
  Log:
  throwing a binding exception when a referenced field does not exist in the form definition.
therefore the binding interface must be changed.
  
  Revision  Changes    Path
  1.7       +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/ComposedJXPathBindingBase.java
  
  Index: ComposedJXPathBindingBase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/ComposedJXPathBindingBase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ComposedJXPathBindingBase.java	11 Jan 2004 20:51:15 -0000	1.6
  +++ ComposedJXPathBindingBase.java	3 Feb 2004 12:22:08 -0000	1.7
  @@ -124,7 +124,7 @@
        * Actively performs the binding from the ObjectModel to the Woody-form
        * by passing the task onto it's children.
        */
  -    public void doLoad(Widget frmModel, JXPathContext jxpc) {
  +    public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
           if (this.subBindings != null) {
               int size = this.subBindings.length;
               for (int i = 0; i < size; i++) {
  
  
  
  1.7       +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/SimpleRepeaterJXPathBinding.java
  
  Index: SimpleRepeaterJXPathBinding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/SimpleRepeaterJXPathBinding.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SimpleRepeaterJXPathBinding.java	11 Jan 2004 20:51:16 -0000	1.6
  +++ SimpleRepeaterJXPathBinding.java	3 Feb 2004 12:22:08 -0000	1.7
  @@ -88,7 +88,7 @@
           this.deleteIfEmpty = deleteIfEmpty;
       }
   
  -    public void doLoad(Widget frmModel, JXPathContext jctx) {
  +    public void doLoad(Widget frmModel, JXPathContext jctx) throws BindingException {
           // Find the repeater and clear it
           Repeater repeater = (Repeater) frmModel.getWidget(this.repeaterId);
   
  
  
  
  1.8       +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/ContextJXPathBinding.java
  
  Index: ContextJXPathBinding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/ContextJXPathBinding.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ContextJXPathBinding.java	11 Jan 2004 20:51:16 -0000	1.7
  +++ ContextJXPathBinding.java	3 Feb 2004 12:22:08 -0000	1.8
  @@ -80,7 +80,7 @@
        * Actively performs the binding from the ObjectModel wrapped in a jxpath
        * context to the Woody-form.
        */
  -    public void doLoad(Widget frmModel, JXPathContext jxpc) {
  +    public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
           Pointer ptr = jxpc.getPointer(this.xpath);
           if (ptr.getNode() != null) {
               JXPathContext subContext = jxpc.getRelativeContext(ptr);
  
  
  
  1.5       +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/StructJXPathBinding.java
  
  Index: StructJXPathBinding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/StructJXPathBinding.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StructJXPathBinding.java	21 Jan 2004 20:18:19 -0000	1.4
  +++ StructJXPathBinding.java	3 Feb 2004 12:22:08 -0000	1.5
  @@ -89,7 +89,7 @@
        * narrows the scope on the object-model to the member xpath-context
        * before continuing the binding over the child-bindings.
        */
  -    public void doLoad(Widget frmModel, JXPathContext jxpc) {
  +    public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
           Struct structWidget = (Struct)getWidget(frmModel, this.widgetId);
           JXPathContext subContext = jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
           super.doLoad(structWidget, subContext);
  
  
  
  1.6       +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/Binding.java
  
  Index: Binding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/Binding.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Binding.java	11 Jan 2004 20:51:15 -0000	1.5
  +++ Binding.java	3 Feb 2004 12:22:08 -0000	1.6
  @@ -84,7 +84,7 @@
        * @param frmModel
        * @param objModel
        */
  -    void loadFormFromModel(Widget frmModel, Object objModel);
  +    void loadFormFromModel(Widget frmModel, Object objModel) throws BindingException;
   
       /**
        * Saves the infortmation-elements to the objModel from the frmModel.
  
  
  
  1.7       +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/AggregateJXPathBinding.java
  
  Index: AggregateJXPathBinding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/AggregateJXPathBinding.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AggregateJXPathBinding.java	11 Jan 2004 20:51:15 -0000	1.6
  +++ AggregateJXPathBinding.java	3 Feb 2004 12:22:08 -0000	1.7
  @@ -88,7 +88,7 @@
        * narrows the scope on the object-model to the member xpath-context
        * before continuing the binding over the child-bindings.
        */
  -    public void doLoad(Widget frmModel, JXPathContext jxpc) {
  +    public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
           AggregateField aggregate = (AggregateField) frmModel.getWidget(this.widgetId);
           JXPathContext subContext = jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
           super.doLoad(aggregate, subContext);
  
  
  
  1.5       +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/UnionJXPathBinding.java
  
  Index: UnionJXPathBinding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/UnionJXPathBinding.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- UnionJXPathBinding.java	27 Jan 2004 04:20:51 -0000	1.4
  +++ UnionJXPathBinding.java	3 Feb 2004 12:22:08 -0000	1.5
  @@ -90,7 +90,7 @@
        * narrows the scope on the object-model to the member xpath-context
        * before continuing the binding over the child-bindings.
        */
  -    public void doLoad(Widget frmModel, JXPathContext jxpc) {
  +    public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
           Widget widget = frmModel.getWidget(this.widgetId);
           JXPathContext subContext = jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
           if (!(widget instanceof Union))
  
  
  
  1.4       +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/NewJXPathBinding.java
  
  Index: NewJXPathBinding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/NewJXPathBinding.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- NewJXPathBinding.java	11 Jan 2004 20:51:16 -0000	1.3
  +++ NewJXPathBinding.java	3 Feb 2004 12:22:08 -0000	1.4
  @@ -92,7 +92,7 @@
        * narrows the scope on the object-model to the member xpath-context
        * before continuing the binding over the child-bindings.
        */
  -    public void doLoad(Widget frmModel, JXPathContext jxpc) {
  +    public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
           if (classBinding == null)
               resolve();
           if (classBinding instanceof ClassJXPathBinding) {
  
  
  
  1.5       +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/CaseJXPathBinding.java
  
  Index: CaseJXPathBinding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/CaseJXPathBinding.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CaseJXPathBinding.java	11 Jan 2004 20:51:15 -0000	1.4
  +++ CaseJXPathBinding.java	3 Feb 2004 12:22:08 -0000	1.5
  @@ -90,7 +90,7 @@
        * narrows the scope on the object-model to the member xpath-context
        * before continuing the binding over the child-bindings.
        */
  -    public void doLoad(Widget frmModel, JXPathContext jxpc) {
  +    public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
           Union unionWidget = (Union)frmModel;
           if (widgetId.equals(unionWidget.getValue())) {
               // JXPathContext subContext = jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
  
  
  
  1.5       +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/TempRepeaterJXPathBinding.java
  
  Index: TempRepeaterJXPathBinding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/TempRepeaterJXPathBinding.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TempRepeaterJXPathBinding.java	27 Jan 2004 05:50:08 -0000	1.4
  +++ TempRepeaterJXPathBinding.java	3 Feb 2004 12:22:08 -0000	1.5
  @@ -103,7 +103,7 @@
           this.deleteIfEmpty = deleteIfEmpty;
       }
   
  -    public void doLoad(Widget frmModel, JXPathContext jctx) {
  +    public void doLoad(Widget frmModel, JXPathContext jctx) throws BindingException {
           // (There should be a general widget type checker for all the bindings to use,
           // coupled with a general informative exception class to throw if the widget is
           // of the wrong type or null.)
  
  
  
  1.11      +6 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/ValueJXPathBinding.java
  
  Index: ValueJXPathBinding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/ValueJXPathBinding.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ValueJXPathBinding.java	11 Jan 2004 20:51:16 -0000	1.10
  +++ ValueJXPathBinding.java	3 Feb 2004 12:22:08 -0000	1.11
  @@ -114,8 +114,12 @@
        * Actively performs the binding from the ObjectModel wrapped in a jxpath
        * context to the Woody-form-widget specified in this object.
        */
  -    public void doLoad(Widget frmModel, JXPathContext jxpc) {
  +    public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
           Widget widget = frmModel.getWidget(this.fieldId);
  +        if (widget == null) {
  +            throw new BindingException("The widget with the ID [" + this.fieldId
  +                    + "] referenced in the binding does not exist in the form definition.");
  +        }
           Object value = jxpc.getValue(this.xpath);
   
           if (value != null && convertor != null) {
  
  
  
  1.16      +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/JXPathBindingManager.java
  
  Index: JXPathBindingManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/JXPathBindingManager.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- JXPathBindingManager.java	2 Feb 2004 21:29:54 -0000	1.15
  +++ JXPathBindingManager.java	3 Feb 2004 12:22:08 -0000	1.16
  @@ -136,7 +136,7 @@
       }
   
       protected Binding getStoredBindingDefinition(Source source) {
  -        return (Binding)getStoredDefinition(source, bindingKeyPrefix + source.getURI());
  +        return getStoredDefinition(source, bindingKeyPrefix + source.getURI());
       }
   
       protected void storeBindingDefinition(Binding bindingDefinition, Source source) throws
IOException {
  
  
  
  1.18      +2 -2      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/RepeaterJXPathBinding.java
  
  Index: RepeaterJXPathBinding.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/RepeaterJXPathBinding.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- RepeaterJXPathBinding.java	27 Jan 2004 20:58:52 -0000	1.17
  +++ RepeaterJXPathBinding.java	3 Feb 2004 12:22:08 -0000	1.18
  @@ -137,7 +137,7 @@
        * objectModelContext and Repeater to the repeated rows before handing
        * over to the actual binding-children.
        */
  -    public void doLoad(Widget frmModel, JXPathContext jxpc) {
  +    public void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException {
           // Find the repeater
           Repeater repeater = (Repeater) frmModel.getWidget(this.repeaterId);
           repeater.removeRows();
  
  
  
  1.11      +4 -4      cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/JXPathBindingBase.java
  
  Index: JXPathBindingBase.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding/JXPathBindingBase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- JXPathBindingBase.java	11 Jan 2004 20:51:16 -0000	1.10
  +++ JXPathBindingBase.java	3 Feb 2004 12:22:08 -0000	1.11
  @@ -146,7 +146,7 @@
        * Performs the actual load binding regardless of the flag {@see #loadEnabled}.
        * Abstract method that subclasses need to implement for specific activity.
        */
  -    public abstract void doLoad(Widget frmModel, JXPathContext jxpc);
  +    public abstract void doLoad(Widget frmModel, JXPathContext jxpc) throws BindingException;
   
       /**
        * Redefines the Binding action as working on a JXPathContext Type rather
  @@ -154,7 +154,7 @@
        * Executes the actual loading {@see #doLoad(Widget, JXPathContext)}
        * depending on the value of {@see #loadEnabled}
        */
  -    public final void loadFormFromModel(Widget frmModel, JXPathContext jxpc) {
  +    public final void loadFormFromModel(Widget frmModel, JXPathContext jxpc) throws BindingException
{
           boolean inheritedLeniency = jxpc.isLenient();
           applyLeniency(jxpc);
           if (this.commonAtts.loadEnabled) {
  @@ -168,7 +168,7 @@
        * it up in a JXPathContext object and then transfering control over to
        * the new overloaded version of this method.
        */
  -    public final void loadFormFromModel(Widget frmModel, Object objModel) {
  +    public final void loadFormFromModel(Widget frmModel, Object objModel) throws BindingException
{
           if (objModel == null) {
               throw new NullPointerException("null object passed to loadFormFromModel() method");
           }
  
  
  

Mime
View raw message