forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject svn commit: rev 10280 - in xml/forrest/branches/copyless/src: core/context core/context/WEB-INF java/org/apache/forrest/conf
Date Mon, 26 Apr 2004 09:36:43 GMT
Author: nicolaken
Date: Mon Apr 26 02:36:43 2004
New Revision: 10280

Modified:
   xml/forrest/branches/copyless/src/core/context/WEB-INF/cocoon.xconf
   xml/forrest/branches/copyless/src/core/context/dtd.xmap
   xml/forrest/branches/copyless/src/core/context/faq.xmap
   xml/forrest/branches/copyless/src/core/context/forrest.xmap
   xml/forrest/branches/copyless/src/core/context/resources.xmap
   xml/forrest/branches/copyless/src/core/context/sitemap.xmap
   xml/forrest/branches/copyless/src/core/context/tabs.xmap
   xml/forrest/branches/copyless/src/java/org/apache/forrest/conf/ForrestConfModule.java
Log:
Add the forrest context value as the stylesheets are in a different position in the webapp
and the source layout.

Modified: xml/forrest/branches/copyless/src/core/context/WEB-INF/cocoon.xconf
==============================================================================
--- xml/forrest/branches/copyless/src/core/context/WEB-INF/cocoon.xconf	(original)
+++ xml/forrest/branches/copyless/src/core/context/WEB-INF/cocoon.xconf	Mon Apr 26 02:36:43
2004
@@ -182,8 +182,9 @@
         <bugtracking-url>@project.bugtracking-url@</bugtracking-url>
         <i18n>@project.i18n@</i18n>
         <home>@forrest.home@/</home>
-        <skins-dir>@forrest.home@/context/skins/</skins-dir>
-        <stylesheets>@forrest.home@/context/resources/stylesheets</stylesheets>
+        <context>@context.home@</context>        
+        <skins-dir>@context.home@/skins/</skins-dir>
+        <stylesheets>@context.home@/resources/stylesheets</stylesheets>
       </values>
     </component-instance>
 

Modified: xml/forrest/branches/copyless/src/core/context/dtd.xmap
==============================================================================
--- xml/forrest/branches/copyless/src/core/context/dtd.xmap	(original)
+++ xml/forrest/branches/copyless/src/core/context/dtd.xmap	Mon Apr 26 02:36:43 2004
@@ -40,7 +40,7 @@
     <map:pipeline>
 
       <map:match pattern="**.dtdx.xml">
-        <map:generate type="nekodtd" src="{forrest:home}/context/resources/schema/dtd/{1}.dtd">
+        <map:generate type="nekodtd" src="{forrest:context}/resources/schema/dtd/{1}.dtd">
           <map:parameter name="config-class" value="org.cyberneko.dtd.DTDConfiguration"
/>
         </map:generate>
         <map:transform src="{forrest:stylesheets}/dtdx2flat.xsl" />

Modified: xml/forrest/branches/copyless/src/core/context/faq.xmap
==============================================================================
--- xml/forrest/branches/copyless/src/core/context/faq.xmap	(original)
+++ xml/forrest/branches/copyless/src/core/context/faq.xmap	Mon Apr 26 02:36:43 2004
@@ -98,7 +98,7 @@
             </map:transform>
           </map:when>
           <map:otherwise>
-            <map:transform src="{forrest:home}context/skins/{forrest:skin}/xslt/html/{type}.xsl">
+            <map:transform src="{forrest:context}/xslt/html/{type}.xsl">
               <map:parameter name="notoc" value="{notoc}"/>
               <!-- For backwards-compat with 0.2 - 0.4 skins -->
               <map:parameter name="isfaq" value="{notoc}"/>
@@ -135,7 +135,7 @@
             </map:transform>
           </map:when>
           <map:otherwise>
-            <map:transform src="{forrest:home}context/skins/{forrest:skin}/xslt/fo/document2fo.xsl">
+            <map:transform src="/skins/{forrest:skin}{forrest:context}xsl">
               <map:parameter name="numbersections" value="false"/>
               <map:parameter name="imagesdir" value="{project:resources.images}/"/>
               <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>

Modified: xml/forrest/branches/copyless/src/core/context/forrest.xmap
==============================================================================
--- xml/forrest/branches/copyless/src/core/context/forrest.xmap	(original)
+++ xml/forrest/branches/copyless/src/core/context/forrest.xmap	Mon Apr 26 02:36:43 2004
@@ -218,7 +218,7 @@
             <map:transform type="lexer"   src="cocoon:/wiki.xlex"/>
             <map:transform type="parser"  src="cocoon:/wiki.xgrm"/>
             <map:transform type="xsltc" 
