cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: [PROPOSAL] Extending Sitemap Error Handling
Date Wed, 10 Jul 2002 15:53:24 GMT
Nicola Ken Barozzi wrote:

>
> Sylvain Wallez wrote:
>

>>> Other thoughts?
>>
>>
>> Errmm... I still don't like the implicit generator in <handle-errors>...
>
>
> I really don't know what is best here, but I have a proposal that 
> comes to me now...
>
> The NotifyingBuilder is something that converts Exceptions and 
> Notifyings in xml... basically a Generator!
> But with the difference that it imposes you a fixed dtd, and can be 
> used also with non-sax sources.
>
> So, what about adding a NotifyingBuilder as a Sitemap Component?
>
> <components>
>  ...
>  <notifying-builders>
>   <notifying-builder name="default"
>                      classname="org.apache.xxx.NotifyingBuilder">
>    <type name="404" src="org.apache.cocoon.ResourceNotFoundException"/>
>    <type name="500" src="org.apache.cocoon.ProcessingException"/>
>    <type name="access-denied" src="java.lang.SecurityException"/>
>    <type name="my-error-case" src="my.app.someSpecificException"/>
>   </notifying-builder>
>  </notifying-builders>
> </components>
>
> ...
>
>   <map:handle-errors>
>    <map:match type="error" pattern="access-denied">
>      <map:notifying-builder/>
>      <map:transform src="accessDenied.xsl"/>
>      <map:serialize/>
>    </map:match>
>   </map:handle-errors>
>
> Just a RT...


... that I don't like much : you're proposing a new type of sitemap 
component, when we already have the NotifyingGenerator, which basically 
wraps Notifier (this one is producing the XML using static methods, and 
not NotifyingBuilder).

Currently, an implicit <map:generate type="!notifying-generator!"/> is 
added as the first statement of <handle-errors> (see 
HandleErrorsNode.invoke() in treeprocessor).

What about making this explicit so we can choose other generators as 
well, such as a standard file generator to display for example a nice 
"page not found" page using some site-wide stylesheets ?

<handle-errors>
  <match type="error" pattern="not-found">
    <generate type="file" src="notfound.xml"/>
    <transform src="skin/doc2html.xsl"/>
    <serialize/>
  </match>
  <!-- fallback -->
  <generate type="notifying"/>
  <transform src="system/error2html.xsl"/>
  <serialize/>
</handle-errors>

>>> Keep calm Stefano, I know you get nervous when Sylvain and I discuss 
>>> at this speed, but believe me, we are communicating, it's not noise ;-P 
>>
>>
>> Sure we're communicating ! Why does Stefano get nervous ? Because we 
>> sometimes communicate loudly ?
>
>
> Guess so, and because we are sooooo much verbooose and fast ;-)
>

Yes, and I'm sooooo late on my urgent paid-work because of this ;-)

Sylvain

-- 
Sylvain Wallez
  Anyware Technologies                  Apache Cocoon
  http://www.anyware-tech.com           mailto:sylvain@apache.org




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


Mime
View raw message