You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by th...@apache.org on 2005/10/13 11:59:38 UTC

svn commit: r320706 - in /forrest/trunk/main/webapp: WEB-INF/xconf/forrest-core.xconf locationmap-structurer.xml locationmap.xml

Author: thorsten
Date: Thu Oct 13 02:59:33 2005
New Revision: 320706

URL: http://svn.apache.org/viewcvs?rev=320706&view=rev
Log:
Views v2 codename: (views-) structurer
Added locationmap for the structurer and two new new properties to do not break views v1.


Added:
    forrest/trunk/main/webapp/locationmap-structurer.xml   (with props)
Modified:
    forrest/trunk/main/webapp/WEB-INF/xconf/forrest-core.xconf
    forrest/trunk/main/webapp/locationmap.xml

Modified: forrest/trunk/main/webapp/WEB-INF/xconf/forrest-core.xconf
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/WEB-INF/xconf/forrest-core.xconf?rev=320706&r1=320705&r2=320706&view=diff
==============================================================================
--- forrest/trunk/main/webapp/WEB-INF/xconf/forrest-core.xconf (original)
+++ forrest/trunk/main/webapp/WEB-INF/xconf/forrest-core.xconf Thu Oct 13 02:59:33 2005
@@ -16,7 +16,7 @@
   limitations under the License.
 -->
 <components>
-
+  
 <!--+
     |  This file defines the Cocoon core components.
     +-->
@@ -151,6 +151,8 @@
         <whiteboard-plugins-src>@forrest.home@/whiteboard/plugins</whiteboard-plugins-src>
         <plugins>@forrest.home@/build/plugins</plugins>
         <locationmap>@context.home@/locationmap.xml</locationmap>
+        <structurer>@forrest.home@/build/plugins/org.apache.forrest.plugin.internal.structurer</structurer>
+        <themer>@forrest.home@/build/plugins/org.apache.forrest.plugin.output.themes</themer>
         <view-internal>@forrest.home@/build/plugins/@project.view.internal.plugin@</view-internal>
         <view-themes>@forrest.home@/build/plugins/@project.theme.plugin@/resources/views</view-themes>
         <theme-ext>.fv</theme-ext>
@@ -160,6 +162,8 @@
 
     <component-instance name="project" class="org.apache.forrest.conf.ForrestConfModule">
       <values>
+        <themer>@project.themer@</themer>
+        <structurer>@project.stucturer@</structurer>
         <theme-sourcetypeDir>@project.theme-sourcetypeDir@</theme-sourcetypeDir>
         <theme-ext>@project.theme-extension@</theme-ext>
         <theme>@project.theme@</theme>

