cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Billard <obill...@rennes.jouve.fr>
Subject Re: [Portal] Why don't cocoon errors appear in a coplet ?
Date Wed, 03 Mar 2004 09:56:10 GMT
Hi Carsten,

Thanks for your answer.
For some of our pipelines, we don't use the cocoon protocol, but just a serverpages 
generator. Renaming a variable in the XSP to cause a "Language Exception" page, I still 
have the content of the coplet empty (but as before the decoration remains : <title>My

title</title>). And I still have the "correct" error display when calling directly the

coplet pipeline.

I added
   <attribute>
     <name>error-uri</name>
     <value
       xsi:type="java:java.lang.String"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">cocoon:/erreur-coplet</value>
   </attribute>

in the profiles/copletdata/portal.xml in my coplet and added
a match in the sitemap, in the very beginning to avoid */**-like matchings :

   <map:match pattern="erreur-coplet">
     <map:generate type="notifying"/>
     <map:transform src="stylesheets/system/error2html.xslt">
       <map:parameter name="contextPath" value="{request:contextPath}"/>
       <map:parameter name="pageTitle" value="Resource not found"/>
     </map:transform>
   </map:match>

but I have the same result : the content of the coplet is void, and it seems that this 
pipeline is never called.

But it's right that the portal uses the cocoon protocol to aggregate the various coplet 
contents. But why doesn't it detect map:handle-errors branchings ?

On 03/03/2004 09:44, Carsten Ziegeler wrote:
> Hi,
> 
> the answer isn't related to the portal but to the Cocoon sitemap
> engine: The portal uses internal pipeline calls (cocoon: protocol).
> Whenever Cocoon uses an internal pipeline call, the error handler
> of that pipeline is never invoked, so if you do a
> 
> <map:generate src="cocoon:/my-pipeline"/>
> 
> and there is an error in your "my-pipeline", the error handler
> of "my-pipeline" is never invoked. In the case above the 
> error handler of the pipeline containing the map:generate is
> invoked.
> 
> In the case of the portal, the error is "ignored". You can specify
> for each coplet an alternative pipeline that is invoked if the 
> real content pipeline throws an error. Have a look at the
> configuration of the coplet showing my weblog. That coplet shows
> the "real" content from the net if you have a network connection,
> if not a static (old) xml file is read.
> 
> HTH
> Carsten
> 
> 
>>-----Original Message-----
>>From: news [mailto:news@sea.gmane.org] On Behalf Of Olivier Billard
>>Sent: Tuesday, March 02, 2004 6:25 PM
>>To: dev@cocoon.apache.org
>>Subject: [Portal] Why don't cocoon errors appear in a coplet ?
>>
>>Hi cocooners !
>>
>>I posted in the users' but maybe some sitemap gurus can show 
>>me the light ;).
>>
>>I use the portal for a project and i'm not able to display 
>>errors in a (main) coplet.
>>I always have a blank content, as if when rendering the 
>>content of the coplet, the error content is not put in the 
>>whole portal page.
>>
>>I tried xml-serializing, html-serializing errors :
>>
>>     <map:handle-errors>
>>       <map:select type="exception">
>>
>>         <map:when test="not-found">
>>           <map:generate type="notifying"/>
>>           <map:transform src="stylesheets/system/error2html.xslt">
>>             <map:parameter name="contextPath" 
>>value="{request:contextPath}"/>
>>             <map:parameter name="pageTitle" value="Resource 
>>not found"/>
>>           </map:transform>
>>           <map:serialize status-code="404"/>
>>         </map:when>
>>
>>         <map:when test="invalid-continuation">
>>           <map:generate src="not-found.xml"/>
>>           <map:transform src="welcome.xslt">
>>             <map:parameter name="contextPath" 
>>value="{request:contextPath}"/>
>>           </map:transform>
>>           <map:serialize status-code="404"/>
>>         </map:when>
>>
>>         <map:otherwise>
>>           <map:generate type="notifying"/>
>>           <map:transform src="stylesheets/system/error2html.xslt">
>>             <map:parameter name="contextPath" 
>>value="{request:contextPath}"/>
>>           </map:transform>
>>           <!--map:serialize status-code="500"/-->
>>--->      <map:serialize type="html"/>
>>         </map:otherwise>
>>       </map:select>
>>
>>     </map:handle-errors>
>>
>>(map:otherwise is choosen, i tried renaming the transformer 
>>src attribute)
>>
>>But no way : I have no content in the coplet...
>>I can right display the error when calling the coplet pipe, 
>>but it' empty in the portal page...
>>
>>It seems to work like standard/error output : when an error 
>>occurs, the standard sitemap output is empty, and the sitemap 
>>error output contains the error catched in the map:handle-errors.
>>
>>Thanks in advance for your answers !
>>
>>--
>>Olivier BILLARD


Mime
View raw message