You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ti...@apache.org on 2004/01/21 21:18:19 UTC

cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding StructJXPathBinding.java

tim         2004/01/21 12:18:19

  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/binding
                        StructJXPathBinding.java
  Log:
  Make StructJXPathBinding respect path attribute,
  and use super class to handle sub-bindings.
  
  Revision  Changes    Path
  1.4       +5 -15     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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StructJXPathBinding.java	11 Jan 2004 20:51:16 -0000	1.3
  +++ StructJXPathBinding.java	21 Jan 2004 20:18:19 -0000	1.4
  @@ -91,13 +91,8 @@
        */
       public void doLoad(Widget frmModel, JXPathContext jxpc) {
           Struct structWidget = (Struct)getWidget(frmModel, this.widgetId);
  -        Binding[] subBindings = getChildBindings();
  -        if (subBindings != null) {
  -            int size = subBindings.length;
  -            for (int i = 0; i < size; i++) {
  -                subBindings[i].loadFormFromModel(structWidget, jxpc);
  -            }
  -        }
  +        JXPathContext subContext = jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
  +        super.doLoad(structWidget, subContext);
           if (getLogger().isDebugEnabled()) {
               getLogger().debug("done loading " + toString());
           }
  @@ -110,13 +105,8 @@
        */
       public void doSave(Widget frmModel, JXPathContext jxpc) throws BindingException {
           Struct structWidget = (Struct)frmModel.getWidget(this.widgetId);
  -        Binding[] subBindings = getChildBindings();
  -        if (subBindings != null) {
  -            int size = subBindings.length;
  -            for (int i = 0; i < size; i++) {
  -                subBindings[i].saveFormToModel(structWidget, jxpc);
  -            }
  -        }
  +        JXPathContext subContext = jxpc.getRelativeContext(jxpc.getPointer(this.xpath));
  +        super.doSave(structWidget, subContext);
           if (getLogger().isDebugEnabled()) {
               getLogger().debug("done saving " + toString());
           }