cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vgritse...@hns.com>
Subject RE: [BUG C2] act method of Database Actions always return null
Date Fri, 27 Jul 2001 18:15:34 GMT
> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: Friday, July 27, 2001 10:59 AM
> To: cocoon-dev@xml.apache.org
> Subject: Re: [BUG C2] act method of Database Actions always return null
> 
> 
> Vadim Gritsenko wrote:
> > 
> > Berin,
> > 
> > I think that you as author of this actions know the answer on my question:
> > 
> > I'm thinking of returning number of updated rows in Database[Update|Delete]Action
as a result.
> > Name of result parameter in the map would be "rows". Is it OK - should I commit
the changes?
> 
> Sure--as long as you keep two things in mind:
> 
> 1) Never return a map if the query failed
> 2) The returned map has substitution values for the sitemap.  I doubt you will be
>    selecting stylesheets based on the number of rows updated.  Perhaps it would
>    be better to set Request attributes instead.

Makes perfect sence! Done. Return result is empty Map on success and row count as request
attribute, "null" if nothing has been changed, and exception for all other cases.

Vadim

> > 
> > Thanks,
> > Vadim
> > 
> > > -----Original Message-----
> > > From: Robert Marcano [mailto:robmv@promca.com]
> > > Sent: Monday, July 23, 2001 2:45 PM
> > > To: cocoon-dev
> > > Subject: [BUG C2] act method of Database Actions always return null
> > >
> > >
> > > The act method in org.apache.cocoon.acting.Action interface has the
> > > following comment for the return value:
> > >
> > >     The returned <code>Map</code> object with
> > >     sitemap substitution values which can be used
> > >     in subsequent elements attributes like src=
> > >     using a xpath like expression: src="mydir/{myval}/foo"
> > >     If the return value is null the processing inside
> > >     the <map:act> element of the sitemap will
> > >     be skipped.
> > >
> > > the DatabaseUpdateAction and DatabaseDeleteAction, always return null,
> > > so the contents of the map:act is never executed
> > >
> > > --
> > > Robert Marcano (robmv@promca.com)
> > > System Architect
> > > IBM OS/2, VisualAge C++, Java, Smalltalk certified
> > >
> > > aol/netscape screen id: robmv
> > > jabber id: robmv@jabber.org
> > > icq id: 101913663
> > >


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message