exception handling sitemap
Hi all, I was wondering if I can access the exception thrown in the exception handler... What I would like to do is generate a generic xml document containing info about the exception... If it is possible, how can I accomplish this? map:handle-errors map:select type=exception map:when test=sax !-- forward to generic xml exception page -- /map:when map:when test=fileNotFound !-- forward to generic xml exception page -- /map:when /map:select /map:handle-errors !-- jx template -- Exception Class${exception.class.name}/Class Message${exception.message}/Message/ Cause${exception.cause}/Cause /Exception Kind regards, Robby
RE: exception handling sitemap
Hi, Here is an extract of what we do in 2.1.11 (but we are not using the exception handler): map:handle-errors map:generate type=notifying / map:transform src=presource:stylesheet/error2xml.xsl / map:serialize type=html status-code=500 / /map:handle-errors With notifying generator being !-- The notifying generator can only be used in a handle-errors section : it produces an XML representation of the exception that caused the error handler to be executed -- map:generator name=notifying src=org.apache.cocoon.sitemap.NotifyingGenerator / And use xmlns:error=http://apache.org/cocoon/error/2.1; in error2xml.xsl to see get what is coming out of the notifier... Cheers, Laurent -Original Message- From: Robby Pelssers [mailto:robby.pelss...@ciber.com] Sent: jeudi, 15. avril 2010 10:32 To: users@cocoon.apache.org Subject: exception handling sitemap Hi all, I was wondering if I can access the exception thrown in the exception handler... What I would like to do is generate a generic xml document containing info about the exception... If it is possible, how can I accomplish this? map:handle-errors map:select type=exception map:when test=sax !-- forward to generic xml exception page -- /map:when map:when test=fileNotFound !-- forward to generic xml exception page -- /map:when /map:select /map:handle-errors !-- jx template -- Exception Class${exception.class.name}/Class Message${exception.message}/Message/ Cause${exception.cause}/Cause /Exception Kind regards, Robby • This email and any files transmitted with it are CONFIDENTIAL and intended solely for the use of the individual or entity to which they are addressed. • Any unauthorized copying, disclosure, or distribution of the material within this email is strictly forbidden. • Any views or opinions presented within this e-mail are solely those of the author and do not necessarily represent those of Odyssey Financial Technologies SA unless otherwise specifically stated. • An electronic message is not binding on its sender. Any message referring to a binding engagement must be confirmed in writing and duly signed. • If you have received this email in error, please notify the sender immediately and delete the original.
RE: exception handling sitemap
Mmm, You're right I actually did read about this generator a long time ago. I guess I'll do the same and transform it to the format I need. The reason why I need a generic solution is because I have following setup in 1 cocoon block: - Scheduled job (Quartz) which connects to a webservice and checks which items need to be transformed - the job invokes a cocoon pipeline based on the item name and get's back a ProcessingResult - this cocoon pipeline generates DITA topics and map and saves them including all referenced images to the filesystem as a side effect - this pipeline should result either in ProcessingResult ItemNameItem-XX/ItemName StatusSUCCESS/Status !-- or FAILURE -- !-- Optionally in case of STATUS FAILURE Exception Class${exception.class.name}/Class Message${exception.message}/Message/ Cause${exception.cause}/Cause /Exception -- /ProcessingResult - The job unmarshalls the ProcessingResult and updates the webservice with the correct status. Thx for the quick answer. Kind regards, Robby Pelssers -Original Message- From: Laurent Medioni [mailto:lmedi...@odyssey-group.com] Sent: Thursday, April 15, 2010 10:44 AM To: users@cocoon.apache.org Subject: RE: exception handling sitemap Hi, Here is an extract of what we do in 2.1.11 (but we are not using the exception handler): map:handle-errors map:generate type=notifying / map:transform src=presource:stylesheet/error2xml.xsl / map:serialize type=html status-code=500 / /map:handle-errors With notifying generator being !-- The notifying generator can only be used in a handle-errors section : it produces an XML representation of the exception that caused the error handler to be executed -- map:generator name=notifying src=org.apache.cocoon.sitemap.NotifyingGenerator / And use xmlns:error=http://apache.org/cocoon/error/2.1; in error2xml.xsl to see get what is coming out of the notifier... Cheers, Laurent -Original Message- From: Robby Pelssers [mailto:robby.pelss...@ciber.com] Sent: jeudi, 15. avril 2010 10:32 To: users@cocoon.apache.org Subject: exception handling sitemap Hi all, I was wondering if I can access the exception thrown in the exception handler... What I would like to do is generate a generic xml document containing info about the exception... If it is possible, how can I accomplish this? map:handle-errors map:select type=exception map:when test=sax !-- forward to generic xml exception page -- /map:when map:when test=fileNotFound !-- forward to generic xml exception page -- /map:when /map:select /map:handle-errors !-- jx template -- Exception Class${exception.class.name}/Class Message${exception.message}/Message/ Cause${exception.cause}/Cause /Exception Kind regards, Robby • This email and any files transmitted with it are CONFIDENTIAL and intended solely for the use of the individual or entity to which they are addressed. • Any unauthorized copying, disclosure, or distribution of the material within this email is strictly forbidden. • Any views or opinions presented within this e-mail are solely those of the author and do not necessarily represent those of Odyssey Financial Technologies SA unless otherwise specifically stated. • An electronic message is not binding on its sender. Any message referring to a binding engagement must be confirmed in writing and duly signed. • If you have received this email in error, please notify the sender immediately and delete the original.
RE: exception handling sitemap
I just checked the cocoon docs and it seems the notifying generator is deprecated... There is an ExceptionGenerator which basically delivers the same functionality. http://cocoon.apache.org/2.2/core-modules/core/2.2/937_1_1.html Cheers, Robby -Original Message- From: Robby Pelssers [mailto:robby.pelss...@ciber.com] Sent: Thursday, April 15, 2010 11:05 AM To: users@cocoon.apache.org Subject: RE: exception handling sitemap Mmm, You're right I actually did read about this generator a long time ago. I guess I'll do the same and transform it to the format I need. The reason why I need a generic solution is because I have following setup in 1 cocoon block: - Scheduled job (Quartz) which connects to a webservice and checks which items need to be transformed - the job invokes a cocoon pipeline based on the item name and get's back a ProcessingResult - this cocoon pipeline generates DITA topics and map and saves them including all referenced images to the filesystem as a side effect - this pipeline should result either in ProcessingResult ItemNameItem-XX/ItemName StatusSUCCESS/Status !-- or FAILURE -- !-- Optionally in case of STATUS FAILURE Exception Class${exception.class.name}/Class Message${exception.message}/Message/ Cause${exception.cause}/Cause /Exception -- /ProcessingResult - The job unmarshalls the ProcessingResult and updates the webservice with the correct status. Thx for the quick answer. Kind regards, Robby Pelssers -Original Message- From: Laurent Medioni [mailto:lmedi...@odyssey-group.com] Sent: Thursday, April 15, 2010 10:44 AM To: users@cocoon.apache.org Subject: RE: exception handling sitemap Hi, Here is an extract of what we do in 2.1.11 (but we are not using the exception handler): map:handle-errors map:generate type=notifying / map:transform src=presource:stylesheet/error2xml.xsl / map:serialize type=html status-code=500 / /map:handle-errors With notifying generator being !-- The notifying generator can only be used in a handle-errors section : it produces an XML representation of the exception that caused the error handler to be executed -- map:generator name=notifying src=org.apache.cocoon.sitemap.NotifyingGenerator / And use xmlns:error=http://apache.org/cocoon/error/2.1; in error2xml.xsl to see get what is coming out of the notifier... Cheers, Laurent -Original Message- From: Robby Pelssers [mailto:robby.pelss...@ciber.com] Sent: jeudi, 15. avril 2010 10:32 To: users@cocoon.apache.org Subject: exception handling sitemap Hi all, I was wondering if I can access the exception thrown in the exception handler... What I would like to do is generate a generic xml document containing info about the exception... If it is possible, how can I accomplish this? map:handle-errors map:select type=exception map:when test=sax !-- forward to generic xml exception page -- /map:when map:when test=fileNotFound !-- forward to generic xml exception page -- /map:when /map:select /map:handle-errors !-- jx template -- Exception Class${exception.class.name}/Class Message${exception.message}/Message/ Cause${exception.cause}/Cause /Exception Kind regards, Robby • This email and any files transmitted with it are CONFIDENTIAL and intended solely for the use of the individual or entity to which they are addressed. • Any unauthorized copying, disclosure, or distribution of the material within this email is strictly forbidden. • Any views or opinions presented within this e-mail are solely those of the author and do not necessarily represent those of Odyssey Financial Technologies SA unless otherwise specifically stated. • An electronic message is not binding on its sender. Any message referring to a binding engagement must be confirmed in writing and duly signed. • If you have received this email in error, please notify the sender immediately and delete the original.