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 Thu, 25 Sep 2008 12:14:44 GMT

On 25/09/2008, at 6:12:36, Gavin wrote:

>> -----Original Message-----
>> From: Pablo Barrera []
>> Sent: Wednesday, 24 September 2008 11:42 PM
>> To:
>> Subject: Re: Using locationmap in sitemap.xmap
>> On 24/09/2008, at 7:30:48, Sjur Moshagen wrote:
>>> Den 23. sep. 2008 kl. 20.58 skrev Pablo Barrera:
>>>> 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}" />
>>> To me, this looks like a typo. It should be 'transform.X.Y', not
>>> 'transformation.X.y'.
>>> Try that, and report back:)
>> Is not working with this change either.
> Ok, I'll give it one go assuming you haven't solved it already.
> Are you talking about in the input.xmap (or output.xmap) of the  
> plugin.

Is still broken for me. I will try to explain a little bit more what I  
am trying to do. I have a lot of TEI documents in one directory. Each  
document includes a section with a change record. I want to show a  
page with links to each document and the information for each revision  
(stored in the change record).

For doing so I looked into the Resume plugin just to get ideas. I am  
working in my local site instead of changing any plugin. I though it  
should be easier :-)

The changes are in src/documentation/sitemap.xmap b/wiki2tei/src/ 
documentation/sitemap.xmap and they look like this:

<map:sitemap xmlns:map="">
       <map:generator name="directory"       
       <map:transformer name="cinclude"  
       <map:action logger="sitemap.action.sourcetype"  
name="sourcetype" src="org.apache.forrest.sourcetype.SourceTypeAction">
         <sourcetype name="hello-v1.0">
           <document-declaration public-id="-//Acme//DTD Hello  
Document V1.0//EN" />
     <map:selectors default="parameter">
       <map:selector logger="sitemap.selector.parameter"  
name="parameter" src="org.apache.cocoon.selection.ParameterSelector" />
     <map:resource name="source-file-resolver">
       <map:select type="exists">
         <map:when test="{uri}.xml">
           <map:generate src="{properties:content.xdocs}{uri}.xml"/>
           <map:transform type="xinclude"/>
           <map:serialize type="xml"/>
         <map:when test="{properties:content.xdocs}{uri}.xml">
           <map:generate src="{properties:content.xdocs}{uri}.xml"/>
           <map:transform type="xinclude"/>
           <map:serialize type="xml"/>
     <map:resource name="transform-to-document">
       <map:act type="sourcetype" src="{src}">
         <map:select type="parameter">
           <map:parameter name="parameter-selector-test"  
value="{sourcetype}" />
           <map:when test="hello-v1.0">
             <map:generate src="{properties:content.xdocs}{../../ 
1}.xml" />
             <map:transform src="{properties:resources.stylesheets}/ 
hello2document.xsl" />
             <map:serialize type="xml-document"/>
       <map:match pattern="old_site/*.html">
         <map:select type="exists">
           <map:when test="{properties:content}{1}.html">
             <map:read src="{properties:content}{1}.html" mime- 
           Use this instead if you want JTidy to clean up your HTML
           <map:generate type="html" src="{properties:content}/{0}" />
           <map:serialize type="html"/>

       <map:match pattern="wiki/**.xml">
             <map:generate src="{{1}.xml}" />
src="{lm:simplifiedDocbook.transform.sdocbook.document}" />
             <map:serialize type="xml-document"/>

       <map:match pattern="**.xml">
         <map:call resource="transform-to-document">
           <map:parameter name="src" value="{properties:content.xdocs} 
{1}.xml" />

       <map:match pattern="resources/resume.source.xml">
         <map:generate src="cocoon:/resources/all.source.xml"/>
         <map:transform src="{lm:transform.alldocs.revisions}">
           <map:parameter name="candidateSkill" value="{1}"/>
         <map:serialize type="xml"/>

       <map:match pattern="resources/all.source.xml">
         <map:generate type="directory"  
           <map:parameter name="include" value=".*\.xml$"/>
         <map:transform src="{}"/>
         <map:transform type="cinclude"/>
         <map:serialize type="xml"/>


The stylesheets use cinclude to put all the content of files together  
and the filter it to show just the change record. If I use the path I  
mentioned before the system is working correctly.

Further work:
My idea is to change a little bit the TEI input module to read the  
change record and put it as metadata in the internal representation  
and use this information instead of the original TEI documents.

> In the case of the tei input plugin ,currently the locationmap.xml has
> a match pattern entry of :-
> match pattern="tei.transform.*.*"
> so the corresponding entry in input.xmap should look something like
> <map:transform src="{lm:tei.transform.alldocs.revisions}" />
> Not sure if that helps.

My stylesheets are at MYSITE/src/documentation/resources/stylesheets  
so I can't use the locationmap for the plugin.



Pablo Barrera

View raw message