You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joel McConaughy <jo...@displayware.com> on 2004/05/03 17:52:28 UTC
wb:delete-bean?
Is there a delete equivalent to <wb:insert-bean>? I'd like to pick up
the delete event and do some app-specific processing on the row before
it is removed from the repeater with <wb:delete-node/> but don't know
how to access the row. Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: wb:delete-bean?
Posted by Joerg Heinicke <jo...@gmx.de>.
On 04.05.2004 00:45, Marc Portier wrote:
>> Is there a delete equivalent to <wb:insert-bean>? I'd like to pick up
>
> wb:delete-node works for beans and xml files
>
>> it is removed from the repeater with <wb:delete-node/> but don't know
>> how to access the row. Thanks.
>
> maybe you can explain a bit more off what you try to achieve
I guess calling some java method as it is done for inserting a bean.
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: wb:delete-bean?
Posted by Marc Portier <mp...@outerthought.org>.
Mark Lundquist wrote:
>
> On May 4, 2004, at 10:54 AM, Joel McConaughy wrote:
>
>> I'm using hibernate/cforms to build simple CRUD pages.
>
>
> Have you seen the alternative acronymn?: Create/Read/Amend/Purge :-)
>
>> These take the
>> results from a query and create an ArrayList of beans, display a page
>> worth of rows in a repeater, allow in place editting, and persist the
>> results back to the database.
>>
>> Hibernate handles row updates automatically. Insertions are handled in
>> the flow by explicitly calling a hibernate save operation on any row
>> with a null ID.
>>
>> Deletions are the problem. Hibernate requires that I explicitly call a
>> delete method for each deleted row. Cforms doesn't keep track of
>> deleted rows within a repeater so I believe that I need to do this as
>> each delete event is fired. However, I don't know how to access the row
>> inside the <wb:on-delete> tag or how to call some external Java from
>> there.
>>
>> May be there's an easier way to accomplish this?
>
>
> I know you can do it with the v2 forms/flow API... see the flowscript in
> the v2 samples directory.
>
> There might be a way to do it with the <wb:on-delete> way, but I'll let
> somebody else answer that 'cause I don't know! :-)
>
I don't think there is that much to know though, since it doesn't do it
ATM, (and thx for making me realize the goal here)
binding's save() on the repeater tries to 'identify' which rows have
been lost and just executes the nested on-delete binding on those (this
might sound like an event, but is not executed on the moment the row
actually gets deleted, as such binding is not an interceptive part of
the form-model but just a pre/post processing for loading/saving values)
the current row-delete/update/insert recognition has been reported in
the past to be somewhat limited for certain use cases, and many people
have been adding their own implmentations (in fact with the
Custom-binding you could easily add one like that as well)
in any case: some thought has been already given on unifying all those
repeater-implementations to make it more complete out of the box... it's
on my personal todo (somewhere) which means I'll welcome any additional
ideas or better: ready patches :-)
to read up on some of the new binding ideas:
- http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=108059910416310&w=2
- http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=108209653422163&w=2
- http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=108194795223412&w=2
regards,
-marc=
--
Marc Portier http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/mpo/
mpo@outerthought.org mpo@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: wb:delete-bean?
Posted by Mark Lundquist <ml...@wrinkledog.com>.
On May 4, 2004, at 10:54 AM, Joel McConaughy wrote:
> I'm using hibernate/cforms to build simple CRUD pages.
Have you seen the alternative acronymn?: Create/Read/Amend/Purge :-)
> These take the
> results from a query and create an ArrayList of beans, display a page
> worth of rows in a repeater, allow in place editting, and persist the
> results back to the database.
>
> Hibernate handles row updates automatically. Insertions are handled in
> the flow by explicitly calling a hibernate save operation on any row
> with a null ID.
>
> Deletions are the problem. Hibernate requires that I explicitly call a
> delete method for each deleted row. Cforms doesn't keep track of
> deleted rows within a repeater so I believe that I need to do this as
> each delete event is fired. However, I don't know how to access the
> row
> inside the <wb:on-delete> tag or how to call some external Java from
> there.
>
> May be there's an easier way to accomplish this?
I know you can do it with the v2 forms/flow API... see the flowscript
in the v2 samples directory.
There might be a way to do it with the <wb:on-delete> way, but I'll
let somebody else answer that 'cause I don't know! :-)
~mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: wb:delete-bean?
Posted by Joel McConaughy <jo...@displayware.com>.
I'm using hibernate/cforms to build simple CRUD pages. These take the
results from a query and create an ArrayList of beans, display a page
worth of rows in a repeater, allow in place editting, and persist the
results back to the database.
Hibernate handles row updates automatically. Insertions are handled in
the flow by explicitly calling a hibernate save operation on any row
with a null ID.
Deletions are the problem. Hibernate requires that I explicitly call a
delete method for each deleted row. Cforms doesn't keep track of
deleted rows within a repeater so I believe that I need to do this as
each delete event is fired. However, I don't know how to access the row
inside the <wb:on-delete> tag or how to call some external Java from
there.
May be there's an easier way to accomplish this?
Thanks for the response.
joel
Joel McConaughy
Managing Partner
Displayware LLC
800 Fifth Ave., #101-316
Seattle, WA 98104-3191
206-300-4732 Direct
206-382-2188 Fax
joel@displayware.com
-----Original Message-----
From: Marc Portier [mailto:mpo@outerthought.org]
Sent: Monday, May 03, 2004 3:46 PM
To: users@cocoon.apache.org
Subject: Re: wb:delete-bean?
Joel McConaughy wrote:
> Is there a delete equivalent to <wb:insert-bean>? I'd like to pick up
wb:delete-node works for beans and xml files
> the delete event and do some app-specific processing on the row before
what do you mean with 'pickup the delete event?'
execution of the binding (load/save) is not triggering any events of
this kind
> it is removed from the repeater with <wb:delete-node/> but don't know
> how to access the row. Thanks.
>
maybe you can explain a bit more off what you try to achieve
-marc=
--
Marc Portier http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/mpo/
mpo@outerthought.org mpo@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: wb:delete-bean?
Posted by Marc Portier <mp...@outerthought.org>.
Joel McConaughy wrote:
> Is there a delete equivalent to <wb:insert-bean>? I'd like to pick up
wb:delete-node works for beans and xml files
> the delete event and do some app-specific processing on the row before
what do you mean with 'pickup the delete event?'
execution of the binding (load/save) is not triggering any events of
this kind
> it is removed from the repeater with <wb:delete-node/> but don't know
> how to access the row. Thanks.
>
maybe you can explain a bit more off what you try to achieve
-marc=
--
Marc Portier http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/mpo/
mpo@outerthought.org mpo@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org