forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Crossley <cross...@apache.org>
Subject Re: Glossary Plugin FOR-755 - was RE: [jira] Updated: (FOR-639) define terminology for the various aspects of Dispatcher
Date Mon, 03 Apr 2006 08:23:19 GMT
Gav.... wrote:
> 
> Ok, I was just posting what I thought to be relevant parts of input.xmap,
> heres the whole caboodle :-
> 
> ------
> <?xml version="1.0"?>
> 
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>   <map:components>
>     <map:generators default="file"/>
>     <map:serializers default="html"/>
>     <map:transformers default="xslt"/>
>     <map:readers default="resource"/>
>     <map:matchers default="wildcard"/>

Those defaults can be removed.

>     <map:actions>
> 	<map:action logger="sitemap.action.sourcetype" name="sourcetype"
> src="org.apache.forrest.sourcetype.SourceTypeAction">
> 	<sourcetype name="glossary-v10">
> 	<document-declaration public-id="-//Apache Forrest//DTD Glossary
> V1.0//EN" />
>         </sourcetype>
>       </map:action>
>     </map:actions>

That seems correct.

>     <map:selectors default="parameter"><!-- was "browser" -->
>       <map:selector logger="sitemap.selector.parameter" name="parameter"
> src="org.apache.cocoon.selection.ParameterSelector" />
>     </map:selectors>
>   </map:components>
> 
>   <map:resources>
>     <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="glossary-v10">
> 	      <map:generate type="file" src="{lm:project.{../../1}.xml}"/>
>               <map:transform
> src="{lm:glossary.transform.glossary.document}"/>
> 	      <map:serialize type="xml-document"/>
>             </map:when>
>           <map:otherwise />

Remove that map:otherwise. When the document is not a glossary,
then Cocoon processing passes through to the next sitemap.

>         </map:select>
>       </map:act>
>     </map:resource>
>  </map:resources>
> 
>   <map:pipelines>
> 	  <map:pipeline internal="true">
> 	 <map:match pattern="**.xml">
>         <map:call resource="transform-to-document">
>           <map:parameter name="src" value="{lm:project.{1}.xml}" />
>         </map:call>
>       </map:match>
> 	  
> 	  </map:pipeline>
> 
>   </map:pipelines>
> </map:sitemap>
> ------
> 
> There are still some differences to Listlocations input.xmap so will look at
> those, otherwise it looks ok to me.

Yep, other than listed above the input.xmap looks
fine to me. And those shouldn't cause any issues.

One way to help a bit with testing is to make a
deliberate error in the input.xmap, e.g. make a spelling
mistake for the transformer src:
<map:transform src="{lm:glossary.transform.glossERRORary.document}"/>
This should give you an error if Cocoon has reached that
part of the sitemap and if it doesn't then you know that
something is wrong.

There are other techniques described at
http://forrest.apache.org/docs_0_80/howto/howto-dev.html#debug-logtransformer

-David

Mime
View raw message