forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pablo Barrera <>
Subject Re: Using locationmap in sitemap.xmap
Date Wed, 24 Sep 2008 13:50:00 GMT

On 23/09/2008, at 23:34:51, Ross Gardler wrote:

> Pablo Barrera wrote:
>> Hello
>> I am trying to read several files from a directory to extract some  
>> information from each one and create a resume. I am being looking  
>> at org.apache.forrest.plugin.input.Resume. I have my sitemap  
>> working but I use this line (a copy from a similar line in the  
>> plugin code):
>> <map:transform src="{properties:resources}/stylesheets/alldocs-to- 
>> revisions.xsl" />
>> I tried to use locationmap to look for the xsl code, so I changed  
>> the line to
>> <map:transform src="{lm:transformation.alldocs.revisions}" />
>> and then to
>> <map:transform src="{lm:alldocs-to-revisions.xsl}" />
>> as commented in [1], but it's not working. My locationmap looks at / 
>> PATH-TO-MY-SITE/src/documentation/skins/pelt/xslt/html/alldocs-to- 
>> revisions.xsl Why is it looking to pelt/xslt/html? Any idea?
> The locationmap looks in a number of places for your required file,  
> if it doesn't find it in the first location it falls back to the  
> next possible location. I'm pretty sure the above location is only  
> *one* location that the system is looking since it comes from the  
> first location in the following match from the locationmap- 
> transform.xml file [2]:
> <!-- All core other transforms -->
>    <match pattern="transform.*.*">
>      <select>
>        <location src="{properties:skins-dir}{}/ 
> xslt/html/{1}-to-{2}.xsl" />
>        <location
> src="{forrest:forrest.context}/skins/{}/xslt/ 
> html/{1}-to-{2}.xsl"/>
>        <location src="{forrest:forrest.context}/skins/common/xslt/ 
> html/{1}-to-{2}.xsl"/>
>        <location src="{forrest:forrest.stylesheets}/{1}-to-{2}.xsl"/>
>      </select>
>    </match>
> Since you say that it was working with
> <map:transform
> src="{properties:resources}/stylesheets/alldocs-to-revisions.xsl" />
> That tells me that your stylesheet is in
> ${project.content-dir}/resources/stylesheets/alldocs-to-revisions.xsl
> There are two solutions to this. The first is to copy the above  
> match to your project locationmap and add (as the first location):
> <location          src="{properties:resources}/stylesheets/{1}-to- 
> {2}.xsl/>
> This will work for all stylesheets located in your project directory.
> The second solution seems more appropriate to me. It is likely that  
> content objects will provide their own stylesheets on occasion (as  
> you are doing) and therefore this match should be added to the  
> default locationmap [1]. Please try this latter solution and, if it  
> works, send us a patch.

The former solution is not working for me. I don't know way. So I will  
go for the second one.

> However....
> Since I know what you are doing here (remember folks, Pablo is  
> currently working in my team) let me go a step further...
> Pablo is aggregating the content of a directory with TEI documents  
> in order to create sorted lists of documents based on their revision  
> headers.
> I'd suggest that this functionality actually belongs in the TEI  
> plugin not in the content object. That way it can be reused by other  
> folk working with TEI in this way.

Do you think so? Maybe it could be part of the tei input plugin, but I  
am not sure.

My idea (but I am still missing some things in forrest) is that tei  
input plugin should read the change record and include this  
information into the metadata of the internal document. Other part  
should read the content of a directory with different formats but  
providing a change record. So I don't know if right location is the  
plugin directory or a new plugin.

Anyone, the first step is to have this thing working. :-)

> To do this you need a plugin specific location, as an example see  
> [3] where you will find:
>    <match pattern="pdf.transform.*.*">
>      <select>
>        <location src="resources/stylesheets/{1}-to-{2}.xsl"/>
>        <location
> src="{forrest:forrest.plugins}/org.apache.forrest.plugin.output.pdf/ 
> resources/stylesheets/{1}-to-{2}.xsl"/>
>      </select>
>    </match>
> coupled with xmap [4] such as of:
> <map:transform src="{}">

Where is [4]?

> Ross
>> [1]
> [2]
> [3]

Pablo Barrera

View raw message