forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gav...." <brightoncomput...@brightontown.com.au>
Subject RE: [jira] Commented: (FOR-635) images not reproduced in PDFs, if sources are in xdocs/images directory
Date Wed, 17 May 2006 12:48:26 GMT


> -----Original Message-----
> From: Ferdinand Soethe [mailto:ferdinand@apache.org]
> Sent: Wednesday, 17 May 2006 3:19 PM
> To: dev@forrest.apache.org
> Subject: Re: [jira] Commented: (FOR-635) images not reproduced in PDFs, if
> sources are in xdocs/images directory
> 
> 
> You might find some ideas or a solution in
> 
> main\webapp\skins\common\xslt\html\pathutils.xsl
> 
> > <!-- Normalizes a path, converting '/' to '\' and eliminating ..'s
> > <xsl:template name="normalize">

Doh! That is all that was needed to make it work, thanks.
I think my attempt was close, just missing the fact you have to
Remove the last directory before the ../ (important!)

Now, I think we need to clear up now what options we want and why.

Ross stated earlier :-

<quote>

The url "../images/icon.png" falls through to the "otherwise" option.

an url of "images/icon.png" would be matched by the first test, producing:

$imagesdir/icon.png

which resolves to:

{project:resources.images}/icon.png

So...

we have wo possible locations already (and there should be one).

Then we add the problem that the images need to be resolved from multiple
possible locations in the src tree (the original issue).

This is *really* messy...

</quote>

Recapping what happens now then :-

---------------------------------------------------------------------------

1. Usage: src="images/icon.png"

This uses the full system path to /resources/images/ directory from :-

<!-- resources image dir -->
        <xsl:when test="starts-with(string(@src),'images/')">
          <xsl:value-of
select="concat($imagesdir,substring-after(@src,'images'))"/>
        </xsl:when>

Example fo : <fo:external-graphic
src="D:\web\forrest_rc1/src/documentation/resources/images///group-logo.gif"
/>

Although there is no dotdots here, we can maybe run this through the 
Normalize template to correct slash direction maybe.

---------------------------------------------------------------------------

2. Usage : src="/images/icon.png"
   Usage : src="/ANOtherDirectory/icon.png"

This will use any specified directory taking 'xdocs' to be root. From :-

<!-- already absolute -->
        <xsl:when test="contains(string(@src),':') or
starts-with(string(@src),'/')">
          <xsl:value-of select="@src"/>
        </xsl:when>

Example fo : <fo:external-graphic src="/images/icon.png"/>

---------------------------------------------------------------------------

3. Usage: src="../images/icon.png"
   Usage: src="../../ANOtherDirectory/icon.png"
   Usage: src="icon.png"

This will use any specified directory taking the drive root and so uses the
Full system path to the image. I suppose then in this case the images can
Be stored anywhere even below the site root. Specifying '../images/icon.png'
from an /xdocs/index.xml file will not find either of the current images
Directories though so this needs to be documented. Specifying just an image
Name without any path will find the image if it is in the same directory as
the calling file. From :-

<!-- relative to document -->
	<xsl:otherwise>
		<xsl:variable name="path"
select="concat($xmlbasedir,@src)"/>
		<xsl:call-template name="normalize">
			<xsl:with-param name="path" select="$path"/>
		</xsl:call-template>
	</xsl:otherwise>

Example fo : <fo:external-graphic
src="D:/web/forrest_rc1/src/documentation/content/images/group-logo.gif"/>

Notice is this fo example we are one level below xdocs.

---------------------------------------------------------------------------


So then people, suggestions on what to keep, what to throw away, or leave
as-is fixed above to please everyone and comment docs accordingly. Bearing
In mind comments that this current over-choice for the user is messy.

Gav...

> 
> --
> Ferdinand Soethe
> 
> 
> 
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.392 / Virus Database: 268.6.0/341 - Release Date: 16/05/2006




Mime
View raw message