forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: Using locationmap in sitemap.xmap
Date Wed, 24 Sep 2008 21:27:58 GMT
Pablo Barrera wrote:
> 
> 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}{forrest:forrest.skin}/xslt/html/{1}-to-{2}.xsl" 
>> />
>>        <location
>> src="{forrest:forrest.context}/skins/{forrest:forrest.skin}/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.

The implication there is the second, more general solution is working - 
is that correct?

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

I'm sorry, I was second guesing what you are doing. I thought you were 
working on the TEI output plugin. You are correct, this should not be 
part of the TEI input plugin.

>> 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="{lm:pdf.transform.document.fo}">
>>
> 
> Where is [4]?

Not sure it is relevant now as I was getting my inputs and outputs mixed 
up. But for completeness [4] is the output.xmap in the PDF plugin - the 
clue is in the locationmap naming convention of PLUGIN.***

Ross

>>> [1] http://forrest.apache.org/docs_0_80/locationmap.html
>> [2] 
>> http://svn.apache.org/repos/asf/forrest/trunk/main/webapp/locationmap-transforms.xml

>>
>> [3] 
>> http://svn.apache.org/repos/asf/forrest/trunk/plugins/org.apache.forrest.plugin.output.pdf/locationmap.xml

>>
> 
> -- 
> Pablo Barrera
> http://gsyc.es/~barrera/
> 


Mime
View raw message