You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Matthias Brunner <mb...@blumenstrasse.vol.at> on 2002/12/10 17:05:24 UTC

Accessing DatabaseAddAction result

Hello,

is there any way to find out whether a DatabaseAddAction was 
successful / display the error message?

I would like to do the following:
<map:match ...>

	<map:action-set name="mydb">
		<map:parameter .../>
	</map:action>

	<map:generate .../>
	...
	...
</map:match>

I do not want to have to different input sources dependent on whether 
the action was successful. Actually, I just want the same form to be 
reloaded and to display "record added" (or an error message on top 
of the page).
I see in the source that DatabaseUpdateAction sets a request 
attribute "rows" to indicate how many rows where updated.
Why does DatebaseAddAction not set something like two request 
attributes "success" and "errorMessage"?

Or is this not the cocoon way of doing it? How is this realised 
without having to rely on xsp? (AFAIK, it is also possible to access 
request attributes in xsl)

Best regards!
-- 
Matthias Brunner <mb...@blumenstrasse.vol.at>
PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Accessing DatabaseAddAction result

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 10.Dec.2002 -- 05:57 PM, Matthias Brunner wrote:
> On Tuesday 10 December 2002 17:19, Christian Haul wrote:
> > At least the one from the modular package does set the error
> > message as request attribute.
> 
> Thanks for your reply. Do you know whether this is in 2.1 only? (I 
> cannot grep "setAttribute" in the source file but it could be hidden 
> in other modules)

No, it's in 2.0.4 as well. Only that it does not access the request
object directly but uses o.a.c.c.m.* to do that.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Accessing DatabaseAddAction result

Posted by Matthias Brunner <mb...@blumenstrasse.vol.at>.
On Tuesday 10 December 2002 17:19, Christian Haul wrote:
> At least the one from the modular package does set the error
> message as request attribute.

Thanks for your reply. Do you know whether this is in 2.1 only? (I 
cannot grep "setAttribute" in the source file but it could be hidden 
in other modules)

Best regards!
-- 
Matthias Brunner <mb...@blumenstrasse.vol.at>
PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Accessing DatabaseAddAction result

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 10.Dec.2002 -- 05:05 PM, Matthias Brunner wrote:
> Hello,
> 
> is there any way to find out whether a DatabaseAddAction was 
> successful / display the error message?
> 
> I would like to do the following:
> <map:match ...>
> 
> 	<map:action-set name="mydb">
> 		<map:parameter .../>
> 	</map:action>
> 
> 	<map:generate .../>
> 	...
> 	...
> </map:match>
> 
> I do not want to have to different input sources dependent on whether 
> the action was successful. Actually, I just want the same form to be 
> reloaded and to display "record added" (or an error message on top 
> of the page).
> I see in the source that DatabaseUpdateAction sets a request 
> attribute "rows" to indicate how many rows where updated.
> Why does DatebaseAddAction not set something like two request 
> attributes "success" and "errorMessage"?

At least the one from the modular package does set the error message
as request attribute.

> Or is this not the cocoon way of doing it? How is this realised 
> without having to rely on xsp? (AFAIK, it is also possible to access 
> request attributes in xsl)

Like you say it is possible to access request attributes from
xslt. Thus you do not need XSP.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>