-              src="{forrest:home}/context/resources/chaperon/stylesheets/wiki2xdoc.xsl">
+              src="{forrest:context}/resources/chaperon/stylesheets/wiki2xdoc.xsl">
               <map:parameter name="name" value="{2}" />
             </map:transform>
             <map:serialize type="xml-document"/>
@@ -306,13 +306,13 @@
             <map:read src="resources/chaperon/grammars/{1}.xlex"/>
           </map:when>
           <map:otherwise>
-    <map:generate  type="text2xml"   src="{forrest:home}/context/resources/chaperon/grammars/{1}.grm"/>
-    <map:transform type="lexer"  src="{forrest:home}/context/resources/chaperon/grammars/grm.xlex"/>
-    <map:transform type="parser" src="{forrest:home}/context/resources/chaperon/grammars/grm.xgrm"/>
-    <map:transform               src="{forrest:home}/context/resources/chaperon/stylesheets/text4regex.xsl"/>
-    <map:transform type="lexer"  src="{forrest:home}/context/resources/chaperon/grammars/regex.xlex"/>
-    <map:transform type="parser" src="{forrest:home}/context/resources/chaperon/grammars/regex.xgrm"/>
-    <map:transform               src="{forrest:home}/context/resources/chaperon/stylesheets/grm2xlex.xsl"/>
+    <map:generate  type="text2xml"   src="{forrest:context}/resources/chaperon/grammars/{1}.grm"/>
+    <map:transform type="lexer"  src="{forrest:context}/resources/chaperon/grammars/grm.xlex"/>
+    <map:transform type="parser" src="{forrest:context}/resources/chaperon/grammars/grm.xgrm"/>
+    <map:transform               src="{forrest:context}/resources/chaperon/stylesheets/text4regex.xsl"/>
+    <map:transform type="lexer"  src="{forrest:context}/resources/chaperon/grammars/regex.xlex"/>
+    <map:transform type="parser" src="{forrest:context}/resources/chaperon/grammars/regex.xgrm"/>
+    <map:transform               src="{forrest:context}/resources/chaperon/stylesheets/grm2xlex.xsl"/>
     <map:serialize type="xml"/>
           </map:otherwise>
         </map:select>
@@ -324,13 +324,13 @@
             <map:read src="resources/chaperon/grammars/{1}.xgrm"/>
           </map:when>
           <map:otherwise>
-    <map:generate  type="text2xml"   src="{forrest:home}/context/resources/chaperon/grammars/{1}.grm"/>
-    <map:transform type="lexer"  src="{forrest:home}/context/resources/chaperon/grammars/grm.xlex"/>
-    <map:transform type="parser" src="{forrest:home}/context/resources/chaperon/grammars/grm.xgrm"/>
-    <map:transform               src="{forrest:home}/context/resources/chaperon/stylesheets/text4regex.xsl"/>
-    <map:transform type="lexer"  src="{forrest:home}/context/resources/chaperon/grammars/regex.xlex"/>
-    <map:transform type="parser" src="{forrest:home}/context/resources/chaperon/grammars/regex.xgrm"/>
-    <map:transform               src="{forrest:home}/context/resources/chaperon/stylesheets/grm2xgrm.xsl"/>
+    <map:generate  type="text2xml"   src="{forrest:context}/resources/chaperon/grammars/{1}.grm"/>
+    <map:transform type="lexer"  src="{forrest:context}/resources/chaperon/grammars/grm.xlex"/>
+    <map:transform type="parser" src="{forrest:context}/resources/chaperon/grammars/grm.xgrm"/>
+    <map:transform               src="{forrest:context}/resources/chaperon/stylesheets/text4regex.xsl"/>
+    <map:transform type="lexer"  src="{forrest:context}/resources/chaperon/grammars/regex.xlex"/>
+    <map:transform type="parser" src="{forrest:context}/resources/chaperon/grammars/regex.xgrm"/>
+    <map:transform               src="{forrest:context}/resources/chaperon/stylesheets/grm2xgrm.xsl"/>
     <map:serialize type="xml"/>
           </map:otherwise>
         </map:select>
@@ -338,13 +338,13 @@
 
    <map:match pattern="*.xegrm">
         <map:select type="exists">
