You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jeremy Quinn <je...@media.demon.co.uk> on 2004/07/07 12:57:02 UTC
handling XML Node deletion in CForms
Hi All
We have an XML Model, being edited by CForms.
eg:
<storyboard id="blah">
. . .
<shots>
<shot id="blag">
<preview ref="0123456789" mime-type="image/jpeg"/>
. . .
</shot>
. . .
</shots>
</storyboard>
<shots/> is a repeater field.
It all currently works, but we are adding a preview upload feature to
it and this is bringing some extra complications.
When someone adds a Shot, they will have the option of uploading a
preview image or video along with it, which is stored in our
repository, with a reference to it stored in the XML.
When someone deletes a shot, we need to be able to delete the preview
from the repository.
Is there some way to have a FlowScript function called from the binding
when node deletion takes place in a CForms repeater ?
Thanks for any suggestions.
regards Jeremy
--------------------------------------------------------
If email from this address is not signed
IT IS NOT FROM ME
Always check the label, folks !!!!!
--------------------------------------------------------
Re: handling XML Node deletion in CForms
Posted by Jeremy Quinn <je...@media.demon.co.uk>.
Now, I realise that the Shot Previews cannot be deleted by JavaScripts
in the Binding, because the user may decide to cancel the form
operation after they have removed Shots in the repeater rows.
So I need to maintain a record somehow of what Shots are being deleted,
so I can then remove the Shot Previews only after the form is
submitted.
Hrumph !
regards Jeremy
On 8 Jul 2004, at 10:22, Jeremy Quinn wrote:
>
> On 8 Jul 2004, at 09:59, Joerg Heinicke wrote:
>
>> On 08.07.2004 10:52, Jeremy Quinn wrote:
>>>>> Is there some way to have a FlowScript function called from the
>>>>> binding when node deletion takes place in a CForms repeater ?
>>>>
>>>>
>>>> You could try using a <fb:javascript> element inside the
>>>> <fb:on-delete-row> element of your repeater binding. I haven't
>>>> tried it myself, so I'm not sure if it'll work, but you never
>>>> know...
>>> Thanks for your reply.
>>> Something I stupidly forgot to mention, I am using a
>>> simple-repeater, it does not take fb:on-delete-row.
>>
>> Simple repeater does not make a diff IIRC. It just removes *all* rows
>> and readds the new ones. So an event on-delete-row does not make
>> sense for it.
>
> TBH. I am a bit confused about the two repeaters and how they work
> with an XML Model.
> This is what I have (this project still uses 2.1.4 and Woody) :
>
> <wb:context
> xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
> xmlns:wd="http://apache.org/cocoon/woody/definition/1.0"
> path="/storyboard">
> <wb:value id="title" path="title"/>
> <wb:value id="description" path="description"/>
> <wb:value id="creator" path="creator"/>
> <wb:value id="count" path="string(count(shots/shot))"
> direction="load"/>
> <wb:simple-repeater id="shots"
> parent-path="shots"
> row-path="shot">
> <wb:value id="id" path="./@id"/>
> <wb:value id="title" path="title"/>
> <wb:value id="description" path="description"/>
> <wb:value id="wasshot" path="wasshot"/>
> <wb:value id="shotok" path="shotok"/>
> <wb:value id="created" path="created"/>
> <wb:value id="preview" path="preview"/>
> <wb:value id="mimetype" path="preview/@mimetype"/>
> </wb:simple-repeater>
> </wb:context>
>
> to edit this :
>
> <storyboard id="blah">
> . . .
> <shots>
> <shot id="blag">
> <preview ref="0123456789" mime-type="image/jpeg"/>
> . . .
> </shot>
> . . .
> </shots>
> </storyboard>
>
> Can I use (non-simple) Repeater with this?
> Plus have Up, Down, Delete and Add buttons.
>
> Thanks
>
> regards Jeremy
>
> --------------------------------------------------------
>
> If email from this address is not signed
> IT IS NOT FROM ME
>
> Always check the label, folks !!!!!
> --------------------------------------------------------
>
>
--------------------------------------------------------
If email from this address is not signed
IT IS NOT FROM ME
Always check the label, folks !!!!!
--------------------------------------------------------
Re: handling XML Node deletion in CForms
Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 8 Jul 2004, at 09:59, Joerg Heinicke wrote:
> On 08.07.2004 10:52, Jeremy Quinn wrote:
>>>> Is there some way to have a FlowScript function called from the
>>>> binding when node deletion takes place in a CForms repeater ?
>>>
>>>
>>> You could try using a <fb:javascript> element inside the
>>> <fb:on-delete-row> element of your repeater binding. I haven't tried
>>> it myself, so I'm not sure if it'll work, but you never know...
>> Thanks for your reply.
>> Something I stupidly forgot to mention, I am using a simple-repeater,
>> it does not take fb:on-delete-row.
>
> Simple repeater does not make a diff IIRC. It just removes *all* rows
> and readds the new ones. So an event on-delete-row does not make sense
> for it.
TBH. I am a bit confused about the two repeaters and how they work with
an XML Model.
This is what I have (this project still uses 2.1.4 and Woody) :
<wb:context
xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
xmlns:wd="http://apache.org/cocoon/woody/definition/1.0"
path="/storyboard">
<wb:value id="title" path="title"/>
<wb:value id="description" path="description"/>
<wb:value id="creator" path="creator"/>
<wb:value id="count" path="string(count(shots/shot))"
direction="load"/>
<wb:simple-repeater id="shots"
parent-path="shots"
row-path="shot">
<wb:value id="id" path="./@id"/>
<wb:value id="title" path="title"/>
<wb:value id="description" path="description"/>
<wb:value id="wasshot" path="wasshot"/>
<wb:value id="shotok" path="shotok"/>
<wb:value id="created" path="created"/>
<wb:value id="preview" path="preview"/>
<wb:value id="mimetype" path="preview/@mimetype"/>
</wb:simple-repeater>
</wb:context>
to edit this :
<storyboard id="blah">
. . .
<shots>
<shot id="blag">
<preview ref="0123456789" mime-type="image/jpeg"/>
. . .
</shot>
. . .
</shots>
</storyboard>
Can I use (non-simple) Repeater with this?
Plus have Up, Down, Delete and Add buttons.
Thanks
regards Jeremy
--------------------------------------------------------
If email from this address is not signed
IT IS NOT FROM ME
Always check the label, folks !!!!!
--------------------------------------------------------
Re: handling XML Node deletion in CForms
Posted by Joerg Heinicke <jo...@gmx.de>.
On 08.07.2004 10:52, Jeremy Quinn wrote:
>
>>> Is there some way to have a FlowScript function called from the
>>> binding when node deletion takes place in a CForms repeater ?
>>
>>
>> You could try using a <fb:javascript> element inside the
>> <fb:on-delete-row> element of your repeater binding. I haven't tried
>> it myself, so I'm not sure if it'll work, but you never know...
>
>
> Thanks for your reply.
> Something I stupidly forgot to mention, I am using a simple-repeater, it
> does not take fb:on-delete-row.
Simple repeater does not make a diff IIRC. It just removes *all* rows
and readds the new ones. So an event on-delete-row does not make sense
for it.
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: handling XML Node deletion in CForms
Posted by Jeremy Quinn <je...@media.demon.co.uk>.
On 7 Jul 2004, at 16:26, Vilya Harvey wrote:
> Jeremy Quinn wrote:
>> Is there some way to have a FlowScript function called from the
>> binding when node deletion takes place in a CForms repeater ?
>
> You could try using a <fb:javascript> element inside the
> <fb:on-delete-row> element of your repeater binding. I haven't tried
> it myself, so I'm not sure if it'll work, but you never know...
Thanks for your reply.
Something I stupidly forgot to mention, I am using a simple-repeater,
it does not take fb:on-delete-row.
regards Jeremy
--------------------------------------------------------
If email from this address is not signed
IT IS NOT FROM ME
Always check the label, folks !!!!!
--------------------------------------------------------
Re: handling XML Node deletion in CForms
Posted by Vilya Harvey <vi...@lineone.net>.
Jeremy Quinn wrote:
> Is there some way to have a FlowScript function called from the binding
> when node deletion takes place in a CForms repeater ?
You could try using a <fb:javascript> element inside the <fb:on-delete-row>
element of your repeater binding. I haven't tried it myself, so I'm not sure
if it'll work, but you never know...
Vil.
--
__
o| _. / \|o._ _ _ ._ _ ._ _ _|_
\/ ||\/(_|| (|/||| |(/_(_)| |(/_o| |(/_ |_
/ \__
http://website.lineone.net/~vilya
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org