Added: forrest/trunk/main/webapp/locationmap-structurer.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/locationmap-structurer.xml?rev=320706&view=auto
==============================================================================
--- forrest/trunk/main/webapp/locationmap-structurer.xml (added)
+++ forrest/trunk/main/webapp/locationmap-structurer.xml Thu Oct 13 02:59:33 2005
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 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.
+-->
+
+<!-- Default Forrest locationmap for the structurer/themer -->
+
+<locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
+
+  <components>
+    <matchers default="lm">
+      <matcher 
+        name="lm" 
+        src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
+    </matchers>
+    <actions default="RecursiveDirectoryTraversalAction">
+      <action name="RecursiveDirectoryTraversalAction" 
+        src="org.apache.forrest.structurer.acting.RecursiveDirectoryTraversalAction"/>
+    </actions>
+    <selectors default="exists">
+          <selector name="exists" logger="sitemap.selector.exists"  
+                    src="org.apache.forrest.sourceexists.SourceExistsSelector" />
+    </selectors>
+  </components>
+  
+  <locator>
+    <!-- File specific strucuturer templates have priority before default ones. If no strucuturer template 
+      can be found in the project, we use either the theme or the default one of the themes plugin. -->
+    <match pattern="resolve.structurer.**">
+      <select type="exists">
+        <!-- File-based -->
+        <location src="{project:content.xdocs}{1}{project:theme-ext}" />
+        <!-- @src="" workaround for action bug in the locationmap! -->
+        <act type="RecursiveDirectoryTraversalAction" src="">
+          <parameter value="{1}" name="request"/>
+          <parameter value="{project:theme}" name="projectFallback"/>
+          <parameter value="{project:theme-ext}" name="projectExtension"/>
+          <parameter value="{project:content.xdocs}" name="projectDir"/>
+          <!--  Theme-based = directory-based / parent-directory based (recursively) -->
+          <location src="{uri}" />
+        </act>
+        <!-- Application theme-based -->
+        <location 
+          src="{defaults:themer}/resources/views/{project:theme}{project:theme-ext}" 
+          />
+        <!-- Application default -->
+        <location 
+          src="{defaults:themer}/resources/views/{defaults:theme}{defaults:theme-ext}" 
+          />
+      </select>
+    </match>
+    <match pattern="structurer.**">
+      <select type="exists">
+        <location src="cocoon://prepare.structurer.{1}" />
+      </select>
+    </match>
+    <!-- Structurer tiles - You can group elements to a template and call it from any view. -->
+    <match pattern="resolve.tiles.**">
+      <select type="exists">
+        <location src="{project:resources}/templates/{project:theme}/{1}.vt.xml" />
+        <location src="{project:resources}/templates/{1}.vt.xml" />
+        <location src="{defaults:themer}/resources/templates/{project:theme}/{1}.vt.xml" />
+        <location src="{defaults:themer}/resources/templates/{1}.vt.xml" />
+      </select>
+    </match>
+    <!-- FIXME: jxpath locationmap-->
+    <!-- Structurer tiles should be requested by (when jxpath bug is solved!):  -->
+    <match pattern="tiles.**">
+      <select type="exists">
+        <location src="cocoon://prepare.tiles.{1}" />
+      </select>
+    </match>
+        <!-- Aggregate the forrest:properties requested by the *.fv.  -->
+    <match pattern="structurer-properties.*.**">
+      <select type="exists">
+        <location src="cocoon://prepare.structurer-properties.{1}.{2}" />
+      </select>
+    </match>
+    <!-- Some input need to be striped by their root element. -->
+    <match pattern="root-strip.xsl">
+      <select type="exists">
+        <location src="{defaults:structurer}/resources/stylesheets/root-strip.xsl" />
+      </select>
+    </match>
+    <!--  Aggregate the contract-templates requested by the view with cinclude.  -->
+    <match pattern="structurer-xsl-includes.xsl">
+      <select type="exists">
+        <location src="{defaults:structurer}/resources/stylesheets/prepare.include.xsl" />
+      </select>
+    </match>
+    <!--  Aggregate the forrest:properties requested by the *.fv with cinclude.  -->
+    <match pattern="structurer-properties-includes.xsl">
+      <select type="exists">
+        <location src="{defaults:structurer}/resources/stylesheets/prepare.properties.xsl" />
+      </select>
+    </match>
+    <!--  Doing the transformation of all contracts-templates requested by the view.  -->
+    <match pattern="structurer-final-xsl-*.xsl">
+      <select type="exists">
+        <location src="{defaults:structurer}/resources/stylesheets/prepare.{1}.xsl" />
+      </select>
+    </match>
+  </locator>
+</locationmap>

Propchange: forrest/trunk/main/webapp/locationmap-structurer.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: forrest/trunk/main/webapp/locationmap.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/locationmap.xml?rev=320706&r1=320705&r2=320706&view=diff
==============================================================================
--- forrest/trunk/main/webapp/locationmap.xml (original)
+++ forrest/trunk/main/webapp/locationmap.xml Thu Oct 13 02:59:33 2005
@@ -59,6 +59,10 @@
       <mount src="{forrest:context}/locationmap-plugin.xml"/>
     </select>
     
+    <select>
+      <mount src="{forrest:context}/locationmap-structurer.xml"/>
+    </select>
+    
     <!--  FIXME: this should be part of a chaperon plugin -->
     <select>
       <mount src="{forrest:context}/locationmap-chaperon.xml"/>