Naw, writing a transformer to detect something and throw an exception
so that you can use, e.g., the ExceptionGenerator is IMHO going about
it the wrong way. Andreas, why do you need the error code to be
"variable"? What error codes do you need to generate, and when?
—ml—
On Dec 13, 2006, at 2:33 AM, Jeroen Reijn wrote:
Hi Andreas,
I see your point now. Well as far as I know there is no existing way
in cocoon to throw the error based on a error coming back from the
SQLTransformer.
The only way I can think of right now, is creating your own
transformer that parses the SAX stream coming from the SQLTransformer.
If it finds the sql:error element it returns an error and you can
handle the exception in your sitemap.
Kind regards,
Jeroen Reijn
Andreas Busch wrote:
Hi Jeroen,
I have looked on errorhandling in sitemap , but my missing link is
how to raise an Exception in a XSLT transformer Here a sample sitemap
<map:match pattern="inbound_A_COND01">
<map:generate type="stream">
<map:parameter name="defaultContentType" value="text/xml"/>
</map:generate>
<map:transform type="xsltc" src="stylesheet/cond_a01.xsl"/>
<map:transform type="sql">
<map:parameter name="use-connection"
value="WAWI_INTERFACES" />
</map:transform>
________________ Here should be another transformer etc to read any
<sql:error> and if exists change the server Status
<map:serialize type="xml" />
</map:match> Thanks a lot Andreas Busch
ILOGICS GmbH ∙ Berduxstr. 22 ∙ D-81245 München
[EMAIL PROTECTED]
Tel: +49 89 896667-0
Fax: +49 89 896667-29
www.ilogics.de
-----Original Message-----
From: Jeroen Reijn [mailto:[EMAIL PROTECTED] Sent: Wednesday,
December 13, 2006 11:02 AM
To: users@cocoon.apache.org
Subject: Re: setting StatusCode
Hi Andreas,
you can do this with the help of some sitemap error handling.
You can do exactly that by catching your exception and then throw the
status code.
See http://cocoon.apache.org/2.1/userdocs/concepts/errorhandling.html
for more information.
Be sure to also check out the error handling core samples of the
Cocoon distribution.
Kind regards,
Jeroen Reijn
Andreas Busch wrote:
Hi ,
im thinking about the following requirements
I get a XML-Dokument postet in, transform it and use the SQL
Transformer.
If there will be anny error I have to return a Servercode like 404
or 304
I can set the servercode in the serializer, (<map:serialize
type="xml" status-code="304" />)
but how to make it variable ? can I evaluate th saxstream to set a
variable or are there a inputmodule
any hints are welcome
Thanks in advance !
*Andreas Busch*
ILOGICS GmbH · Berduxstr. 22 · D-81245 München
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Tel: +49 89 896667-0
Fax: +49 89 896667-29
www.ilogics.de <http://www.ilogics.de/>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]