-          <map:when test="{forrest:home}/context/resources/chaperon/grammars/{1}.xegrm">
-            <map:read src="{forrest:home}/context/resources/chaperon/grammars/{1}.xegrm"/>
+          <map:when test="{forrest:context}/resources/chaperon/grammars/{1}.xegrm">
+            <map:read src="{forrest:context}/resources/chaperon/grammars/{1}.xegrm"/>
           </map:when>
           <map:otherwise>
-    <map:generate  type="text2xml"   src="{forrest:home}/context/resources/chaperon/grammars/{1}.egrm"/>
-    <map:transform type="extparser" src="{forrest:home}/context/resources/chaperon/grammars/egrm.xegrm"/>
-    <map:transform               src="{forrest:home}/context/resources/chaperon/stylesheets/egrm2xegrm.xsl"/>
+    <map:generate  type="text2xml"   src="{forrest:context}/resources/chaperon/grammars/{1}.egrm"/>
+    <map:transform type="extparser" src="{forrest:context}/resources/chaperon/grammars/egrm.xegrm"/>
+    <map:transform               src="{forrest:context}/resources/chaperon/stylesheets/egrm2xegrm.xsl"/>
     <map:serialize type="xml"/>
           </map:otherwise>
         </map:select>

Modified: xml/forrest/branches/copyless/src/core/context/resources.xmap
==============================================================================
--- xml/forrest/branches/copyless/src/core/context/resources.xmap	(original)
+++ xml/forrest/branches/copyless/src/core/context/resources.xmap	Mon Apr 26 02:36:43 2004
@@ -64,34 +64,34 @@
                </map:when>
                
               <!-- Second location: forrest skin dir -->
-               <map:when test="{forrest:home}context/skins/{forrest:skin}/{path}/{name}.{ext}">
-                  <map:read src="{forrest:home}context/skins/{forrest:skin}/{path}/{name}.{ext}"
mime-type="{mime-type}" />
+               <map:when test="{forrest:context}/skins/{forrest:skin}/{path}/{name}.{ext}">
+                  <map:read src="{forrest:context}/skins/{forrest:skin}/{path}/{name}.{ext}"
mime-type="{mime-type}" />
                </map:when>
-               <map:when test="{forrest:home}context/skins/{forrest:skin}/{path}/{name}.css.xslt">
+               <map:when test="{forrest:context}/skins/{forrest:skin}/{path}/{name}.css.xslt">
                   <map:call resource="pipe-text-resource">
-                    <map:parameter name="path" value="{forrest:home}context/skins/{forrest:skin}/{path}/{name}.css.xslt"
/>
+                    <map:parameter name="path" value="{forrest:context}/skins/{forrest:skin}/{path}/{name}.css.xslt"
/>
                     <map:parameter name="mime-type" value="text/css" />
                   </map:call>
                </map:when>
-               <map:when test="{forrest:home}context/skins/{forrest:skin}/{path}/{name}.svg.xslt">
+               <map:when test="{forrest:context}/skins/{forrest:skin}/{path}/{name}.svg.xslt">
                   <map:call resource="pipe-svg2png-resource">
-                    <map:parameter name="path" value="{forrest:home}context/skins/{forrest:skin}/{path}/{name}.svg.xslt"
/>
+                    <map:parameter name="path" value="{forrest:context}/skins/{forrest:skin}/{path}/{name}.svg.xslt"
/>
                   </map:call>
                </map:when>
                
               <!-- Third location: forrest common skin dir -->
-               <map:when test="{forrest:home}context/skins/common/{path}/{name}.{ext}">
-                  <map:read src="{forrest:home}context/skins/common/{path}/{name}.{ext}"
mime-type="{mime-type}" />
+               <map:when test="{forrest:context}/skins/common/{path}/{name}.{ext}">
+                  <map:read src="{forrest:context}/skins/common/{path}/{name}.{ext}" mime-type="{mime-type}"
/>
                </map:when>
-               <map:when test="{forrest:home}context/skins/common/{path}/{name}.css.xslt">
+               <map:when test="{forrest:context}/skins/common/{path}/{name}.css.xslt">
                   <map:call resource="pipe-text-resource">
-                    <map:parameter name="path" value="{forrest:home}context/skins/common/{path}/{name}.css.xslt"
/>
+                    <map:parameter name="path" value="{forrest:context}/skins/common/{path}/{name}.css.xslt"
/>
                     <map:parameter name="mime-type" value="text/css" />
                   </map:call>
                </map:when>
