You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Suzan Foster (JIRA)" <ji...@apache.org> on 2006/03/07 12:44:38 UTC

[jira] Created: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

[PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
---------------------------------------------------------------------------------------------------------

         Key: COCOON-1794
         URL: http://issues.apache.org/jira/browse/COCOON-1794
     Project: Cocoon
        Type: Bug
  Components: Blocks: Forms  
    Versions: 2.1.8, 2.1.9-dev (current SVN)    
    Reporter: Suzan Foster
 Attachments: repeater-binding-patch.txt

This patch corrects the following issues:
- Namespaced back-end XML model not correctly binding to the repeaters child widgets.
- Nodes bound to row widgets not being reordered according to row position on save.

Files affected:
- JXPathBindingBase:
  - member applyLeniency changed from private to protected.
  - member applyNSDeclarations changed from private to protected.

- RepeaterJXPathBinding:
  - constructor changed for passing a binding for moveRow.
  - applyLeniency and applyNSDeclarations applied to created relative contexts.
  - member moveRowBinding added.
  - method getMoveRowBinding added.
  - doSave changed to incorporate the use of moveRowBinding.

- RepeaterJXPathBindingBuilder:
  - buildBinding changed to incorporate the construction of moveRowBinding.

Files added:
- MoveNodeJXPathBinding.
- MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598885#action_12598885 ] 

Jörg Heinicke commented on COCOON-1794:
---------------------------------------

The patch does not change anything for non-repeater bindings. Does this imply that binding to default namespace actually works in general, the namespaces are just not propagated down to repeater children?

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON-1794
>                 URL: https://issues.apache.org/jira/browse/COCOON-1794
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.8, 2.1.9
>            Reporter: Suzan Foster
>         Attachments: repeater-binding-patch.txt
>
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Suzan Foster (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369450 ] 

Suzan Foster commented on COCOON-1794:
--------------------------------------

The MoveNodeJXPathBinding doesn't move all rows up to the top of their enclosing element. It first checks if the current node is the same as the child node in the parent node at the index position equal to the row index. If so it falls through. If not it inserts the context node before the child node which effectively positions the node at the correct index position.

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Suzan Foster (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369449 ] 

Suzan Foster commented on COCOON-1794:
--------------------------------------

pre-condition:

...
<co:list xml:id="a_aa">
  <co:row xml:id="a_ab">
    ...
  </co:row>
  <co:row xml:id="a_ac">
    ...
  </co:row>
  <co:row xml:id="a_ad">
    ...
  </co:row>
  <co:row xml:id="a_ae">
    ...
  </co:row>
</co:list>
...

after load:

row index (1) identity (a_ab)
row index (2) identity (a_ac)
row index (3) identity (a_ad)
row index (4) identity (a_ae)

after user interaction:

row index (1) identity (a_ac) 
row index (2) identity (a_ab) <-- move down by one
row index (3) identity ()          <-- append and move up by one
row index (4) identity (a_ad)
( row index (5) identity (a_ae) <-- deleted )

condition expected after save:

...
<co:list xml:id="a_aa">
  <co:row xml:id="a_ac">
    ...
  </co:row>
  <co:row xml:id="a_ab">
    ...
  </co:row>
  <co:row xml:id="b_eg">
    ...
  </co:row>
  <co:row xml:id="a_ad">
    ...
  </co:row>
</co:list>
...

after save with insert after only:

...
<co:list xml:id="a_aa">
  <co:row xml:id="a_ab">
    ...
  </co:row>
  <co:row xml:id="b_eg">
    ...
  </co:row>
  <co:row xml:id="a_ac">
    ...
  </co:row>
  <co:row xml:id="a_ad">
    ...
  </co:row>
</co:list>
...

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Suzan Foster (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369623 ] 

Suzan Foster commented on COCOON-1794:
--------------------------------------

OK, i think i can see where the miscommunication is here. I take it you mean that if i do not use an identity binding in my repeater all old nodes are deleted and new versions are inserted and filled using the child bindings. Correct? This however doesn't work with my use-case as i use the xml:id attribute as the identity for a bound node.  The repeater will lookup the corresponding context and execute the child bindings in-place. Seeing as i don't bind all the nodes in my xml i can't let the binding build the nodes from scratch every time it saves as this would lead to data loss.

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Suzan Foster (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369438 ] 

Suzan Foster commented on COCOON-1794:
--------------------------------------

In my own case an InsertAfterNodeJXPathBinding isn't sufficient as i need to have positioning capability without the insertion capability. That said i wouldn't be hindered by it either, so would see it as an improvement on the current appending implementation.

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Suzan Foster (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-1794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12598943#action_12598943 ] 

Suzan Foster commented on COCOON-1794:
--------------------------------------

Yes, I believe that is correct. Along with configuring the SAX parser namespace aware this should sort out  all namespace binding problems.

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON-1794
>                 URL: https://issues.apache.org/jira/browse/COCOON-1794
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.8, 2.1.9
>            Reporter: Suzan Foster
>         Attachments: repeater-binding-patch.txt
>
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Max Pfingsthorn (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369260 ] 

Max Pfingsthorn commented on COCOON-1794:
-----------------------------------------

This is an interesting topic. However, retrospectively moving the rows around doesn't seem to be the best way to solve this. Instead, the InsertNodeJXPathBinding should know to insert a node after another (or before). I'm having a look into it right now as we have the same problem.
Additionally, we should try to stay backward compatible with the repeater definition and we shouldn't break being able to bind to beans. Keeping it consistent between XML and JavaBeans bindings might be a problem as beans don't support moving children around after they are added. And requiring a "move" binding which doesn't exist for beans of course makes the repeater unusable for that case.

I would put some XML specific code in to the RepeaterJXPathBinding if the insertBinding is a InsertNodeJXPathBinding. That way, we can ensure the relative AND absolute positioning of the XML elements created by the binding.

By absolute I mean this: We often use the repeater without an enclosing context for each row. New rows will always end up in the end of the document (or enclosing element), not after the bulk of other rows, which can be a big problem if you need to validate the resulting xml.

So, I'll be working on some specific hacks to make this work for XML and not break it for beans without influencing the configs.

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Suzan Foster (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369431 ] 

Suzan Foster commented on COCOON-1794:
--------------------------------------

You can't do this in a single iteration. You don't know which nodes are marked for deletion untill you have done your first pass seeing as the deletion criterium is 'not bound to a row'. If you look at the current code you will see that it doesn't call deleteRowBinding.saveFormToModel(row,context) but deleteRowBinding.saveFormToModel(repeater,context). Also your pseudocode still doesn't take positioning into account save for newly inserted nodes. I believe it is better to be pragmatic in solving this issue instead of how you would rather do it. 

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Max Pfingsthorn (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369434 ] 

Max Pfingsthorn commented on COCOON-1794:
-----------------------------------------

Okay, fine. They only thing I would like to accomplish, and which is important to VNU and Hippo as well, is that this repeater would work without an enclosing element for the rows. This is currently not the case, and this is also not fixed by your patch. Actually, your patch will make it worse as you assume that the parent element will only have the repeater's rows as children. If you just move a row element after the ith element of the parent, bad things can happen (in terms of document validity).

Our concern is to have a schema validateable output from cforms. This includes namespaces and element ordering, especially with repeaters without their own parent element. Imagine something like this:

<doc>
   <meta>
     <title>bla</title>
    </meta>
    <content>
       <p>some paragraph</p>
    </content>
    <content>
       <p>some other paragraph</p>
    </content>
    <link></link>
    <link></link>
</doc>

For the content and link elements, we want to use a repeater and not have contents after links in the output, which does happen now. I've been thinking about it myself, and your patch just seemed like a good idea to discuss a little.

Actually, now, the only thing that we have to do to fix this is to make an InsertAfterNodeJXPathBinding, and in the loop where new rows get inserted, use that one which takes the previous row's node and inserts a node after that one. This way, we will keep everything neatly aligned and no moving is necessary, right?

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Max Pfingsthorn (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369471 ] 

Max Pfingsthorn commented on COCOON-1794:
-----------------------------------------

Sorry, that is not right. The repeater will _always_ save rows in order, the only thing that is appended are placeholders to extend the list.
Actually, your usecase should work right now without changes to the repeater binding (other than the ones for the namespaces) since you use a wrapper element.

My change is that new placeholder elements for rows are appended to the bulk of existing row elements instead of at the end of the parent element. That keeps chunks of row data together instead of splitting them when no wrapper element is available.

Your move binding will actually never do anything, as you pointed out, because the rows are saved in order. Of course, the only thing you have to do is to assign new ids to new rows, but I guess you already took care of that.


> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Suzan Foster (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369295 ] 

Suzan Foster commented on COCOON-1794:
--------------------------------------

I don't think the InsertNodeJXPathBinding is the correct place to implement positioning. Positioning doesn't imply insertion as an existing row can be freely repositioned. This means that it is perfectly sane to have a repeater which doesn't define an insertion method but does define a positioning method. The proposal is exactly the same approach as used for both on-insert-row and on-delete-row, so seemd the most logical to implement.

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Max Pfingsthorn (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369430 ] 

Max Pfingsthorn commented on COCOON-1794:
-----------------------------------------

Actually, I meant to implement this in the repeater binding.

You are right though, positioning is important and makes sense. However, I would rather do it somehow like this:

previousContext = nil
for each row in repeater do
    context = getRowContext(row)

    if(context==null)
        insertAfterBinding.saveFormToModel(row,previousContext)
        context = getRowContext(row)

    if(row.isUpdated() || row.isCreated())
        rowBinding.saveFormToModel(row,context)
    else
        deleteRowBinding.saveFormToModel(row,context)

Insert after binding would work for both xml and beans. In the beans case, we could add a new object (like the InsertBeanJXPathBinding) and shift the ones below the one to insert after down.

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Max Pfingsthorn (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369441 ] 

Max Pfingsthorn commented on COCOON-1794:
-----------------------------------------

Hmm.. not so sure. What I did now was to implement an InsertAfterNodeJXPathBinding which is used instead of InsertNodeJXPathBinding in <fb:on-insert-row>. The next thing is a bit hacky: The RepeaterJXPathBinding knows about the InsertAfterNodeJXPathBinding and uses the path of the previously inserted or last accessed row so that the new node is created right after that one.

It does work, but it's not as clean as I'd like. The tricky thing is, you need to supply another context to the binding for relative positioning. This sort of positioning functionality is just not implemented and it is really hard and awkward to force it into the doSave(Widget, Context) method.

Why do you need an absolute positioning though? They only thing you do now in your MoveNodeJXPathBinding is move all rows up to the top of their enclosing element. They will still be in order they were in the form. Before, they were as well, just as many rows as were newly created were on the bottom of the enclosing element. This does not hurt at all if you have an enclosing element only for the rows. Your addition would not reorder them, as far as I can see.

Can you show your usecase to make this clearer?

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Suzan Foster (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369500 ] 

Suzan Foster commented on COCOON-1794:
--------------------------------------

In which release has this been fixed. I have checked with 2.1.8 and it does not change the order of the nodes and subsequently saves the xml without reordering. My id's are persistent and are only generated on insertion (xquery in x-hive).

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (COCOON-1794) [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding

Posted by "Suzan Foster (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1794?page=comments#action_12369437 ] 

Suzan Foster commented on COCOON-1794:
--------------------------------------

I see your point regarding the mixed nodes. Couldn't you solve this by using a javascript binding to implement the positioning? f.i.:

<fb:repeater id="content-set" parent-path="doc" row-path="content">
  ...
  <fb:on-move-row>
    <fb:javascript path=".">
      <![CDATA[
       // insert positioning code here..
       ]]>
    </fb:javascript>
  </fb:on-move-row>
  ...
</fb:repeater>

> [PATCH] Propagation of namespaces to a repeaters child bindings and implementation of a move-node binding
> ---------------------------------------------------------------------------------------------------------
>
>          Key: COCOON-1794
>          URL: http://issues.apache.org/jira/browse/COCOON-1794
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8, 2.1.9-dev (current SVN)
>     Reporter: Suzan Foster
>  Attachments: repeater-binding-patch.txt
>
> This patch corrects the following issues:
> - Namespaced back-end XML model not correctly binding to the repeaters child widgets.
> - Nodes bound to row widgets not being reordered according to row position on save.
> Files affected:
> - JXPathBindingBase:
>   - member applyLeniency changed from private to protected.
>   - member applyNSDeclarations changed from private to protected.
> - RepeaterJXPathBinding:
>   - constructor changed for passing a binding for moveRow.
>   - applyLeniency and applyNSDeclarations applied to created relative contexts.
>   - member moveRowBinding added.
>   - method getMoveRowBinding added.
>   - doSave changed to incorporate the use of moveRowBinding.
> - RepeaterJXPathBindingBuilder:
>   - buildBinding changed to incorporate the construction of moveRowBinding.
> Files added:
> - MoveNodeJXPathBinding.
> - MoveNodeJXPathBindingBuilder.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira