forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Problems with unified source directory
Date Fri, 15 Nov 2002 08:12:13 GMT
I've converted the Avalon Phoenix site to Forrest, and I'm trying a 
unified dir structure, with all xdocs in src/documentation/content and 
images in src/documentation/content/images.

I changed the two properties accordingly, and while the xdocs render 
fine in both CLI and, the images are crawled by the CLI as html files 
(header.gif.html) and not rendered.

This is because of this rule I'd committed to allow Forrest to display 
any content if present as-is.

    <map:match pattern="**">

     <!-- if the file is present verbatim as content,
          give that to the user... -->
     <map:act type="resource-exists">
      <map:parameter name="url" value="content/{1}"/>
      <map:read src="content/{../1}"/>
     </map:act>


IIUC the problem comes with the mime/type not being specified, and 
Cocoon doesn't seem to default to the right one.

What should we do, add rules to this containing mimetypes for common 
formats?

Example:

    <map:match pattern="**">

     <map:match pattern="**.gif">
       <map:act type="resource-exists">
        <map:parameter name="url" value="content/{1}.gif" />
        <map:read src="content/{../1}.gif" mime-type="image/gif"/>
       </map:act>
     </map:match>

     <map:match pattern="**.jpg">
       <map:act type="resource-exists">
        <map:parameter name="url" value="content/{1}.jpg"/>
        <map:read src="content/{../1}.jpg" mime-type="image/jpg"/>
       </map:act>
     </map:match>

     ...

     <!-- if the file is present verbatim as content,
          give that to the user... -->
     <map:act type="resource-exists">
      <map:parameter name="url" value="content/{1}"/>
      <map:read src="content/{../1}"/>
     </map:act>

    ...

Separating directories does help on this, but I don't want technical 
difficulties that can be overcome steer design decisions.

Thoughts?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Mime
View raw message