-               <map:when test="{forrest:home}context/skins/common/{path}/{name}.svg.xslt">
+               <map:when test="{forrest:context}/skins/common/{path}/{name}.svg.xslt">
                   <map:call resource="pipe-svg2png-resource">
-                    <map:parameter name="path" value="{forrest:home}context/skins/common/{path}/{name}.svg.xslt"
/>
+                    <map:parameter name="path" value="{forrest:context}/skins/common/{path}/{name}.svg.xslt"
/>
                   </map:call>
                </map:when>
                <map:otherwise>
@@ -114,9 +114,9 @@
                     <map:parameter name="fg-color-name" value="{fg-color-name}"/> 
 
                   </map:call>
                </map:when>
-               <map:when test="{forrest:home}context/skins/{forrest:skin}/{path}/{name}.svg.xslt">
+               <map:when test="{forrest:context}/skins/{forrest:skin}/{path}/{name}.svg.xslt">
                   <map:call resource="pipe-svg2png-corner-resource">
-                    <map:parameter name="path" value="{forrest:home}context/skins/{forrest:skin}/{path}/{name}.svg.xslt"
/>
+                    <map:parameter name="path" value="{forrest:context}/skins/{forrest:skin}/{path}/{name}.svg.xslt"
/>
                     <map:parameter name="orientation-tb" value="{orientation-tb}"/>
                     <map:parameter name="orientation-lr" value="{orientation-lr}"/>
                     <map:parameter name="size" value="{size}"/>   
@@ -127,7 +127,7 @@
                </map:when>
                <map:otherwise>
                   <map:call resource="pipe-svg2png-corner-resource">
-                    <map:parameter name="path" value="{forrest:home}context/skins/common/{path}/{name}.svg.xslt"
/>
+                    <map:parameter name="path" value="{forrest:context}/skins/common/{path}/{name}.svg.xslt"
/>
                     <map:parameter name="orientation-tb" value="{orientation-tb}"/>
                     <map:parameter name="orientation-lr" value="{orientation-lr}"/>
                     <map:parameter name="size" value="{size}"/>   

Modified: xml/forrest/branches/copyless/src/core/context/sitemap.xmap
==============================================================================
--- xml/forrest/branches/copyless/src/core/context/sitemap.xmap	(original)
+++ xml/forrest/branches/copyless/src/core/context/sitemap.xmap	Mon Apr 26 02:36:43 2004
@@ -196,7 +196,7 @@
             </map:transform>
           </map:when>
           <map:otherwise>
-            <map:transform src="{forrest:home}context/skins/{forrest:skin}/xslt/html/{type}.xsl">
+            <map:transform src="{forrest:context}/skins/{forrest:skin}/xslt/html/{type}.xsl">
               <map:parameter name="notoc" value="{notoc}"/>
               <!-- For backwards-compat with 0.2 - 0.4 skins -->
               <map:parameter name="isfaq" value="{notoc}"/>
@@ -223,11 +223,11 @@
              </map:when>
            </map:select>
            <map:select type="exists">
-             <map:when test="{forrest:home}context/skins/{forrest:skin}/skinconf.xsl">
-               <map:transform src="{forrest:home}context/skins/{forrest:skin}/skinconf.xsl"/>
+             <map:when test="{forrest:context}/skins/{forrest:skin}/skinconf.xsl">
+               <map:transform src="{forrest:context}/skins/{forrest:skin}/skinconf.xsl"/>
              </map:when>
            </map:select>
-           <map:transform src="{forrest:home}context/skins/common/skinconf.xsl"/>
+           <map:transform src="{forrest:context}/skins/common/skinconf.xsl"/>
            <map:transform type="skinconf"/>
            <map:serialize type="xml" />
          </map:match>
@@ -427,15 +427,15 @@
               <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
             </map:transform>
           </map:when>
-          <map:when test="{forrest:home}context/skins/{forrest:skin}/xslt/fo/document2fo.xsl">
-            <map:transform src="{forrest:home}context/skins/{forrest:skin}/xslt/fo/document2fo.xsl">
+          <map:when test="{forrest:context}/skins/{forrest:skin}/xslt/fo/document2fo.xsl">
+            <map:transform src="{forrest:context}/skins/{forrest:skin}/xslt/fo/document2fo.xsl">
               <map:parameter name="config-file" value="{project:skinconf}"/>
               <map:parameter name="imagesdir" value="{project:resources.images}/"/>
               <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
             </map:transform>
           </map:when>
           <map:otherwise>
