Hi,
----- Original Message -----
From: "Stefano Mazzocchi" <[EMAIL PROTECTED]>

> Daniel Fagerstrom wrote:
>
<snip/>
> >
> > To conclude: I belive that a request URI based AC system have clear
> > advantages compared to pipeline based AC, and that it could be added
> > to Cocoon without effecting the contracts at all. I also think that
> > the "correct" way of handling security is a resource based system, and
> > that a such would need to affect the inner workings of Cocoon.
>
> Hmmm, interesting vision.
>
> Just one question: what about errors? how do you handle them? how about
> aggregation? how about selectors?
>

This stuff mostly brushes my hair as it goes by, but what about moving these
problems to the XSLT? I deal mainly with sites that get pregenerated before
going live - so be gentle :) ? Here goes...

First, I think development cocoon and deployment cocoon should be two
different things. They have totally different needs. What I describe below
would be for the development cocoon which could be exported to the
deployment cocoon. In addition, I would like to see these things be file
based (...ducking...) - so GUIs can be easily created - so administration
can be moved to administrators.

Content aggregation can be handled by the xsl document function. These
things can be keyed and cached for excellent performance. You keep all your
XML content/configs and XSLTs behind WEB-INF so they are secure. Here is a
simple example (not keyed):

[[ a transformation is performed against something like:
<page xsl_fileref="body2col.xsl" id="p0000000001" is_index="true"
display_label_link="true" label="Page 1" title="Page One">
   <content>
    <xml id="index_en.xml" position="center_panel"/>
    <xml id="blurb.xml" position="right_panel"/>
   </content>
</page>
]]

[[ this part of the transformation finds content and starts the
transformation on each content piece:
<xsl:template match="content">
    <xsl:apply-templates/>
</xsl:template>

<xsl:template match="xml">

    <xsl:variable
       name="content_config"
       select="document(concat($context,
'/WEB-INF/styling/content.xml'))/config/content"/>

   <xsl:variable
      name="xml_id"
      select="@id"/>

    <xsl:variable
       name="content_xml"
       select="$content_config/content-xml[@id=$xml_id]"/>
    <xsl:variable
        name="content_folder"
        select="$content_xml/@folder"/>

    <xsl:apply-templates
        select="document(concat($context,
'/WEB-INF/_sitexml',$content_folder, $xml_id))/*">
        <xsl:with-param name="xml_id" select="$xml_id"/>
    </xsl:apply-templates>

</xsl:template>
]]

best,
-Rob


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to