forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@wkwyw.net>
Subject Re: XSP rendered with menu & tabs
Date Wed, 03 Dec 2003 18:02:57 GMT
Leo wrote:
> I am trying to get my XSP page to be rendered
> with both the tabs and menu.

Hi Leo, I recently got this working in my sitemap I have:

<map:match pattern="do/**">
   <map:mount uri-prefix="" src="serverpages.xmap" check-reload="yes"/>
</map:match>


*NOTE* I use do/** to indicate a serverpages file, you may want to 
change this matcher. However, doing this enables me to request 
domain.org/do/customerList.xml|html|pdf or whatever.

My serverpages.xmap looks like this (I'm pretty sure some of this can be 
removed, but I haven't tidied it up yet):

<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   <map:components>
     <map:generators default="file">
       <map:generator name="serverpages" 
src="org.apache.cocoon.generation.ServerPagesGenerator"/>
     </map:generators>
     <map:serializers default="html"/>
     <map:transformers default="xslt"/>
     <map:readers default="resource"/>
     <map:matchers default="wildcard"/>
     <map:actions>
       <map:action logger="sitemap.action.sourcetype" name="sourcetype" 
src="org.apache.cocoon.acting.sourcetype.SourceTypeAction">
         <sourcetype name="glossary-v10">
           <document-declaration public-id="-//SAAFE//DTD Glossary 
V1.0//EN" />
         </sourcetype>
       </map:action>
     </map:actions>

     <map:selectors default="browser">
       <map:selector logger="sitemap.selector.parameter" 
name="parameter" src="org.apache.cocoon.selection.ParameterSelector" />
     </map:selectors>
   </map:components>

   <map:resources>
     <map:resource name="skinit">
       <map:transform src="skins/{forrest:skin}/xslt/html/{type}.xsl">
         <map:parameter name="notoc" value="{notoc}"/>
         <map:parameter name="path" value="{path}"/>
         <map:parameter name="config-file" value="{project:skinconf}"/>
       </map:transform>

       <map:serialize/>
     </map:resource>

   </map:resources>

   <map:pipelines>

     <map:pipeline>

       <!-- ============================================================ -->
       <!-- OUTPUT FORMATS                                               -->
       <!-- ============================================================ -->

       <!-- Special matcher for Glossary PDFs, so we can pass an extra
       'numbersections' param into document2fo.xsl -->
       <map:match pattern="**.pdf">
         <map:generate src="cocoon:/{1}.xml"/>
         <map:transform src="skins/{forrest:skin}/xslt/fo/document2fo.xsl">
           <map:parameter name="numbersections" value="false"/>
           <map:parameter name="ctxbasedir" value="{realpath:.}/"/>
           <map:parameter name="xmlbasedir" value="content/xdocs/{1}"/>
         </map:transform>
         <map:serialize type="fo2pdf"/>
       </map:match>


       <!-- ============================================================ -->
       <!-- INTERMEDIATE FORMATS                                         -->
       <!-- ============================================================ -->

       <!--Unfortunately we need to override all the document2html stuff 
too,
       since notoc must be set to true. -->
       <map:match pattern="**body-*.html">
         <map:generate src="cocoon:/do/{1}{2}.xml"/>
         <map:transform type="xinclude"/>
         <map:transform type="linkrewriter" 
src="cocoon://{1}linkmap-{2}.html"/>
         <map:call resource="skinit">
           <map:parameter name="type" value="document2html"/>
           <map:parameter name="path" value="/do/{1}{2}.html"/>
           <map:parameter name="notoc" value="true"/>
         </map:call>
       </map:match>

       <map:match pattern="**menu-*.html">
         <map:generate src="cocoon:/{1}book-{2}.html"/>
         <map:transform type="linkrewriter" 
src="cocoon:/{1}linkmap-{2}.html"/>
         <map:call resource="skinit">
           <map:parameter name="type" value="book2menu"/>
           <map:parameter name="path" value="/do/{1}{2}.html"/>
         </map:call>
       </map:match>

       <map:match pattern="**tab-*.html">
         <map:generate src="{project:content.xdocs}tabs.xml" />
         <map:transform type="linkrewriter" 
src="cocoon:/{1}linkmap-{2}.html"/>
         <map:call resource="skinit">
           <map:parameter name="type" value="tab2menu"/>
           <map:parameter name="path" value="/do/{1}{2}.html"/>
         </map:call>
       </map:match>

       <map:match pattern="**book-*.html">
         <map:mount uri-prefix="" src="menu.xmap" check-reload="yes" />
       </map:match>


       <!-- ============================================================ -->
       <!-- SOURCE FORMATS                                               -->
       <!-- ============================================================ -->

       <map:match pattern="do/**.xml">
         <map:generate src="{project:content.xdocs}xsp/{1}.xsp" 
type="serverpages" />

         <map:serialize type="xml" />
       </map:match>

       <map:match pattern="do/*.html">
         <map:aggregate element="site">
           <map:part src="cocoon:/tab-{1}.html"/>
           <map:part src="cocoon:/menu-{1}.html"/>
           <map:part src="cocoon:/body-{1}.html"/>
         </map:aggregate>
         <map:call resource="skinit">
           <map:parameter name="type" value="site2xhtml"/>
           <map:parameter name="path" value="{0}"/>
           <map:parameter name="slideNumber" value="{2}"/>
         </map:call>
       </map:match>

       <map:match pattern="do/**/*.html">
         <map:aggregate element="site">
           <map:part src="cocoon:/{1}/tab-{2}.html"/>
           <map:part src="cocoon:/{1}/menu-{2}.html"/>
           <map:part src="cocoon:/{1}/body-{2}.html"/>
         </map:aggregate>
         <map:call resource="skinit">
           <map:parameter name="type" value="site2xhtml"/>
           <map:parameter name="path" value="{0}"/>
           <map:parameter name="slideNumber" value="{2}"/>
         </map:call>
       </map:match>

       <map:match pattern="do/**">
         <map:generate src="{project:content.xdocs}xsp/{1}.xsp" 
type="serverpages" />

         <map:serialize type="xml" />
       </map:match>


     </map:pipeline>
   </map:pipelines>
</map:sitemap>


Mime
View raw message