forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gav...." <brightoncomput...@brightontown.com.au>
Subject RE: FOR-635 Revisted
Date Sat, 23 Sep 2006 01:24:21 GMT
Ok, So I'm just thinking out loud here so if anyone can jump in and
Fill out any missing steps :)


> -----Original Message-----
> From: Gav.... [mailto:brightoncomputers@brightontown.com.au]
> Sent: Friday, 22 September 2006 9:31 PM
> To: dev@forrest.apache.org
> Subject: FOR-635 Revisted
> 
> Hi All,
> 
> Taking yet another look at FOR-635, lets see if we can get this thing
> licked.!
> 
> Some observations from a 'forrest run' - ( I could have sworn more images
> than just one in linking.pdf last time we looked at this, but anyway)
> 
> Forrest Run
> 
> 
> 
> 1. Actual Location is : src/documentation/resources/images/
>    linking.fo says    : <fo:external-graphic src="/images/icon-a.png"/>
>    linking.html says  : <img alt="Icon" src="/images/icon-a.png">
> 
>    http://localhost:8888/images/icon-a.png - Image appears fine.
> 
>    Image does NOT appear in linking.pdf
> 

Ignoring the rest and just looking at this one.

We have in 'locationmap.xmap'

    <match pattern="project.images.**.*">
      <select>
        <location src="{properties:resources.images}{1}.{2}" />
        <location src="{properties:content}../resources/images/{1}.{2}" />
        <location src="{properties:content.xdocs}images/{1}.{2}" />
        <location src="{properties:content.xdocs}{1}.{2}" />
      </select>
    </match>

In this case we hit the first match and the second match don't we ?

We have in 'sitemap.xmap'

      <map:match pattern="**images**">
        <map:mount uri-prefix="" src="resources.xmap" check-reload="yes" />
      </map:match>

I would say we have a match here so now go to 'resources.xmap'

      <!-- handles images local to a contributor directory -->
      <map:match pattern="**my-images/**.*">
        <map:read src="{lm:project.images.{1}my-images/{2}.{3}}"
mime-type="image/{3}" />
      </map:match>

I'm guessing the above is redundant/legacy, do we need it any more ?

We also have :-

<map:match pattern="images/**.*">
        <map:select type="exists">
          <map:when test="{lm:skin.images.{1}.{2}}">
            <map:read src="{lm:skin.images.{1}.{2}}" mime-type="image/{2}"
/>
          </map:when>
          <map:when test="{lm:project.images.{1}.svg}">
            <map:call resource="pipe-aggregate-svg2png-resource">
              <map:parameter name="path" value="{lm:project.images.{1}.svg}"
/>
            </map:call>
          </map:when>
          <map:otherwise test="{lm:project.images.{1}.{2}}">
            <map:read src="{lm:project.images.{1}.{2}}"
mime-type="image/{2}" />
          </map:otherwise>
        </map:select>
      </map:match>

As there is no '/' in the match pattern and our xml uses one (<img
src="/images/icon-a.png" alt="Icon" /> ) then this is not a match
And we move on to the next...

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

So I guess we have a match here. {1} however would be null so we fall
Into the second when test and end up with 

lm:project.images.icon-a.png mime type="image/png"

Are we done here or do we now go on to process ...
      
      <map:match pattern="**.png">
        <map:select type="exists">
          <map:when test="{lm:project.images.{1}.svg}">
            <map:call resource="pipe-aggregate-svg2png-resource">
              <map:parameter name="path" value="{lm:project.images.{1}.svg}"
/>
            </map:call>
          </map:when>
          <map:when test="{lm:project.images.{1}.aart}">
            <map:generate type="asciiart-svg"
src="{lm:project.images.{1}.aart}" />
            <map:call resource="transform-project2text"/>
            <map:serialize type="svg2png" />
          </map:when>
          <map:when test="{lm:project.images.{1}.png}">
            <map:read src="{lm:project.images.{1}.png}"
mime-type="image/png" />
          </map:when>
        </map:select>
      </map:match>


... we match the last when test and again end up with

lm:project.images.icon-a.png mime-type="image/png"


There are a few things I am unsure of.

1. Does sitemap.xmap and locationmap.xmap both get processed or just one of
them?

2. If answer is locationmap.xmap how do we then get to resources.xmap?

3. For skins, document-to-fo.xsl is in use, what gets used for
dispatcher/themes. ?

Content-pdf-link.ft in themes/common says :-

     <xsl:param name="defaultVariables" select="'test.html'"/>
      <xsl:variable name="skin-img-dir"
select="$defaultVariables/*/*[@name='skin-img-dir']/@value"/>
      <xsl:variable name="filename-noext"
select="$defaultVariables/*/*[@name='filename-noext']/@value"/>
       <xsl:template match="/">
        <forrest:content>
          <forrest:part>
            <a href="{$filename-noext}.pdf" class="format">
              <img class="skin" src="{$skin-img-dir}/pdfdoc.gif" 
                alt="PDF - icon"/>
              <span class="caption">PDF</span>

So what is dispatcher doing looking for skin-img-dir ?

Regardless, as David points out, this is not skin specific because we get
the same results for dispatcher - unless ultimately dispatcher also
Uses document-to-fo.xsl.

Gav...



Mime
View raw message