forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ferdinand Soethe <ferdin...@apache.org>
Subject Q: Images-Cascade in Resources.xmap (was Re: Forrest site generates content above build/site)
Date Thu, 20 Apr 2006 08:00:50 GMT

Looking at 0.7 resources.xmap I'm trying to understand the cascade:

            <map:match pattern="images/**.*">
            <map:select type="exists">
               <map:when test="{project:content.xdocs}/images/{1}.{2}">
                  <map:read src="{project:content.xdocs}/images/{1}.{2}" mime-type="image/{2}"
/>
               </map:when>
               <map:when test="resources/images/{1}.{2}">
                  <map:read src="resources/images/{1}.{2}" mime-type="image/{2}" />
               </map:when>
               <map:when test="{project:resources.images}/{1}.{2}">
                  <map:read src="{project:resources.images}/{1}.{2}" mime-type="image/{2}"
/>
               </map:when>

1 and 3 are clear. Check for image file in images subdir of xdocs and
the designated project:resources.images directory.

But what is <map:when test="resources/images/{1}.{2}"> trying to
accomplish? The way I read it it would look for the file in the
resources/images subdir of the directory of the referring file?

What is the purpose of this?


Trying to understand the next one:

        <map:match pattern="**/images/**.*">
            matching any  reference that has images in its path, no
            such as
                bla/blo/images/bli/file.jpg
                bla/blo/images/file.jpg
                
            <map:select type="exists">
               <map:when test="{project:content.xdocs}/{1}/images/{2}.{3}">

                  looking for
                        xdocs/bla/blo/images/bli/file.jpg
                        xdocs/bla/blo/images/file.jpg

                  What is this needed for?
                  Seems to contradict our standard way of storing all
                  images below a directory calles images.
                  
                  <map:read src="{project:content.xdocs}/{1}/images/{2}.{3}" mime-type="image/{3}"
/>
               </map:when>
               <map:when test="resources/images/{2}.{3}">
                  <map:read src="resources/images/{2}.{3}" mime-type="image/{3}" />

                  Looking for

                        resources/images/bli/file.jpg
                        resources/images/file.jpg
                  
                  Same here. Cutting out the path before 'images' (if
                  I understand that correctly) Forrest would seem to
                  behave highly unpredictable to the user. What for.

                  AND

                  Am I correct to assume that this would be the
                  pattern to match ..-references?

                  But if so, why does the file end up in the wrong
                  directory? Does the original reference determine the
                  final location of the file in site? And if so, where
                  does that happen?

                  
               </map:when>
               <map:otherwise>
                  <map:read src="{project:resources.images}/{2}.{3}" mime-type="image/{3}"
/>
               </map:otherwise>
            </map:select>
         </map:match>

Thanks for any help in understanding this.

--
Ferdinand Soethe


Mime
View raw message