Author: cdupoirieux
Date: Thu Feb 23 02:59:30 2006
New Revision: 380095

URL: http://svn.apache.org/viewcvs?rev=380095&view=rev
Log:
Re-add the prepare.contract.*.** pipeline to be able to include contracts in 
another.
Very useful to customise standard contracts without copying them in your 
project.

Added:
    
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/contract-strip-xsl.xsl
   (with props)
Modified:
    
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
    
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml

Modified: 
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
URL: 
http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap?rev=380095&r1=380094&r2=380095&view=diff
==============================================================================
--- 
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
 (original)
+++ 
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
 Thu Feb 23 02:59:30 2006
@@ -103,6 +103,24 @@
         <map:serialize />
       </map:match>
     </map:pipeline>
+
+    <!-- prepare the xsl:templates of the requested contract.
+      {1} format to deliver
+      {2} contract name
+      Note - This pipeline is useful to include contracts into another. To 
include a contract :
+            <xsl:include 
href="cocoon://prepare.contract.html.NameOfTheContract"/>
+      Warning - At the moment, the contracts do not manage formats anymore... 
-->
+    <map:pipeline>
+      <map:match pattern="prepare.contract.*.**">
+        <map:generate src="{lm:resolve.contract.{1}.{2}}" />
+        <map:transform src="{lm:contract-strip-xsl.xsl}"/>
+        <map:transform type="i18n">
+          <map:parameter name="locale" value="{request:locale}" />
+        </map:transform>
+        <map:serialize />
+      </map:match>
+    </map:pipeline>
+
     <!-- You can group elements to a template and call it from any view. 
       <jx:import uri="cocoon://prepare.tiles.export-link"/>
     -->

Modified: 
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml
URL: 
http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml?rev=380095&r1=380094&r2=380095&view=diff
==============================================================================
--- 
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml
 (original)
+++ 
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/locationmap.xml
 Thu Feb 23 02:59:30 2006
@@ -265,5 +265,13 @@
           />
       </select>
     </match>
+    <!--  Extracts the style sheet from the contract.  -->
+    <match pattern="contract-strip-xsl.xsl">
+      <select type="exists">
+        <!-- don't think it's wise to let project override this... -->
+        <!-- location 
src="{project:structurer}/resources/stylesheets/helper/contract-strip-xsl.xsl" 
/-->
+        <location 
src="{defaults:structurer}/resources/stylesheets/helper/contract-strip-xsl.xsl" 
/>
+      </select>
+    </match>
   </locator>
 </locationmap>

Added: 
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/contract-strip-xsl.xsl
URL: 
http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/contract-strip-xsl.xsl?rev=380095&view=auto
==============================================================================
--- 
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/contract-strip-xsl.xsl
 (added)
+++ 
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/contract-strip-xsl.xsl
 Thu Feb 23 02:59:30 2006
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
+  as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<xsl:stylesheet version="1.0" 
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
+  xmlns:forrest="http://apache.org/forrest/templates/1.0";>
+  
+  <xsl:template match="/">
+    <xsl:copy-of select="forrest:contract/forrest:template/xsl:stylesheet"/>
+  </xsl:template>
+</xsl:stylesheet>

Propchange: 
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/resources/stylesheets/helper/contract-strip-xsl.xsl
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to