-            <map:transform src="{forrest:home}context/skins/common/xslt/fo/document2fo.xsl">
+            <map:transform src="{forrest:context}/skins/common/xslt/fo/document2fo.xsl">
               <map:parameter name="config-file" value="{project:skinconf}"/>
               <map:parameter name="imagesdir" value="{project:resources.images}/"/>
               <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
@@ -457,14 +457,14 @@
               <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
             </map:transform>
           </map:when>
-          <map:when test="{forrest:home}context/skins/{forrest:skin}/xslt/svg/document2svg.xsl">
-            <map:transform src="{forrest:home}context/skins/{forrest:skin}/xslt/svg/document2svg.xsl">
+          <map:when test="{forrest:context}/skins/{forrest:skin}/xslt/svg/document2svg.xsl">
+            <map:transform src="{forrest:context}/skins/{forrest:skin}/xslt/svg/document2svg.xsl">
               <map:parameter name="imagesdir" value="{project:resources.images}/"/>
               <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
             </map:transform>
           </map:when>
           <map:otherwise>
-            <map:transform src="{forrest:home}context/skins/common/xslt/svg/document2svg.xsl">
+            <map:transform src="{forrest:context}/skins/common/xslt/svg/document2svg.xsl">
               <map:parameter name="imagesdir" value="{project:resources.images}/"/>
               <map:parameter name="xmlbasedir" value="{project:content.xdocs}{1}"/>
             </map:transform>

Modified: xml/forrest/branches/copyless/src/core/context/tabs.xmap
==============================================================================
--- xml/forrest/branches/copyless/src/core/context/tabs.xmap	(original)
+++ xml/forrest/branches/copyless/src/core/context/tabs.xmap	Mon Apr 26 02:36:43 2004
@@ -50,7 +50,7 @@
           </map:transform>
         </map:when>
         <map:otherwise>
-          <map:transform src="{forrest:home}context/skins/{forrest:skin}/xslt/html/{type}.xsl">
+          <map:transform src="{forrest:context}/skins/{forrest:skin}/xslt/html/{type}.xsl">
             <map:parameter name="notoc" value="{notoc}"/>
             <!-- For backwards-compat with 0.2 - 0.4 skins -->
             <map:parameter name="isfaq" value="{notoc}"/>

Modified: xml/forrest/branches/copyless/src/java/org/apache/forrest/conf/ForrestConfModule.java
==============================================================================
--- xml/forrest/branches/copyless/src/java/org/apache/forrest/conf/ForrestConfModule.java
(original)
+++ xml/forrest/branches/copyless/src/java/org/apache/forrest/conf/ForrestConfModule.java
Mon Apr 26 02:36:43 2004
@@ -67,8 +67,10 @@
 {
 
     private AntProperties  filteringProperties;
-    private String         forrestHome, projectHome;
+    private String         forrestHome, projectHome, contextHome;
     private SourceResolver m_resolver;
+    
+    private final static String defaultHome = "context:/";
 
     public Object getAttribute(String name, Configuration modeConf,
                     Map objectModel) throws ConfigurationException {
@@ -99,7 +101,7 @@
     private final String getSystemProperty(String propertyName){
 
         //if the property is not set, default to the webapp context
-        String propertyValue = System.getProperty(propertyName, "context:/");
+        String propertyValue = System.getProperty(propertyName, defaultHome);
 
         if (debugging()) debug("system property " + propertyName + "=" + propertyValue);
 
@@ -116,13 +118,19 @@
         //      is run as a .war
         forrestHome = getSystemProperty("forrest.home");
         projectHome = getSystemProperty("project.home");
+        if(projectHome.equals(defaultHome)) {
+            contextHome = defaultHome;            
+        }else {
+            contextHome = forrestHome + SystemUtils.FILE_SEPARATOR + "/context"; 
+        }
+            
         
         filteringProperties = new AntProperties();
         
         //add forrest.home and project.home to properties
         filteringProperties.setProperty("forrest.home", forrestHome);
         filteringProperties.setProperty("project.home", projectHome);
-
+        filteringProperties.setProperty("context.home", contextHome);
       
         //NOTE: the first values set get precedence, as in AntProperties
 

Mime
View raw message