forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gav...." <>
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.... []
> Sent: Friday, 22 September 2006 9:31 PM
> To:
> 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/
> 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.**.*">
        <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}" />

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" />

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}" />

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 test="{lm:project.images.{1}.svg}">
            <map:call resource="pipe-aggregate-svg2png-resource">
              <map:parameter name="path" value="{lm:project.images.{1}.svg}"
          <map:otherwise test="{lm:project.images.{1}.{2}}">
            <map:read src="{lm:project.images.{1}.{2}}"
mime-type="image/{2}" />

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 test="{lm:project.images.{2}.{3}}">
            <map:read src="{lm:project.images.{2}.{3}}"
mime-type="image/{3}" />

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: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 test="{lm:project.images.{1}.png}">
            <map:read src="{lm:project.images.{1}.png}"
mime-type="image/png" />

... 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

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"
      <xsl:variable name="filename-noext"
       <xsl:template match="/">
            <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.


View raw message