You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by ni...@apache.org on 2004/05/22 09:53:22 UTC
svn commit: rev 20209 - in xml/forrest/trunk: . scratchpad/forrestbot2/core src/core src/core/bin src/core/context src/core/context/WEB-INF src/core/context/skins/avalon-tigris/xslt/html src/core/context/skins/common/xslt/html src/core/context/skins/forrest-css/xslt/html src/core/context/skins/forrest-site/xslt/html src/core/context/skins/krysalis-site/xslt/html src/core/context/skins/tigris-style/xslt/html src/core/targets src/java/org/apache/forrest/conf
Author: nicolaken
Date: Sat May 22 00:53:22 2004
New Revision: 20209
Added:
xml/forrest/trunk/src/core/context/default-forrest.properties (props changed)
- copied unchanged from rev 20197, xml/forrest/branches/copyless/src/core/context/default-forrest.properties
Removed:
xml/forrest/trunk/.cvsignore
xml/forrest/trunk/src/core/context/WEB-INF/cocoon-live.xconf
xml/forrest/trunk/src/core/default-forrest.properties
xml/forrest/trunk/src/core/targets/war.xml
Modified:
xml/forrest/trunk/ (props changed)
xml/forrest/trunk/build.xml
xml/forrest/trunk/scratchpad/forrestbot2/core/build.xml
xml/forrest/trunk/scratchpad/forrestbot2/core/getsrc.xml
xml/forrest/trunk/src/core/bin/forrest (contents, props changed)
xml/forrest/trunk/src/core/bin/forrest.bat
xml/forrest/trunk/src/core/context/WEB-INF/cocoon.xconf
xml/forrest/trunk/src/core/context/dtd.xmap
xml/forrest/trunk/src/core/context/faq.xmap
xml/forrest/trunk/src/core/context/forrest.xmap
xml/forrest/trunk/src/core/context/resources.xmap
xml/forrest/trunk/src/core/context/sitemap.xmap
xml/forrest/trunk/src/core/context/skins/avalon-tigris/xslt/html/site2xhtml.xsl
xml/forrest/trunk/src/core/context/skins/common/xslt/html/document2html.xsl
xml/forrest/trunk/src/core/context/skins/common/xslt/html/site2xhtml.xsl
xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/document2html.xsl
xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl
xml/forrest/trunk/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl
xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/document2html.xsl
xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl
xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/document2html.xsl
xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl
xml/forrest/trunk/src/core/context/status.xmap
xml/forrest/trunk/src/core/context/tabs.xmap
xml/forrest/trunk/src/core/forrest.build.xml
xml/forrest/trunk/src/core/targets/context.xml
xml/forrest/trunk/src/core/targets/site.xml
xml/forrest/trunk/src/core/targets/validate.xml
xml/forrest/trunk/src/core/targets/webapp.xml
xml/forrest/trunk/src/java/org/apache/forrest/conf/AntProperties.java
xml/forrest/trunk/src/java/org/apache/forrest/conf/ForrestConfModule.java
Log:
Merged copyless branch changes r10125:20197 into the trunk.
Please don't commit to copyless anymore, only to the trunk.
Modified: xml/forrest/trunk/build.xml
==============================================================================
--- xml/forrest/trunk/build.xml (original)
+++ xml/forrest/trunk/build.xml Sat May 22 00:53:22 2004
@@ -14,7 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<project default="dist" basedir="." name="Forrest build file">
+<project default="jar" basedir="." name="Forrest build file">
<import file="src/forrestbar/build.xml"/>
@@ -48,6 +48,10 @@
<property name="tools.dir" location="tools"/>
<property name="tools.jar" location="${java.home}/../lib/tools.jar"/>
<available file="${tools.jar}" property="tools.jar.present"/>
+
+ <property name="src-fresh-site" location="src/core/fresh-site"/>
+
+ <property name="forrestbot.dir" location="scratchpad/forrestbot2"/>
<buildnumber file="etc/build.number"/>
<echo>
@@ -78,87 +82,28 @@
<target name="clean" depends="init" description="Delete all generated files">
<delete dir="${build.dir}"/>
+ <delete dir="${forrestbot.dir}/logs"/>
+ <delete dir="${forrestbot.dir}/work"/>
+ <delete dir="${forrestbot.dir}/build"/>
+ <delete dir="${forrestbot.dir}/webapp/target"/>
+ <delete dir="${forrestbot.dir}/webapp/maven.log"/>
+ <delete dir="src/core/context/WEB-INF/logs"/>
</target>
+ <target name="dist-clean" depends="init, clean" description="Delete all non-forrest files">
+ <delete dir="${forrestbot.dir}/*.settings"/>
+ <delete file="**/*.bak"/>
+ <delete file="**/*~"/>
+ </target>
<!-- =================================================================== -->
<!-- Make release distributions -->
<!-- =================================================================== -->
- <target name="release-dist-src" depends="init"
- description="Makes a source release distribution">
- <mkdir dir="${dist.dir}"/>
-
- <!-- Hackery to fix linefeeds and permissions before zipping -->
- <patternset id="scripts">
- <include name="**/*.bat"/>
- <include name="**/*.sh"/>
- <include name="**/ant"/>
- <include name="**/forrest"/>
- </patternset>
-
- <patternset id="noscripts">
- <exclude name="**/*.bat"/>
- <exclude name="**/*.sh"/>
- <exclude name="**/ant"/>
- <exclude name="**/forrest"/>
- </patternset>
-
- <property name="tmp-scripts" location="${build.dir}/tmp/scripts"/>
- <mkdir dir="${tmp-scripts}"/>
- <copy todir="${tmp-scripts}">
- <fileset dir=".">
- <patternset refid="scripts"/>
- </fileset>
- </copy>
- <fixcrlf eol="crlf" srcdir="${tmp-scripts}" includes="**/*.bat"/>
- <fixcrlf eol="lf" srcdir="${tmp-scripts}" excludes="**/*.bat"/>
- <chmod dir="${tmp-scripts}" perm="ugo+rx" excludes="**/*.bat"/>
- <property name="tmp-fresh-site" location="${build.dir}/tmp/fresh-site"/>
- <copy todir="${tmp-fresh-site}">
- <fileset dir="${src-fresh-site}" />
- </copy>
- <fixcrlf eol="crlf" srcdir="${tmp-fresh-site}" excludes="**/*.gif **/*.png"/>
-
- <property name="release-name-src" value="${name}-${version}-src"/>
- <zip
- file="${dist.dir}/${release-name-src}.zip" >
- <zipfileset dir="." prefix="${release-name-src}">
- <exclude name="build/**"/>
- <patternset refid="noscripts"/>
- </zipfileset>
- <zipfileset prefix="${release-name-src}" dir="${tmp-scripts}"/>
- <zipfileset prefix="${release-name-src}" dir="etc" includes="RELEASE-NOTES-${version}.txt"/>
- </zip>
-
- <tar longfile="gnu"
- compression="gzip"
- destfile="${dist.dir}/${release-name-src}.tar.gz" >
- <tarfileset dir="." prefix="${release-name-src}" username="forrest" group="forrest">
- <exclude name="build/**"/>
- <patternset refid="noscripts"/>
- </tarfileset>
- <tarfileset prefix="${release-name-src}" dir="${tmp-scripts}"
- mode="755" username="forrest" group="forrest">
- <include name="**/*.sh"/>
- <include name="**/ant"/>
- <include name="**/forrest"/>
- </tarfileset>
- <tarfileset prefix="${release-name-src}" dir="${tmp-scripts}"
- username="forrest" group="forrest">
- <exclude name="**/*.sh"/>
- <exclude name="**/ant"/>
- <exclude name="**/forrest"/>
- </tarfileset>
- <tarfileset prefix="${release-name-src}" dir="etc" includes="RELEASE-NOTES-${version}.txt"/>
- </tar>
- </target>
-
-
- <target name="release-dist-bin" depends="init, dist-shbat"
- description="Makes a binary release distribution">
- <property name="release-name-bin" value="${name}-${version}-bin"/>
+ <target name="release-dist" depends="init, dist-clean, dist-shbat"
+ description="Makes release distributions">
+ <property name="release-name-bin" value="${name}-${version}"/>
<zip
file="${dist.dir}/${release-name-bin}.zip" >
<zipfileset dir="${dist-shbat.dir}" prefix="${release-name-bin}"/>
@@ -185,11 +130,6 @@
</tar>
</target>
- <target name="release-dist"
- description="Makes source and binary release distributions"
- depends="release-dist-bin, release-dist-src"/>
-
-
<!-- =================================================================== -->
<!-- Make all known distributions -->
@@ -241,12 +181,6 @@
-->
</target>
- <target name="refresh-code" depends="jar">
- <copy todir="${dist-shbat.dir}/lib/core">
- <fileset dir="${build.dir}" includes="*.jar"/>
- </copy>
- </target>
-
<target name="dist-shbat"
depends="init, jar, validate-config" >
@@ -254,38 +188,22 @@
<delete dir="${dist-shbat.dir}" />
<mkdir dir="${dist-shbat.dir}" />
- <!-- copy the Forrest core -->
+ <!-- copy all Forrest -->
<copy todir="${dist-shbat.dir}">
- <fileset dir="./src/core" />
- </copy>
-
- <!-- copy licenses -->
- <copy todir="${dist-shbat.dir}/legal">
- <fileset dir="./legal" />
- </copy>
-
- <!-- Copy Forrest jars -->
- <antcall target="refresh-code"/>
-
- <mkdir dir="${dist-shbat.dir}/lib" />
- <copy todir="${dist-shbat.dir}/lib">
- <!-- copy everything so that also dirs with no jars are there, as
- the forrest build expects these dirs to be present. -->
- <fileset dir="./lib" includes="*/*.*"/>
- </copy>
-
- <!-- Copy all tools, so the shbat distribution is self-contained -->
- <copy todir="${dist-shbat.dir}/tools">
- <fileset dir="${tools.dir}" />
+ <fileset dir="." >
+ <exclude name="build/**"/>
+ </fileset>
</copy>
- <copy todir="${dist-shbat.dir}/tools/ant/lib">
- <fileset dir="lib/core" includes="xml-commons-resolver*.jar"/>
+ <copy todir="${dist-shbat.dir}">
+ <fileset dir="." >
+ <include name="build/xml-forrest.jar"/>
+ </fileset>
</copy>
-
+
<!-- Fix bin/ permissions -->
- <fixcrlf eol="crlf" srcdir="${dist-shbat.dir}/bin" includes="*.bat"/>
- <fixcrlf eol="lf" srcdir="${dist-shbat.dir}/bin" excludes="*.bat"/>
- <chmod dir="${dist-shbat.dir}/bin" perm="ugo+rx" excludes="*.bat"/>
+ <fixcrlf eol="crlf" srcdir="${dist-shbat.dir}/src/core/bin" includes="*.bat"/>
+ <fixcrlf eol="lf" srcdir="${dist-shbat.dir}/src/core/bin" excludes="*.bat"/>
+ <chmod dir="${dist-shbat.dir}/src/core/bin" perm="ugo+rx" excludes="*.bat"/>
<!-- Fix ant/bin/ permissions -->
<fixcrlf eol="crlf" srcdir="${dist-shbat.dir}/tools/ant/bin" includes="*.bat"/>
@@ -299,7 +217,8 @@
| You have succesfully built the shell-bat distribution of Forrest.
| Please find it at: ${dist-shbat.dir}
| Please copy the contents to the install directory of your choice
- | Please have the environment variable FORREST_HOME point to it.
+ | Please have the environment variable FORREST_HOME point to
+ | ${dist-shbat.dir}/src/core
| It is recommended to add
| unix: $FORREST_HOME/bin: to your $PATH
| win: %FORREST_HOME%\bin; to your %PATH%
@@ -322,42 +241,14 @@
<ant antfile="${forrest.home}/forrest.antproxy.xml" target="site"/>
</target>
-
- <!-- =================================================================== -->
- <!-- Generate cocoon-webapp for project-site -->
- <!-- =================================================================== -->
- <target name="webapp" depends="dist-shbat"
- description="Generates an unpackaged webapp of the website">
- <property name="forrest.home" value="${dist-shbat.dir}" />
- <ant antfile="${forrest.home}/forrest.antproxy.xml" target="webapp"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Generate a .war files of the project-site -->
- <!-- =================================================================== -->
- <target name="war" depends="dist-shbat"
- description="Generates a .war file containing the website">
- <property name="forrest.home" value="${dist-shbat.dir}" />
- <ant antfile="${forrest.home}/forrest.antproxy.xml" target="war"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Validates Forrest XML documentation -->
- <!-- =================================================================== -->
- <target name="validate" depends="dist-shbat"
- description="Validates XML documentation files">
- <property name="forrest.home" value="${dist-shbat.dir}" />
- <ant antfile="${forrest.home}/forrest.antproxy.xml" target="validate"/>
- </target>
-
<!-- ================================== -->
<!-- Test targets -->
<!-- ================================== -->
<target name="test"
depends="testseed"
- description="Test that the features are ok before commmitting."/>
+ description="Test that the features are ok before committing."/>
- <target name="testseed" depends="init" description="Test that the features are ok before commmitting.">
+ <target name="testseed" depends="init" description="Test that the features are ok before committing.">
<property name="forrest.home" value="${dist-shbat.dir}" />
<property name="test.dir" value="${build.dir}/test"/>
<delete dir="${test.dir}"/>
@@ -369,7 +260,6 @@
<ant antfile="${test.dir}/forrest-targets.xml" target="site"/>
-
<!--
<ant antfile="${forrest.home}/forrest.build.xml" target="site">
<property name="forrest.home" value="${dist-shbat.dir}" />
Modified: xml/forrest/trunk/scratchpad/forrestbot2/core/build.xml
==============================================================================
--- xml/forrest/trunk/scratchpad/forrestbot2/core/build.xml (original)
+++ xml/forrest/trunk/scratchpad/forrestbot2/core/build.xml Sat May 22 00:53:22 2004
@@ -19,7 +19,7 @@
<property name="build.work-dir" location="work/${ant.project.name}"/>
<property name="build.site-dir" location="build/${ant.project.name}"/>
<tstamp>
- <format property="logtime" pattern="yyMMdd-hhmm"/>
+ <format property="logtime" pattern="yyyyMMddHHmmss"/>
</tstamp>
<property name="build.log-dir" location="logs"/>
Modified: xml/forrest/trunk/scratchpad/forrestbot2/core/getsrc.xml
==============================================================================
--- xml/forrest/trunk/scratchpad/forrestbot2/core/getsrc.xml (original)
+++ xml/forrest/trunk/scratchpad/forrestbot2/core/getsrc.xml Sat May 22 00:53:22 2004
@@ -62,7 +62,7 @@
<echo>Loading ${build.cvsmodule-dir}/${getsrc.cvs.module}/forrest.properties..</echo>
<loadproperties srcFile="${build.cvsmodule-dir}/${getsrc.cvs.module}/forrest.properties"/>
- <loadproperties srcFile="${forrest.home}/default-forrest.properties"/>
+ <loadproperties srcFile="${forrest.home}/context/default-forrest.properties"/>
<!-- only the project.content-dir directory -->
<echo><![CDATA[<cvs cvsRoot=":pserver:${getsrc.cvs.user}@${getsrc.cvs.host}:${getsrc.cvs.root}"
@@ -111,7 +111,7 @@
<echo>Loading ${build.svn-dir}/${ant.project.name}/forrest.properties..</echo>
<loadproperties srcFile="${build.svn-dir}/${ant.project.name}/forrest.properties"/>
- <loadproperties srcFile="${forrest.home}/default-forrest.properties"/>
+ <loadproperties srcFile="${forrest.home}/context/default-forrest.properties"/>
<!-- only the project.content-dir directory -->
<svncheckout repositoryUrl="${getsrc.svn.url}/${project.content-dir}"
Modified: xml/forrest/trunk/src/core/bin/forrest
==============================================================================
--- xml/forrest/trunk/src/core/bin/forrest (original)
+++ xml/forrest/trunk/src/core/bin/forrest Sat May 22 00:53:22 2004
@@ -40,7 +40,7 @@
# Save old ANT_HOME
OLD_ANT_HOME="$ANT_HOME"
unset ANT_HOME
-ANT_HOME="$FORREST_HOME/tools/ant"
+ANT_HOME="$FORREST_HOME/../../tools/ant"
# ----- Set Up The Runtime Classpath ------------------------------------------
@@ -59,7 +59,7 @@
export CP
unset CLASSPATH
-for i in $FORREST_HOME/lib/endorsed/*.jar; do
+for i in $FORREST_HOME/../../lib/endorsed/*.jar; do
if [ "$cygwin" = "true" ] ; then
LIB=`cygpath -w $i`
else
Modified: xml/forrest/trunk/src/core/bin/forrest.bat
==============================================================================
--- xml/forrest/trunk/src/core/bin/forrest.bat (original)
+++ xml/forrest/trunk/src/core/bin/forrest.bat Sat May 22 00:53:22 2004
@@ -28,12 +28,12 @@
rem ----- Save old ANT_HOME --------------------------------------------
set OLD_ANT_HOME=%ANT_HOME%
-set ANT_HOME=%FORREST_HOME%\tools\ant
+set ANT_HOME=%FORREST_HOME%\..\..\tools\ant
rem ----- Save and set CLASSPATH --------------------------------------------
set OLD_CLASSPATH=%CLASSPATH%
set CLASSPATH=
-for %%i in ("%FORREST_HOME%\lib\endorsed\*.jar") do call "%FORREST_HOME%\bin\appendcp.bat" "%%i"
+for %%i in ("%FORREST_HOME%\..\..\lib\endorsed\*.jar") do call "%FORREST_HOME%\bin\appendcp.bat" "%%i"
echo.
echo Apache Forrest. Run 'forrest -projecthelp' to list options
Modified: xml/forrest/trunk/src/core/context/WEB-INF/cocoon.xconf
==============================================================================
--- xml/forrest/trunk/src/core/context/WEB-INF/cocoon.xconf (original)
+++ xml/forrest/trunk/src/core/context/WEB-INF/cocoon.xconf Sat May 22 00:53:22 2004
@@ -167,27 +167,31 @@
<component-instance class="org.apache.cocoon.components.modules.input.DateMetaInputModule" logger="core.modules.input" name="datemeta"/>
<component-instance class="org.apache.cocoon.components.modules.input.JXPathMetaModule" logger="core.modules.input" name="jxpath"/>
<component-instance class="org.apache.cocoon.components.modules.input.SimpleMappingMetaModule" logger="core.modules.input" name="simplemap"/>
+
<component-instance logger="core.modules.input" name="forrest" class="org.apache.cocoon.components.modules.input.ChainMetaModule">
<input-module name="request-param"/>
<input-module name="request-attr"/>
<input-module name="session-attr"/>
<input-module name="defaults"/>
</component-instance>
- <component-instance name="defaults" class="org.apache.cocoon.components.modules.input.DefaultsMetaModule">
+
+ <component-instance name="defaults" class="org.apache.forrest.conf.ForrestConfModule">
<values>
- <skin>@skin@</skin>
- <menu-scheme>@menu-scheme@</menu-scheme>
- <bugtracking-url>@bugtracking-url@</bugtracking-url>
- <i18n>@i18n@</i18n>
+ <skin>@project.skin@</skin>
+ <menu-scheme>@project.menu-scheme@</menu-scheme>
+ <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>
- <component-instance name="project" class="org.apache.cocoon.components.modules.input.DefaultsMetaModule">
+ <component-instance name="project" class="org.apache.forrest.conf.ForrestConfModule">
<values>
- <skin>@skin@</skin>
+ <skin>@project.skin@</skin>
+ <status>@project.home@/@project.status@</status>
<!--FIXME: hard code values -->
<skinconf>@project.webapp@/skinconf.xml</skinconf>
<doc>@project.home@/@project.content-dir@/</doc>
@@ -208,7 +212,7 @@
class="org.apache.cocoon.components.modules.input.SimpleMappingMetaModule"
logger="core.modules.mapper" name="conf">
<input-module name="skinconf">
- <file src="skinconf.xml" reloadable="true" />
+ <file src="cocoon://skinconf.xml" reloadable="true" />
</input-module>
<prefix>/skinconfig/</prefix>
</component-instance>
@@ -284,9 +288,11 @@
| <parameter name="verbosity" value="2"/>
+-->
<entity-resolver logger="core.resolver">
- <parameter name="catalog" value="@forrest.home@/context/resources/schema/catalog.xcat"/>
- <parameter name="local-catalog" value="@local-catalog@"/>
- <parameter name="verbosity" value="@catalog-verbosity@"/>
+ <parameter name="catalog" value="resources/schema/catalog.xcat"/>
+ <!-- TODO disabled for now, as filtering no longer works -->
+ <!--<parameter name="local-catalog" value="@local-catalog@"/>-->
+ <!-- TODO fixed to 1 for now, as filtering no longer works -->
+ <parameter name="verbosity" value="1"/>
</entity-resolver>
<!--+
Modified: xml/forrest/trunk/src/core/context/dtd.xmap
==============================================================================
--- xml/forrest/trunk/src/core/context/dtd.xmap (original)
+++ xml/forrest/trunk/src/core/context/dtd.xmap Sat May 22 00:53:22 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/trunk/src/core/context/faq.xmap
==============================================================================
--- xml/forrest/trunk/src/core/context/faq.xmap (original)
+++ xml/forrest/trunk/src/core/context/faq.xmap Sat May 22 00:53:22 2004
@@ -91,21 +91,19 @@
<map:parameter name="notoc" value="{notoc}"/>
<!-- For backwards-compat with 0.2 - 0.4 skins -->
<map:parameter name="isfaq" value="{notoc}"/>
+ <map:parameter name="nopdf" value="{nopdf}"/>
<map:parameter name="path" value="{path}"/>
- <!-- Can set an alternative project skinconfig here
- <map:parameter name="config-file" value="../../../../skinconf.xml"/>
- -->
+ <map:parameter name="config-file" value="{project:skinconf}"/>
</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}"/>
+ <map:parameter name="nopdf" value="{nopdf}"/>
<map:parameter name="path" value="{path}"/>
- <!-- Can set an alternative project skinconfig here
- <map:parameter name="config-file" value="../../../../skinconf.xml"/>
- -->
+ <map:parameter name="config-file" value="{project:skinconf}"/>
</map:transform>
</map:otherwise>
</map:select>
@@ -135,7 +133,7 @@
</map:transform>
</map:when>
<map:otherwise>
- <map:transform src="{forrest:home}context/skins/{forrest:skin}/xslt/fo/document2fo.xsl">
+ <map:transform src="{forrest:context}/skins/{forrest:skin}/xslt/fo/document2fo.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/trunk/src/core/context/forrest.xmap
==============================================================================
--- xml/forrest/trunk/src/core/context/forrest.xmap (original)
+++ xml/forrest/trunk/src/core/context/forrest.xmap Sat May 22 00:53:22 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/trunk/src/core/context/resources.xmap
==============================================================================
--- xml/forrest/trunk/src/core/context/resources.xmap (original)
+++ xml/forrest/trunk/src/core/context/resources.xmap Sat May 22 00:53:22 2004
@@ -38,9 +38,7 @@
<map:serializer mime-type="image/png" name="svg2png" src="org.apache.cocoon.serialization.SVGSerializer" />
<map:serializer name="text" mime-type="text/plain" src="org.apache.cocoon.serialization.TextSerializer"/>
</map:serializers>
- <map:transformers default="xslt">
- <map:transformer name="skinconf" src="org.apache.forrest.skinconf.SkinconfTransformer"/>
- </map:transformers>
+ <map:transformers default="xslt"/>
<map:readers default="resource" />
<map:matchers default="wildcard" />
<map:selectors default="browser" />
@@ -66,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>
@@ -116,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}"/>
@@ -129,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}"/>
@@ -157,7 +155,7 @@
</map:resource>
<map:resource name="pipe-svg2png-corner-resource">
- <map:generate src="cocoon:/skin/skinconf.xml" />
+ <map:generate src="cocoon://skinconf.xml" />
<map:transform src="{path}">
<map:parameter name="orientation-tb"
value="{orientation-tb}"/>
@@ -177,7 +175,7 @@
</map:resource>
<map:resource name="generate-resource">
- <map:generate src="cocoon:/skin/skinconf.xml" />
+ <map:generate src="cocoon://skinconf.xml" />
<map:transform src="{path}"/>
</map:resource>
@@ -191,25 +189,25 @@
<map:pipelines>
- <map:pipeline internal-only="false">
- <map:match pattern="**skin/skinconf.xml">
- <map:generate src="{project:skinconf}" />
- <map:select type="exists">
- <map:when test="{project:skins-dir}{forrest:skin}/skinconf.xsl">
- <map:transform src="{project:skins-dir}{forrest:skin}/skinconf.xsl"/>
- </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>
- </map:select>
- <map:transform src="{forrest:home}context/skins/common/skinconf.xsl"/>
- <map:transform type="skinconf"/>
- <map:serialize type="xml" />
- </map:match>
- </map:pipeline>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<map:pipeline>
<map:match pattern="**skin/**.js">
<map:call resource="skin-read">
@@ -379,4 +377,4 @@
</map:match>
</map:pipeline>
</map:pipelines>
-</map:sitemap>
\ No newline at end of file
+</map:sitemap>
Modified: xml/forrest/trunk/src/core/context/sitemap.xmap
==============================================================================
--- xml/forrest/trunk/src/core/context/sitemap.xmap (original)
+++ xml/forrest/trunk/src/core/context/sitemap.xmap Sat May 22 00:53:22 2004
@@ -40,6 +40,9 @@
</map:generators>
<map:transformers default="xslt">
+ <!-- Add values to skinconf that need extra processing like the color shades -->
+ <map:transformer name="skinconf" src="org.apache.forrest.skinconf.SkinconfTransformer"/>
+
<!-- Generates @id attributes from <title> strings -->
<map:transformer name="idgen" src="org.apache.cocoon.transformation.IdGeneratorTransformer">
<element>//*[local-name() = 'section']</element>
@@ -194,7 +197,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}"/>
@@ -212,13 +215,26 @@
<!-- =========================== Pipelines ================================= -->
<map:pipelines>
- <map:pipeline internal-only="false">
-
+ <map:pipeline internal-only="false">
+ <map:match pattern="skinconf.xml">
+ <map:generate src="{project:skinconf}" />
+ <map:select type="exists">
+ <map:when test="{project:skins-dir}{forrest:skin}/skinconf.xsl">
+ <map:transform src="{project:skins-dir}{forrest:skin}/skinconf.xsl"/>
+ </map:when>
+ </map:select>
+ <map:select type="exists">
+ <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:context}/skins/common/skinconf.xsl"/>
+ <map:transform type="skinconf"/>
+ <map:serialize type="xml" />
+ </map:match>
+ </map:pipeline>
- <map:match pattern="**skinconf.xml">
- <map:mount uri-prefix="" src="resources.xmap" check-reload="yes" />
- </map:match>
-
+ <map:pipeline internal-only="false">
<!-- ============================================================ -->
<!-- SOURCE FORMATS -->
<!-- Raw XML sources, typically doc-v12 format -->
@@ -376,6 +392,7 @@
<map:match pattern="*.html">
<map:aggregate element="site">
+ <map:part src="cocoon:/skinconf.xml"/>
<map:part src="cocoon:/tab-{0}"/>
<map:part src="cocoon:/menu-{0}"/>
<map:part src="cocoon:/body-{0}"/>
@@ -388,6 +405,7 @@
<map:match pattern="**/*.html">
<map:aggregate element="site">
+ <map:part src="cocoon:/skinconf.xml"/>
<map:part src="cocoon:/{1}/tab-{2}.html"/>
<map:part src="cocoon:/{1}/menu-{2}.html"/>
<map:part src="cocoon:/{1}/body-{2}.html"/>
@@ -415,15 +433,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}"/>
@@ -445,14 +463,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/trunk/src/core/context/skins/avalon-tigris/xslt/html/site2xhtml.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/avalon-tigris/xslt/html/site2xhtml.xsl (original)
+++ xml/forrest/trunk/src/core/context/skins/avalon-tigris/xslt/html/site2xhtml.xsl Sat May 22 00:53:22 2004
@@ -46,10 +46,10 @@
<link type="text/css" href="{$root}skin/mysite.css" rel="stylesheet" />
<link type="text/css" href="{$root}skin/site.css" rel="stylesheet" />
<link type="text/css" href="{$root}skin/print.css" rel="stylesheet" media="print" />
- <xsl:if test="$config/favicon-url">
+ <xsl:if test="//skinconfig/favicon-url">
<link rel="shortcut icon">
<xsl:attribute name="href">
- <xsl:value-of select="concat($root,$config/favicon-url)"/>
+ <xsl:value-of select="concat($root,//skinconfig/favicon-url)"/>
</xsl:attribute>
</link>
</xsl:if>
@@ -67,13 +67,13 @@
<tbody>
<tr>
<xsl:comment>================= start Group Logo ==================</xsl:comment>
- <xsl:if test="$config/group-name">
+ <xsl:if test="//skinconfig/group-name">
<td align="left">
<div class="groupLogo">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/group-name"/>
- <xsl:with-param name="url" select="$config/group-url"/>
- <xsl:with-param name="logo" select="$config/group-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/group-name"/>
+ <xsl:with-param name="url" select="//skinconfig/group-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/group-logo"/>
<xsl:with-param name="root" select="$root"/>
</xsl:call-template>
</div>
@@ -84,9 +84,9 @@
<td align="right">
<div class="projectLogo">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/project-name"/>
- <xsl:with-param name="url" select="$config/project-url"/>
- <xsl:with-param name="logo" select="$config/project-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/project-name"/>
+ <xsl:with-param name="url" select="//skinconfig/project-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/project-logo"/>
<xsl:with-param name="root" select="$root"/>
</xsl:call-template>
</div>
@@ -105,13 +105,13 @@
<tr class="status">
<td>
<xsl:comment>================= start BreadCrumb ==================</xsl:comment>
- <a href="{$config/trail/link1/@href}"><xsl:value-of select="$config/trail/link1/@name" /></a>
- <xsl:if test = "($config/trail/link2/@name)and(normalize-space($config/trail/link2/@name)!='')"><xsl:text> | </xsl:text></xsl:if>
- <a href="{$config/trail/link2/@href}"><xsl:value-of select="$config/trail/link2/@name" /></a>
- <xsl:if test = "($config/trail/link3/@name)and(normalize-space($config/trail/link3/@name)!='')"><xsl:text> | </xsl:text></xsl:if>
- <a href="{$config/trail/link3/@href}"><xsl:value-of select="$config/trail/link3/@name" /></a>
+ <a href="{//skinconfig/trail/link1/@href}"><xsl:value-of select="//skinconfig/trail/link1/@name" /></a>
+ <xsl:if test = "(//skinconfig/trail/link2/@name)and(normalize-space(//skinconfig/trail/link2/@name)!='')"><xsl:text> | </xsl:text></xsl:if>
+ <a href="{//skinconfig/trail/link2/@href}"><xsl:value-of select="//skinconfig/trail/link2/@name" /></a>
+ <xsl:if test = "(//skinconfig/trail/link3/@name)and(normalize-space(//skinconfig/trail/link3/@name)!='')"><xsl:text> | </xsl:text></xsl:if>
+ <a href="{//skinconfig/trail/link3/@href}"><xsl:value-of select="//skinconfig/trail/link3/@name" /></a>
<!-- useful when we have <link> elements instead of link(n:=1..3)
- <xsl:for-each select="$config/trail/link">
+ <xsl:for-each select="//skinconfig/trail/link">
<xsl:if test="position()!=1">|</xsl:if>
<a href="{@href}"><xsl:value-of select="@name"/></a>
</xsl:for-each>
@@ -195,13 +195,13 @@
<tr>
<td align="left">
<xsl:comment>================= start Host ==================</xsl:comment>
- <xsl:if test="$config/host-logo and not($config/host-logo = '')">
+ <xsl:if test="//skinconfig/host-logo and not(//skinconfig/host-logo = '')">
<div align="left">
<div class="host">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/host-name"/>
- <xsl:with-param name="url" select="$config/host-url"/>
- <xsl:with-param name="logo" select="$config/host-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/host-name"/>
+ <xsl:with-param name="url" select="//skinconfig/host-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/host-logo"/>
<xsl:with-param name="root" select="$root"/>
</xsl:call-template>
</div>
@@ -215,8 +215,8 @@
<div class="credit">
<xsl:if test="$filename = 'index.html'">
<xsl:call-template name="compliancy-logos"/>
- <xsl:if test="$config/credits">
- <xsl:for-each select="$config/credits/credit[not(@role='pdf')]">
+ <xsl:if test="//skinconfig/credits">
+ <xsl:for-each select="//skinconfig/credits/credit[not(@role='pdf')]">
<xsl:call-template name="renderlogo">
<xsl:with-param name="name" select="name"/>
<xsl:with-param name="url" select="url"/>
Modified: xml/forrest/trunk/src/core/context/skins/common/xslt/html/document2html.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/common/xslt/html/document2html.xsl (original)
+++ xml/forrest/trunk/src/core/context/skins/common/xslt/html/document2html.xsl Sat May 22 00:53:22 2004
@@ -33,23 +33,6 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <!-- the skinconf file -->
- <xsl:param name="config-file" select="'../../../../skinconf.xml'"/>
- <xsl:variable name="config" select="document($config-file)/skinconfig"/>
-
- <!-- If true, a PDF link for this page will not be generated -->
- <xsl:variable name="disable-pdf-link" select="$config/disable-pdf-link"/>
- <!-- If true, a "print" link for this page will not be generated -->
- <xsl:variable name="disable-print-link" select="$config/disable-print-link"/>
- <!-- If true, an XML link for this page will not be generated -->
- <xsl:variable name="disable-xml-link" select="$config/disable-xml-link"/>
- <!-- Get the location where to generate the minitoc -->
- <xsl:variable name="minitoc-location" select="$config/toc/@location"/>
- <!-- Whether to obfuscate email links -->
- <xsl:variable name="obfuscate-mail-links" select="$config/obfuscate-mail-links"/>
- <!-- If true, an the images on all external links will not be added -->
- <xsl:variable name="disable-external-link-image" select="$config/disable-external-link-image"/>
-
<xsl:param name="dynamic-page" select="'false'"/>
<xsl:param name="notoc"/>
<xsl:param name="path"/>
@@ -64,14 +47,13 @@
</xsl:call-template>
</xsl:variable>
- <xsl:variable name="filename-noext">
- <xsl:call-template name="filename-noext">
- <xsl:with-param name="path" select="$path"/>
- </xsl:call-template>
- </xsl:variable>
-
<xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/>
+ <xsl:template match="/">
+ <xsl:apply-templates mode="toc"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
<xsl:template match="document">
<div class="content">
<table summary="" class="title">
@@ -83,9 +65,11 @@
</h1>
</xsl:if>
</td>
- <xsl:call-template name="printlink"/>
- <xsl:call-template name="pdflink"/>
- <xsl:call-template name="xmllink"/>
+ <div id="skinconf-printlink"/>
+ <xsl:if test="$dynamic-page='false'">
+ <div id="skinconf-pdflink"/>
+ <div id="skinconf-xmllink"/>
+ </xsl:if>
</tr>
</table>
<xsl:if test="normalize-space(header/subtitle)!=''">
@@ -107,68 +91,8 @@
</div>
</xsl:template>
- <!-- Generates the "printer friendly version" link -->
- <xsl:template name="printlink">
- <xsl:if test="$disable-print-link = 'false'">
-<script type="text/javascript" language="Javascript">
-function printit() {
-if (window.print) {
- window.print() ;
-} else {
- var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
-document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
- WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
-}
-}
-</script>
-
-<script type="text/javascript" language="Javascript">
-var NS = (navigator.appName == "Netscape");
-var VERSION = parseInt(navigator.appVersion);
-if (VERSION > 3) {
- document.write('<td align="center" width="40" nowrap="nowrap">');
- document.write(' <a href="javascript:printit()" class="dida">');
- document.write(' <img class="skin" src="{$skin-img-dir}/printer.gif" alt="Print this Page"/><br />');
- document.write(' print</a>');
- document.write('</td>');
-}
-</script>
-
- </xsl:if>
- </xsl:template>
-
- <!-- Generates the PDF link -->
- <xsl:template name="pdflink">
- <xsl:if test="$dynamic-page='false'">
- <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'">
- <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pdf" class="dida">
- <img class="skin" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/><br/>
- PDF</a>
- </td>
- </xsl:if>
- </xsl:if>
- </xsl:template>
-
-
- <!-- Generates the XML link -->
- <xsl:template name="xmllink">
- <xsl:if test="$dynamic-page='false'">
- <xsl:if test="$disable-xml-link = 'false'">
- <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.xml" class="dida">
- <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/><br/>
- xml</a>
- </td>
- </xsl:if>
- </xsl:if>
- </xsl:template>
-
<xsl:template match="body">
- <xsl:if test="$config/toc">
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth">1</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
+ <div id="skinconf-toc-page"/>
<xsl:apply-templates/>
</xsl:template>
@@ -238,25 +162,9 @@
<xsl:template match="link">
<xsl:apply-templates select="@id"/>
- <xsl:choose>
- <xsl:when test="$obfuscate-mail-links='true' and starts-with(@href, 'mailto:') and contains(@href, '@')">
- <xsl:variable name="mailto-1" select="substring-before(@href,'@')"/>
- <xsl:variable name="mailto-2" select="substring-after(@href,'@')"/>
- <a href="{$mailto-1}.at.{$mailto-2}">
- <xsl:apply-templates/>
- </a>
- </xsl:when>
- <xsl:when test="not($disable-external-link-image='true') and contains(@href, ':') and not(contains(@href, $config/group-url)) and not(contains(@href, $config/project-url))">
- <a href="{@href}" class="external">
- <xsl:apply-templates/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <a href="{@href}">
- <xsl:apply-templates/>
- </a>
- </xsl:otherwise>
- </xsl:choose>
+ <a href="{@href}">
+ <xsl:apply-templates/>
+ </a>
</xsl:template>
<xsl:template match="jump">
@@ -347,41 +255,6 @@
</xsl:attribute>
</xsl:template>
- <xsl:template name="minitoc">
- <xsl:param name="tocroot"/>
- <xsl:param name="depth"/>
- <xsl:if test="count($tocroot/section) >= $config/toc/@min-sections">
- <ul class="minitoc">
- <xsl:for-each select="$tocroot/section">
- <li>
- <xsl:call-template name="toclink"/>
- <xsl:if test="$depth<$config/toc/@max-depth">
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth" select="$depth + 1"/>
- </xsl:call-template>
- </xsl:if>
- </li>
- </xsl:for-each>
- </ul>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="toclink">
- <xsl:variable name="tocitem" select="normalize-space(title)"/>
- <xsl:if test="string-length($tocitem)>0">
- <a>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text>
- <xsl:if test="@id">
- <xsl:value-of select="@id"/>
- </xsl:if>
- </xsl:attribute>
- <xsl:value-of select="$tocitem"/>
- </a>
- </xsl:if>
- </xsl:template>
-
<xsl:template match="header/authors">
<xsl:for-each select="person">
<xsl:choose>
@@ -441,21 +314,58 @@
<xsl:template name="email">
<a>
- <xsl:attribute name="href">
- <xsl:choose>
- <xsl:when test="$obfuscate-mail-links='true'">
- <xsl:variable name="user" select="substring-before(@email,'@')"/>
- <xsl:variable name="host" select="substring-after(@email,'@')"/>
- <xsl:value-of select="concat('mailto:',$user,'.at.',$host)"/>
- </xsl:when>
- <xsl:otherwise>
+ <xsl:attribute name="href">
<xsl:value-of select="concat('mailto:',@email)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
+ </xsl:attribute>
<xsl:value-of select="@name"/>
</a>
</xsl:template>
+
+ <xsl:template name="generate-id">
+ <xsl:choose>
+ <xsl:when test="@id">
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ <xsl:when test="@title">
+ <xsl:value-of select="@title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="generate-id(.)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+
+ <xsl:template match="document" mode="toc">
+ <xsl:apply-templates mode="toc"/>
+ </xsl:template>
+
+ <xsl:template match="body" mode="toc">
+ <tocitems>
+ <xsl:apply-templates select="section" mode="toc">
+ <xsl:with-param name="level" select="1"/>
+ </xsl:apply-templates>
+ </tocitems>
+ </xsl:template>
+
+ <xsl:template match="section" mode="toc">
+ <xsl:param name="level"/>
+
+ <tocitem level="{$level}">
+ <xsl:attribute name="href">#<xsl:call-template name="generate-id"/></xsl:attribute>
+ <xsl:attribute name="title"><xsl:value-of select="title"/></xsl:attribute>
+ <xsl:apply-templates mode="toc">
+ <xsl:with-param name="level" select="$level+1"/>
+ </xsl:apply-templates>
+ </tocitem>
+ </xsl:template>
+
+ <xsl:template match="node()|@*" mode="toc"/>
+
+ <!-- End of "toc" mode templates -->
<xsl:template match="node()|@*" priority="-1">
<xsl:copy>
Modified: xml/forrest/trunk/src/core/context/skins/common/xslt/html/site2xhtml.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/common/xslt/html/site2xhtml.xsl (original)
+++ xml/forrest/trunk/src/core/context/skins/common/xslt/html/site2xhtml.xsl Sat May 22 00:53:22 2004
@@ -36,9 +36,16 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <!-- Default skinconf.xml in the skins/ directory -->
- <xsl:param name="config-file" select="'../../../../skinconf.xml'"/>
- <xsl:variable name="config" select="document($config-file)/skinconfig"/>
+ <xsl:variable name="config" select="//skinconfig"/>
+ <!-- If true, a PDF link for this page will not be generated -->
+ <xsl:variable name="disable-pdf-link" select="//skinconfig/disable-pdf-link"/>
+ <!-- If true, a "print" link for this page will not be generated -->
+ <xsl:variable name="disable-print-link" select="//skinconfig/disable-print-link"/>
+ <!-- If true, an XML link for this page will not be generated -->
+ <xsl:variable name="disable-xml-link" select="//skinconfig/disable-xml-link"/>
+ <!-- Get the location where to generate the minitoc -->
+ <xsl:variable name="minitoc-location" select="//skinconfig/toc/@location"/>
+
<xsl:param name="path"/>
<xsl:include href="dotdots.xsl"/>
@@ -62,13 +69,20 @@
<!-- Path of Lucene search results page (relative to $root) -->
<xsl:param name="lucene-search" select="'lucene-search.html'"/>
+
+
+
+
+
+
+
<xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/>
<xsl:variable name="spacer" select="concat($root, 'skin/images/spacer.gif')"/>
<xsl:template name="breadcrumbs">
- <xsl:if test="($config/trail/link1/@name)and($config/trail/link1/@name!='')"><a href="{$config/trail/link1/@href}"><xsl:value-of select="$config/trail/link1/@name"/></a></xsl:if>
- <xsl:if test="($config/trail/link2/@name)and($config/trail/link2/@name!='')"> > <a href="{$config/trail/link2/@href}"> <xsl:value-of select="$config/trail/link2/@name"/></a> </xsl:if>
- <xsl:if test="($config/trail/link3/@name)and($config/trail/link3/@name!='')"> > <a href="{$config/trail/link3/@href}"> <xsl:value-of select="$config/trail/link3/@name"/></a> </xsl:if>
+ <xsl:if test="(//skinconfig/trail/link1/@name)and(//skinconfig/trail/link1/@name!='')"><a href="{//skinconfig/trail/link1/@href}"><xsl:value-of select="//skinconfig/trail/link1/@name"/></a></xsl:if>
+ <xsl:if test="(//skinconfig/trail/link2/@name)and(//skinconfig/trail/link2/@name!='')"> > <a href="{//skinconfig/trail/link2/@href}"> <xsl:value-of select="//skinconfig/trail/link2/@name"/></a> </xsl:if>
+ <xsl:if test="(//skinconfig/trail/link3/@name)and(//skinconfig/trail/link3/@name!='')"> > <a href="{//skinconfig/trail/link3/@href}"> <xsl:value-of select="//skinconfig/trail/link3/@name"/></a> </xsl:if>
<script type="text/javascript" language="JavaScript" src="{$root}skin/breadcrumbs.js"/>
</xsl:template>
@@ -76,30 +90,30 @@
<html>
<head>
<title><xsl:value-of select="div[@class='content']/table/tr/td/h1"/></title>
- <xsl:if test="$config/favicon-url">
+ <xsl:if test="//skinconfig/favicon-url">
<link rel="shortcut icon">
<xsl:attribute name="href">
- <xsl:value-of select="concat($root,$config/favicon-url)"/>
+ <xsl:value-of select="concat($root,//skinconfig/favicon-url)"/>
</xsl:attribute>
</link>
</xsl:if>
</head>
<body>
- <xsl:if test="$config/group-url">
+ <xsl:if test="//skinconfig/group-url">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/group-name"/>
- <xsl:with-param name="url" select="$config/group-url"/>
- <xsl:with-param name="logo" select="$config/group-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/group-name"/>
+ <xsl:with-param name="url" select="//skinconfig/group-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/group-logo"/>
<xsl:with-param name="root" select="$root"/>
- <xsl:with-param name="description" select="$config/group-description"/>
+ <xsl:with-param name="description" select="//skinconfig/group-description"/>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/project-name"/>
- <xsl:with-param name="url" select="$config/project-url"/>
- <xsl:with-param name="logo" select="$config/project-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/project-name"/>
+ <xsl:with-param name="url" select="//skinconfig/project-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/project-logo"/>
<xsl:with-param name="root" select="$root"/>
- <xsl:with-param name="description" select="$config/project-description"/>
+ <xsl:with-param name="description" select="//skinconfig/project-description"/>
</xsl:call-template>
<xsl:comment>================= start Tabs ==================</xsl:comment>
<xsl:apply-templates select="div[@class='tab']"/>
@@ -131,18 +145,18 @@
<script language="JavaScript" type="text/javascript"><![CDATA[<!--
document.write(" - "+"Last Published: " + document.lastModified);
// -->]]></script>
- <xsl:if test="$config/host-logo and not($config/host-logo = '')">
- <a href="{$config/host-url}">
+ <xsl:if test="//skinconfig/host-logo and not(//skinconfig/host-logo = '')">
+ <a href="{//skinconfig/host-url}">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/host-name"/>
- <xsl:with-param name="url" select="$config/host-url"/>
- <xsl:with-param name="logo" select="$config/host-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/host-name"/>
+ <xsl:with-param name="url" select="//skinconfig/host-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/host-logo"/>
<xsl:with-param name="root" select="$root"/>
</xsl:call-template>
</a>
</xsl:if>
- <xsl:if test="$filename = 'index.html' and $config/credits">
- <xsl:for-each select="$config/credits/credit[not(@role='pdf')]">
+ <xsl:if test="$filename = 'index.html' and //skinconfig/credits">
+ <xsl:for-each select="//skinconfig/credits/credit[not(@role='pdf')]">
<xsl:call-template name="renderlogo">
<xsl:with-param name="name" select="name"/>
<xsl:with-param name="url" select="url"/>
@@ -162,7 +176,7 @@
<!-- Add links to any standards-compliance logos -->
<xsl:template name="compliancy-logos">
- <xsl:if test="$config/disable-compliance-links = 'false'">
+ <xsl:if test="//skinconfig/disable-compliance-links = 'false'">
<a href="http://validator.w3.org/check/referer"><img class="logoImage"
src="{$skin-img-dir}/valid-html401.png"
alt="Valid HTML 4.01!" height="31" width="88" border="0"/></a>
@@ -173,6 +187,110 @@
</xsl:if>
</xsl:template>
+ <!-- Generates the PDF link -->
+ <xsl:template match="div[@id='skinconf-pdflink']">
+ <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'">
+ <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pdf" class="dida">
+ <img class="skin" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/><br/>
+ PDF</a>
+ </td>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Generates the XML link -->
+ <xsl:template match="div[@id='skinconf-xmllink']">
+ <xsl:if test="$disable-xml-link = 'false'">
+ <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.xml" class="dida">
+ <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/><br/>
+ xml</a>
+ </td>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Generates the "printer friendly version" link -->
+ <xsl:template match="div[@id='skinconf-printlink']">
+ <xsl:if test="$disable-print-link = 'false'">
+<script type="text/javascript" language="Javascript">
+function printit() {
+if (window.print) {
+ window.print() ;
+} else {
+ var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
+document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
+ WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
+}
+}
+</script>
+
+<script type="text/javascript" language="Javascript">
+var NS = (navigator.appName == "Netscape");
+var VERSION = parseInt(navigator.appVersion);
+if (VERSION > 3) {
+ document.write('<td align="center" width="40" nowrap="nowrap">');
+ document.write(' <a href="javascript:printit()" class="dida">');
+ document.write(' <img class="skin" src="{$skin-img-dir}/printer.gif" alt="Print this Page"/><br />');
+ document.write(' print</a>');
+ document.write('</td>');
+}
+</script>
+
+ </xsl:if>
+ </xsl:template>
+
+ <!-- handle all obfuscating mail links and disabling external link images -->
+ <xsl:template match="a">
+ <xsl:choose>
+ <xsl:when test="$obfuscate-mail-links='true' and starts-with(@href, 'mailto:') and contains(@href, '@')">
+ <xsl:variable name="mailto-1" select="substring-before(@href,'@')"/>
+ <xsl:variable name="mailto-2" select="substring-after(@href,'@')"/>
+ <a href="{$mailto-1}.at.{$mailto-2}">
+ <xsl:apply-templates/>
+ </a>
+ </xsl:when>
+ <xsl:when test="not($disable-external-link-image='true') and contains(@href, ':') and not(contains(@href, //skinconfig/group-url)) and not(contains(@href, //skinconfig/project-url))">
+ <a href="{@href}" class="external">
+ <xsl:apply-templates/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- xsl:copy-of makes sure we copy <a href> as well as <a name>
+ or any other <a ...> forms -->
+ <xsl:copy-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="div[@id='skinconf-toc-page']">
+ <xsl:if test="$config/toc">
+ <xsl:if test="contains($minitoc-location,'page')">
+ <xsl:if test="count(//tocitems/tocitem) >= $config/toc/@min-sections">
+ <xsl:call-template name="minitoc">
+ <xsl:with-param name="tocroot" select="//tocitems"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="minitoc">
+ <xsl:param name="tocroot"/>
+ <xsl:if test="count($tocroot/tocitem) >= $config/toc/@min-sections">
+ <ul class="minitoc">
+ <xsl:for-each select="$tocroot/tocitem">
+ <li>
+ <a href="{@href}">
+ <xsl:value-of select="@title"/>
+ </a>
+ <xsl:if test="@level<//skinconfig/toc/@max-depth+1">
+ <xsl:call-template name="minitoc">
+ <xsl:with-param name="tocroot" select="."/>
+ </xsl:call-template>
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </xsl:if>
+ </xsl:template>
<xsl:template match="node()|@*" priority="-1">
<xsl:copy>
Modified: xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/document2html.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/document2html.xsl (original)
+++ xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/document2html.xsl Sat May 22 00:53:22 2004
@@ -34,7 +34,7 @@
<xsl:template match="document">
<div class="content">
- <xsl:call-template name="pdflink"/>
+ <div id="skinconf-pdflink"/>
<xsl:if test="normalize-space(header/title)!=''">
<h1><xsl:value-of select="header/title"/></h1>
</xsl:if>
@@ -63,59 +63,10 @@
</xsl:template>
<xsl:template match="body">
- <xsl:if test="$config/toc/@max-depth>0 and not($notoc='true')" >
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth">1</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
+ <div id="skinconf-toc-page"/>
<xsl:apply-templates/>
</xsl:template>
- <xsl:template name="toclink">
- <xsl:variable name="tocitem" select="normalize-space(title)"/>
- <xsl:if test="string-length($tocitem)>0">
- <li>
- <a>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
- </xsl:attribute>
- <xsl:value-of select="$tocitem"/>
- </a>
- </li>
- </xsl:if>
- </xsl:template>
-
-
-
- <xsl:template name="minitoc">
- <xsl:param name="tocroot"/>
- <xsl:param name="depth"/>
- <ul>
- <xsl:for-each select="$tocroot/section">
- <xsl:call-template name="toclink"/>
- <xsl:if test="$depth<$config/toc/@max-depth">
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth" select="$depth + 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </ul>
- </xsl:template>
-
-
- <xsl:template name="generate-id">
- <xsl:choose>
- <xsl:when test="@id">
- <xsl:value-of select="@id"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="generate-id(.)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
<xsl:template match="@id">
<xsl:apply-imports/>
</xsl:template>
@@ -219,11 +170,4 @@
<!-- do not show title elements, they are already in other places-->
</xsl:template>
- <!-- Generates the PDF link -->
- <xsl:template name="pdflink">
- <a href="{$filename-noext}.pdf" id="printable"><img src="{$skin-img-dir}/pdfdoc.gif"
- alt="PDF"/>PDF version</a>
- </xsl:template>
-
-
</xsl:stylesheet>
Modified: xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl (original)
+++ xml/forrest/trunk/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl Sat May 22 00:53:22 2004
@@ -50,10 +50,10 @@
<title><xsl:value-of select="div[@class='content']/h1"/></title>
<link rel="stylesheet" href="{$root}skin/page.css" type="text/css"/>
<link rel="alternate stylesheet" title="Krysalis" href="{$root}skin/krysalis.css" type="text/css"/>
- <xsl:if test="$config/favicon-url">
+ <xsl:if test="//skinconfig/favicon-url">
<link rel="shortcut icon">
<xsl:attribute name="href">
- <xsl:value-of select="concat($root,$config/favicon-url)"/>
+ <xsl:value-of select="concat($root,//skinconfig/favicon-url)"/>
</xsl:attribute>
</link>
</xsl:if>
@@ -66,11 +66,11 @@
<!-- ================= start Banner ================== -->
<div id="mainheader">
<!-- ================= start Group Logo ================== -->
- <xsl:if test="$config/group-url">
+ <xsl:if test="//skinconfig/group-url">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/group-name"/>
- <xsl:with-param name="url" select="$config/group-url"/>
- <xsl:with-param name="logo" select="$config/group-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/group-name"/>
+ <xsl:with-param name="url" select="//skinconfig/group-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/group-logo"/>
<xsl:with-param name="root" select="$root"/>
<xsl:with-param name="imgid">grouplogo</xsl:with-param>
<xsl:with-param name="linkid">grouplogolink</xsl:with-param>
@@ -113,11 +113,11 @@
<!-- ================= end Search ================== -->
<span class="textonly"> - </span>
<!-- ================= start Project Logo ================== -->
- <xsl:if test="$config/project-url">
+ <xsl:if test="//skinconfig/project-url">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/project-name"/>
- <xsl:with-param name="url" select="$config/project-url"/>
- <xsl:with-param name="logo" select="$config/project-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/project-name"/>
+ <xsl:with-param name="url" select="//skinconfig/project-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/project-logo"/>
<xsl:with-param name="root" select="$root"/>
<xsl:with-param name="imgid">projectlogo</xsl:with-param>
<xsl:with-param name="linkid">projectlogolink</xsl:with-param>
@@ -181,13 +181,13 @@
</span>
<br class="textonly"/>
- <xsl:if test="$config/host-logo and not($config/host-logo = '')">
+ <xsl:if test="//skinconfig/host-logo and not(//skinconfig/host-logo = '')">
<div class="host">
<img src="{$root}skin/images/spacer.gif" width="10" height="1" alt=""/>
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/host-name"/>
- <xsl:with-param name="url" select="$config/host-url"/>
- <xsl:with-param name="logo" select="$config/host-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/host-name"/>
+ <xsl:with-param name="url" select="//skinconfig/host-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/host-logo"/>
<xsl:with-param name="root" select="$root"/>
</xsl:call-template>
</div>
@@ -195,8 +195,8 @@
<span id="validation">
<xsl:call-template name="compliancy-logos"/>
- <xsl:if test="$filename = 'index.html' and $config/credits">
- <xsl:for-each select="$config/credits/credit[not(@role='pdf')]">
+ <xsl:if test="$filename = 'index.html' and //skinconfig/credits">
+ <xsl:for-each select="//skinconfig/credits/credit[not(@role='pdf')]">
<xsl:variable name="name" select="name"/>
<xsl:variable name="url" select="url"/>
<xsl:variable name="image" select="image"/>
@@ -287,12 +287,10 @@
</a>
</xsl:template>
- <xsl:template match="node()|@*" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
+ <!-- Generates the PDF link -->
+ <xsl:template match="div[@id='skinconf-pdflink']">
+ <a href="{$filename-noext}.pdf" id="printable"><img src="{$skin-img-dir}/pdfdoc.gif"
+ alt="PDF"/>PDF version</a>
</xsl:template>
-
-
+
</xsl:stylesheet>
Modified: xml/forrest/trunk/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl (original)
+++ xml/forrest/trunk/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl Sat May 22 00:53:22 2004
@@ -47,10 +47,10 @@
<head>
<title><xsl:value-of select="div[@class='content']/table/tr/td/h1"/></title>
<link rel="stylesheet" href="{$root}skin/page.css" type="text/css"/>
- <xsl:if test="$config/favicon-url">
+ <xsl:if test="//skinconfig/favicon-url">
<link rel="shortcut icon">
<xsl:attribute name="href">
- <xsl:value-of select="concat($root,$config/favicon-url)"/>
+ <xsl:value-of select="concat($root,//skinconfig/favicon-url)"/>
</xsl:attribute>
</link>
</xsl:if>
@@ -81,13 +81,13 @@
<xsl:comment>================= start Group Logo ==================</xsl:comment>
<td bgcolor="{$header-color}">
- <xsl:if test="$config/group-url">
+ <xsl:if test="//skinconfig/group-url">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/group-name"/>
- <xsl:with-param name="url" select="$config/group-url"/>
- <xsl:with-param name="logo" select="$config/group-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/group-name"/>
+ <xsl:with-param name="url" select="//skinconfig/group-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/group-logo"/>
<xsl:with-param name="root" select="$root"/>
- <xsl:with-param name="description" select="$config/group-description"/>
+ <xsl:with-param name="description" select="//skinconfig/group-description"/>
</xsl:call-template>
</xsl:if>
</td>
@@ -95,11 +95,11 @@
<xsl:comment>================= start Project Logo ==================</xsl:comment>
<td bgcolor="{$header-color}" align="center" width="100%">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/project-name"/>
- <xsl:with-param name="url" select="$config/project-url"/>
- <xsl:with-param name="logo" select="$config/project-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/project-name"/>
+ <xsl:with-param name="url" select="//skinconfig/project-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/project-logo"/>
<xsl:with-param name="root" select="$root"/>
- <xsl:with-param name="description" select="$config/project-description"/>
+ <xsl:with-param name="description" select="//skinconfig/project-description"/>
</xsl:call-template>
</td>
<xsl:comment>================= end Project Logo ==================</xsl:comment>
@@ -185,7 +185,7 @@
</td>
<td bgcolor="{$header-color}"></td>
</tr>
- <tr height="16">
+ <tr>
<td colspan="4" bgcolor="{$menu-border}" height="10" ><xsl:apply-templates select="div[@class='level2tab']"/></td>
</tr>
</table>
@@ -289,9 +289,9 @@
<!-- W3C logos -->
<xsl:call-template name="compliancy-logos"/>
- <xsl:if test="$config/credits">
+ <xsl:if test="//skinconfig/credits">
<img src="{$root}skin/images/spacer.gif" width="10" height="1" alt=""/>
- <xsl:for-each select="$config/credits/credit[not(@role='pdf')]">
+ <xsl:for-each select="//skinconfig/credits/credit[not(@role='pdf')]">
<xsl:variable name="name" select="name"/>
<xsl:variable name="url" select="url"/>
<xsl:variable name="image" select="image"/>
@@ -312,13 +312,13 @@
</xsl:if>
</div>
</xsl:if>
- <xsl:if test="$config/host-logo and not($config/host-logo = '')">
+ <xsl:if test="//skinconfig/host-logo and not(//skinconfig/host-logo = '')">
<div class="host">
<img src="{$root}skin/images/spacer.gif" width="10" height="1" alt=""/>
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/host-name"/>
- <xsl:with-param name="url" select="$config/host-url"/>
- <xsl:with-param name="logo" select="$config/host-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/host-name"/>
+ <xsl:with-param name="url" select="//skinconfig/host-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/host-logo"/>
<xsl:with-param name="root" select="$root"/>
</xsl:call-template>
</div>
@@ -373,13 +373,6 @@
<td bgcolor="{$header-color}" height="1"><img class="spacer" src="{$spacer}" alt="" height="1" width="1" /></td>
</tr>
</table>
- </xsl:template>
-
- <xsl:template match="node()|@*" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
</xsl:template>
</xsl:stylesheet>
Modified: xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/document2html.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/document2html.xsl (original)
+++ xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/document2html.xsl Sat May 22 00:53:22 2004
@@ -46,7 +46,7 @@
<xsl:call-template name="printerfriendlylink"/>
<xsl:call-template name="xmllink"/>
-->
- <xsl:call-template name="pdflink"/>
+ <div id="skinconf-pdflink"/>
</tr>
</table>
</xsl:if>
@@ -76,56 +76,10 @@
</xsl:template>
<xsl:template match="body">
-
- <xsl:if test="section and $config/toc/@max-depth>0 and not($notoc='true') and contains($minitoc-location,'menu')">
- <toc>
- <xsl:for-each select="section">
- <tocc>
- <toca>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
- </xsl:attribute>
- <xsl:value-of select="title"/>
- </toca>
- <xsl:if test="section">
- <toc2>
- <xsl:for-each select="section">
- <tocc>
- <toca>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
- </xsl:attribute>
- <xsl:value-of select="title"/>
- </toca>
- </tocc>
- </xsl:for-each>
- </toc2>
- </xsl:if>
- </tocc>
- </xsl:for-each>
- </toc>
- </xsl:if>
-
- <xsl:if test="$config/toc/@max-depth>0 and not($notoc='true') and contains($minitoc-location,'page')" >
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth">1</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
+ <div id="skinconf-toc-page"/>
<xsl:apply-templates/>
</xsl:template>
- <xsl:template name="generate-id">
- <xsl:choose>
- <xsl:when test="@id">
- <xsl:value-of select="@id"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="generate-id(.)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
<xsl:template match="@id">
<xsl:apply-imports/>
</xsl:template>
@@ -138,110 +92,16 @@
<xsl:choose>
<xsl:when test="$level=1">
- <xsl:choose>
- <xsl:when test="$config/headings/@type='underlined'">
-
- <table class="h3" cellpadding="0" cellspacing="0" border="0" width="100%">
- <tbody>
- <tr>
- <td width="9" height="10"></td>
- <td><h3><xsl:value-of select="title"/></h3></td>
- <td></td>
- </tr>
- <tr class="heading ">
- <td class="bottom-left"></td>
- <td class="bottomborder"></td>
- <td class="bottom-right"></td>
- </tr>
-
- </tbody>
- </table>
-
- </xsl:when>
- <xsl:when test="$config/headings/@type='boxed'">
-
- <table class="h3 heading" cellpadding="0" cellspacing="0" border="0" width="100%">
- <tbody>
- <tr>
- <td class="top-left"></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td><h3><xsl:value-of select="title"/></h3></td>
- <td></td>
- </tr>
- <tr>
- <td class=" bottom-left"></td>
- <td></td>
- <td></td>
- </tr>
-
- </tbody>
- </table>
-
- </xsl:when>
- <xsl:otherwise>
- <h3 class="h3"><xsl:value-of select="title"/></h3>
- </xsl:otherwise>
- </xsl:choose>
-
- <div class="section"><xsl:apply-templates/></div>
-
+ <div class="skinconf-heading-{$level}">
+ <h1><xsl:value-of select="title"/></h1>
+ </div>
+ <div class="section"><xsl:apply-templates/></div>
</xsl:when>
<xsl:when test="$level=2">
- <xsl:choose>
- <xsl:when test="$config/headings/@type='underlined'">
-
- <table class="h4" cellpadding="0" cellspacing="0" border="0" width="100%">
- <tbody>
- <tr>
- <td width="9" height="10"></td>
- <td><h4><xsl:value-of select="title"/></h4></td>
- <td></td>
- </tr>
- <tr class="subheading">
- <td class="bottom-left"></td>
- <td></td>
- <td class="bottom-right"></td>
- </tr>
-
- </tbody>
- </table>
-
- </xsl:when>
- <xsl:when test="$config/headings/@type='boxed'">
-
- <table class="h4 subheading" cellpadding="0" cellspacing="0" border="0" width="100%">
- <tbody>
- <tr>
- <td class="top-left"></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td><h4><xsl:value-of select="title"/></h4></td>
- <td></td>
- </tr>
- <tr>
- <td class=" bottom-left"></td>
- <td></td>
- <td></td>
- </tr>
-
- </tbody>
- </table>
-
- </xsl:when>
- <xsl:otherwise>
- <h4 class="h4"><xsl:value-of select="title"/></h4>
- </xsl:otherwise>
- </xsl:choose>
-
+ <div class="skinconf-heading-{$level}">
+ <h1><xsl:value-of select="title"/></h1>
+ </div>
<xsl:apply-templates select="*[not(self::title)]"/>
-
</xsl:when>
<!-- If a faq, answer sections will be level 3 (1=Q/A, 2=part) -->
<xsl:when test="$level=3 and $notoc='true'">
Modified: xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl (original)
+++ xml/forrest/trunk/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl Sat May 22 00:53:22 2004
@@ -44,10 +44,10 @@
<title><xsl:value-of select="div[@class='content']/table/tr/td/h1"/></title>
<link rel="stylesheet" href="{$root}skin/page.css" type="text/css"/>
<link rel="stylesheet" href="{$root}skin/forrest.css" type="text/css"/>
- <xsl:if test="$config/favicon-url">
+ <xsl:if test="//skinconfig/favicon-url">
<link rel="shortcut icon">
<xsl:attribute name="href">
- <xsl:value-of select="concat($root,$config/favicon-url)"/>
+ <xsl:value-of select="concat($root,//skinconfig/favicon-url)"/>
</xsl:attribute>
</link>
</xsl:if>
@@ -98,9 +98,9 @@
<td >
<div class="headerlogo">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/group-name"/>
- <xsl:with-param name="url" select="$config/group-url"/>
- <xsl:with-param name="logo" select="$config/group-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/group-name"/>
+ <xsl:with-param name="url" select="//skinconfig/group-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/group-logo"/>
<xsl:with-param name="root" select="$root"/>
</xsl:call-template>
</div>
@@ -109,9 +109,9 @@
<td align="center" >
<div class="headerlogo">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/project-name"/>
- <xsl:with-param name="url" select="$config/project-url"/>
- <xsl:with-param name="logo" select="$config/project-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/project-name"/>
+ <xsl:with-param name="url" select="//skinconfig/project-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/project-logo"/>
<xsl:with-param name="root" select="$root"/>
</xsl:call-template>
</div>
@@ -198,7 +198,7 @@
</td>
<td align="right" width="10" height="10">
- <span class="textheader"><xsl:value-of select="$config/project-name"/></span>
+ <span class="textheader"><xsl:value-of select="//skinconfig/project-name"/></span>
</td>
</tr>
<!-- ( ================= Tabs ================== ) -->
@@ -293,9 +293,9 @@
<td height="10" colspan="2"></td>
</tr>
- <xsl:if test="not($config/disable-search) or
- $config/disable-search='alt' and $config/searchsite-domain and
- $config/searchsite-name">
+ <xsl:if test="not(//skinconfig/disable-search) or
+ //skinconfig/disable-search='alt' and //skinconfig/searchsite-domain and
+ //skinconfig/searchsite-name">
<tr>
<td ></td>
<td class="search">
@@ -316,8 +316,8 @@
<tr>
<td></td>
<td>
- <input type="hidden" name="sitesearch" value="{$config/searchsite-domain}"/>
- the <xsl:value-of select="$config/searchsite-name"/> site
+ <input type="hidden" name="sitesearch" value="{//skinconfig/searchsite-domain}"/>
+ the <xsl:value-of select="//skinconfig/searchsite-name"/> site
<br />
<input type="text" id="query" name="q" size="13"/><input type="submit" value="Go" name="Search"/>
</td>
@@ -339,7 +339,7 @@
</tr>
</xsl:if>
- <xsl:if test="$filename = 'index.html' and $config/credits">
+ <xsl:if test="$filename = 'index.html' and //skinconfig/credits">
<tr>
<td></td>
<td class="search">
@@ -354,7 +354,7 @@
<tr>
<td colspan="3" height="8"></td>
</tr>
- <xsl:for-each select="$config/credits/credit[not(@role='pdf')]">
+ <xsl:for-each select="//skinconfig/credits/credit[not(@role='pdf')]">
<xsl:variable name="name" select="name"/>
<xsl:variable name="url" select="url"/>
<xsl:variable name="image" select="image"/>
@@ -422,30 +422,30 @@
<xsl:when test="span/@class='sel'">
<div class="menupage">
<div class="menupagetitle"><xsl:value-of select="span" /></div>
- <xsl:if test="//toc/tocc">
+ <xsl:if test="//tocitems/tocitem">
<div class="menupageitemgroup">
- <xsl:for-each select = "//toc/tocc">
+ <xsl:for-each select = "//tocitems/tocitem">
<div class="menupageitem">
<xsl:choose>
- <xsl:when test="string-length(toca)>15">
- <a href="{toca/@href}" title="{toca}"><xsl:value-of select="substring(toca,0,20)" />...</a>
+ <xsl:when test="string-length(@title)>15">
+ <a href="{@href}" title="{@title}"><xsl:value-of select="substring(@title,0,20)" />...</a>
</xsl:when>
<xsl:otherwise>
- <a href="{toca/@href}"><xsl:value-of select="toca" /></a>
+ <a href="{@href}"><xsl:value-of select="@title" /></a>
</xsl:otherwise>
</xsl:choose>
- <xsl:if test="toc2/tocc">
+ <xsl:if test="tocitem">
<!-- nicolaken: this enables double-nested page links-->
<ul>
- <xsl:for-each select = "toc2/tocc">
+ <xsl:for-each select = "tocitem">
<xsl:choose>
- <xsl:when test="string-length(toca)>15">
- <li><a href="{toca/@href}" title="{toca}"><xsl:value-of select="substring(toca,0,20)" />...</a></li>
+ <xsl:when test="string-length(@title)>15">
+ <li><a href="{@href}" title="{@title}"><xsl:value-of select="substring(@title,0,20)" />...</a></li>
</xsl:when>
<xsl:otherwise>
- <li><a href="{toca/@href}"><xsl:value-of select="toca" /></a></li>
+ <li><a href="{@href}"><xsl:value-of select="@title" /></a></li>
</xsl:otherwise>
</xsl:choose>
@@ -470,9 +470,6 @@
</div>
</xsl:template>
- <xsl:template match="toc|toc2|tocc|toca">
- </xsl:template>
-
<xsl:template name="mainarea">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<!-- ( ================= middle NavBar ================== ) -->
@@ -499,6 +496,98 @@
</table>
</xsl:template>
+ <xsl:template match="div[@class = 'skinconf-heading-1']">
+ <xsl:choose>
+ <xsl:when test="//skinconfig/headings/@type='underlined'">
+
+ <table class="h3" cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tbody>
+ <tr>
+ <td width="9" height="10"></td>
+ <td><h3><xsl:value-of select="h1"/></h3></td>
+ <td></td>
+ </tr>
+ <tr class="heading ">
+ <td class="bottom-left"></td>
+ <td class="bottomborder"></td>
+ <td class="bottom-right"></td>
+ </tr>
+
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:when test="//skinconfig/headings/@type='boxed'">
+ <table class="h3 heading" cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tbody>
+ <tr>
+ <td class="top-left"></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><h3><xsl:value-of select="h1"/></h3></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class=" bottom-left"></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:otherwise>
+ <h3 class="h3"><xsl:value-of select="h1"/></h3>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="div[@class = 'skinconf-heading-2']">
+ <xsl:choose>
+ <xsl:when test="//skinconfig/headings/@type='underlined'">
+ <table class="h4" cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tbody>
+ <tr>
+ <td width="9" height="10"></td>
+ <td><h4><xsl:value-of select="h1"/></h4></td>
+ <td></td>
+ </tr>
+ <tr class="subheading">
+ <td class="bottom-left"></td>
+ <td></td>
+ <td class="bottom-right"></td>
+ </tr>
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:when test="//skinconfig/headings/@type='boxed'">
+ <table class="h4 subheading" cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tbody>
+ <tr>
+ <td class="top-left"></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><h4><xsl:value-of select="h1"/></h4></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class=" bottom-left"></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:otherwise>
+ <h4 class="h4"><xsl:value-of select="h1"/></h4>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
<xsl:template name="bottomstrip">
<!-- ( ================= start Footer ================== ) -->
<table>
@@ -510,12 +599,12 @@
</table>
<table class="footer">
<tr>
- <xsl:if test="$config/host-logo and not($config/host-logo = '')">
+ <xsl:if test="//skinconfig/host-logo and not(//skinconfig/host-logo = '')">
<div class="host">
<xsl:call-template name="renderlogo">
- <xsl:with-param name="name" select="$config/host-name"/>
- <xsl:with-param name="url" select="$config/host-url"/>
- <xsl:with-param name="logo" select="$config/host-logo"/>
+ <xsl:with-param name="name" select="//skinconfig/host-name"/>
+ <xsl:with-param name="url" select="//skinconfig/host-url"/>
+ <xsl:with-param name="logo" select="//skinconfig/host-logo"/>
<xsl:with-param name="root" select="$root"/>
</xsl:call-template>
</div>
@@ -556,8 +645,8 @@
<xsl:template name="bottom-credit-icons">
<!-- old place where to put credits icons-->
<!--
- <xsl:if test="$filename = 'index.html' and $config/credits">
- <xsl:for-each select="$config/credits/credit[not(@role='pdf')]">
+ <xsl:if test="$filename = 'index.html' and //skinconfig/credits">
+ <xsl:for-each select="//skinconfig/credits/credit[not(@role='pdf')]">
<xsl:variable name="name" select="name"/>
<xsl:variable name="url" select="url"/>
<xsl:variable name="image" select="image"/>
@@ -576,13 +665,6 @@
</xsl:for-each>
</xsl:if>
-->
- </xsl:template>
-
- <xsl:template match="node()|@*" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
</xsl:template>
</xsl:stylesheet>
Modified: xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/document2html.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/document2html.xsl (original)
+++ xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/document2html.xsl Sat May 22 00:53:22 2004
@@ -50,10 +50,11 @@
</td>
<td id="issueid" class="tasknav">
<div align="right">
- <xsl:call-template name="pdflink"/>
- <xsl:call-template name="printlink"/>
- <xsl:call-template name="xmllink"/>
-  
+ <div id="skinconf-printlink"/>
+ <xsl:if test="$dynamic-page='false'">
+ <div id="skinconf-pdflink"/>
+ <div id="skinconf-xmllink"/>
+ </xsl:if>
</div>
</td>
</tr>
@@ -93,42 +94,7 @@
</xsl:template>
<xsl:template match="body">
-
- <xsl:if test="section and $config/toc/@max-depth>0 and not($notoc='true') and contains($minitoc-location,'menu')">
- <toc>
- <xsl:for-each select="section">
- <tocc>
- <toca>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
- </xsl:attribute>
- <xsl:value-of select="title"/>
- </toca>
- <xsl:if test="section">
- <toc2>
- <xsl:for-each select="section">
- <tocc>
- <toca>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
- </xsl:attribute>
- <xsl:value-of select="title"/>
- </toca>
- </tocc>
- </xsl:for-each>
- </toc2>
- </xsl:if>
- </tocc>
- </xsl:for-each>
- </toc>
- </xsl:if>
-
- <xsl:if test="$config/toc/@max-depth>0 and not($notoc='true') and contains($minitoc-location,'page')" >
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth">1</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
+ <div id="skinconf-toc-page"/>
<xsl:apply-templates/>
</xsl:template>
@@ -149,6 +115,7 @@
<xsl:template match="section">
<a name="{generate-id()}"/>
+
<xsl:apply-templates select="@id"/>
<xsl:variable name = "level" select = "count(ancestor::section)+1" />
@@ -273,50 +240,4 @@
<!-- do not show title elements, they are already in other places-->
</xsl:template>
- <!-- Generates the PDF link -->
- <xsl:template name="pdflink">
- <xsl:if test="$dynamic-page='false'">
- <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'">
- <a href="{$filename-noext}.pdf"><img border="0" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/> PDF</a>
- </xsl:if>
- </xsl:if>
- </xsl:template>
-
- <!-- Generates the XML link -->
- <xsl:template name="xmllink">
- <xsl:if test="$dynamic-page='false'">
- <xsl:if test="$disable-xml-link = 'false'">
- <a href="{$filename-noext}.xml"><img border="0" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/> xml</a>
- </xsl:if>
- </xsl:if>
- </xsl:template>
-
- <!-- Generates the "printer friendly version" link -->
- <xsl:template name="printlink">
- <xsl:if test="$disable-print-link = 'false'">
-<script type="text/javascript" language="Javascript">
-function printit() {
-if (window.print) {
- window.print() ;
-} else {
- var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
-document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
- WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
-}
-}
-</script>
-
-<script type="text/javascript" language="Javascript">
-var NS = (navigator.appName == "Netscape");
-var VERSION = parseInt(navigator.appVersion);
-if (VERSION > 3) {
- document.write(' <a href="javascript:printit()">');
- document.write(' <img border="0" src="{$skin-img-dir}/printer.gif" alt="Print this Page"/>');
- document.write(' print</a>');
-}
-</script>
-
- </xsl:if>
- </xsl:template>
-
</xsl:stylesheet>
Modified: xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl
==============================================================================
--- xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl (original)
+++ xml/forrest/trunk/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl Sat May 22 00:53:22 2004
@@ -193,6 +193,48 @@
<xsl:call-template name="breadcrumbs"/>
</xsl:template>
+ <!-- Generates the PDF link -->
+ <xsl:template match="div[@id='skinconf-pdflink']">
+ <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'">
+ <a href="{$filename-noext}.pdf"><img border="0" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/> PDF</a>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Generates the XML link -->
+ <xsl:template match="div[@id='skinconf-xmllink']">
+ <xsl:if test="$disable-xml-link = 'false'">
+ <a href="{$filename-noext}.xml"><img border="0" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/> xml</a>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Generates the "printer friendly version" link -->
+ <xsl:template match="div[@id='skinconf-printlink']">
+ <xsl:if test="$disable-print-link = 'false'">
+<script type="text/javascript" language="Javascript">
+function printit() {
+if (window.print) {
+ window.print() ;
+} else {
+ var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
+document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
+ WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
+}
+}
+</script>
+
+<script type="text/javascript" language="Javascript">
+var NS = (navigator.appName == "Netscape");
+var VERSION = parseInt(navigator.appVersion);
+if (VERSION > 3) {
+ document.write(' <a href="javascript:printit()">');
+ document.write(' <img border="0" src="{$skin-img-dir}/printer.gif" alt="Print this Page"/>');
+ document.write(' print</a>');
+}
+</script>
+
+ </xsl:if>
+ </xsl:template>
+
<xsl:template name="centerstrip" >
<!--
+=========+======================+
@@ -241,27 +283,30 @@
</div>
<xsl:apply-templates select="div[@class='menu']"/>
- <xsl:if test="//toc/tocc">
- <div class="label">
- <strong>Page</strong>
- </div>
- <div class="body">
- <xsl:for-each select = "//toc/tocc">
- <div>
- <xsl:choose>
- <xsl:when test="string-length(toca)>15">
- <a href="{toca/@href}" title="{toca}"><xsl:value-of select="substring(toca,0,20)" />...</a>
- </xsl:when>
- <xsl:otherwise>
- <a href="{toca/@href}"><xsl:value-of select="toca" /></a>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="toc2/tocc"><!-- discard second level --></xsl:if>
- </div>
- </xsl:for-each>
- </div>
+ <xsl:if test="$config/toc/@max-depth>0 and contains($minitoc-location,'menu')">
+ <xsl:if test="//tocitems/tocitem">
+ <div class="label">
+ <strong>Page</strong>
+ </div>
+ <div class="body">
+ <!-- Only show first level sections here -->
+ <xsl:for-each select = "//tocitems/tocitem[@level=1]">
+ <div>
+ <xsl:choose>
+ <xsl:when test="string-length(@title)>15">
+ <a href="{@href}" title="{@title}"><xsl:value-of select="substring(@title,0,20)" />...</a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a href="{@href}"><xsl:value-of select="@title" /></a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </xsl:for-each>
+ </div>
+ </xsl:if>
</xsl:if>
</div>
+
<!-- ( ================= end Menu items ================== ) -->
<!-- ( ================= Search ================== ) -->
@@ -347,9 +392,6 @@
</xsl:template>
- <xsl:template match="toc|toc2|tocc|toca">
- </xsl:template>
-
<xsl:template name="mainarea">
<xsl:apply-templates select="div[@class='content']"/>
</xsl:template>
Modified: xml/forrest/trunk/src/core/context/status.xmap
==============================================================================
--- xml/forrest/trunk/src/core/context/status.xmap (original)
+++ xml/forrest/trunk/src/core/context/status.xmap Sat May 22 00:53:22 2004
@@ -48,7 +48,7 @@
<map:pipeline>
<map:match pattern="changes.xml">
- <map:generate type="file" src="status.xml" />
+ <map:generate type="file" src="{project:status}" />
<map:transform src="{forrest:stylesheets}/changes2document.xsl" >
<map:parameter name="bugtracking-url" value="{defaults:bugtracking-url}"/>
</map:transform >
@@ -56,13 +56,13 @@
</map:match>
<map:match pattern="changes.rss">
- <map:generate src="status.xml" />
+ <map:generate src="{project:status}" />
<map:transform src="{forrest:stylesheets}/changes2rss.xsl" />
<map:serialize type="rss091" />
</map:match>
<map:match pattern="todo.xml">
- <map:generate type="file" src="status.xml" />
+ <map:generate type="file" src="{project:status}" />
<map:transform src="{forrest:stylesheets}/todo2document.xsl" />
<map:serialize type="xml-document"/>
</map:match>
Modified: xml/forrest/trunk/src/core/context/tabs.xmap
==============================================================================
--- xml/forrest/trunk/src/core/context/tabs.xmap (original)
+++ xml/forrest/trunk/src/core/context/tabs.xmap Sat May 22 00:53:22 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/trunk/src/core/forrest.build.xml
==============================================================================
--- xml/forrest/trunk/src/core/forrest.build.xml (original)
+++ xml/forrest/trunk/src/core/forrest.build.xml Sat May 22 00:53:22 2004
@@ -27,10 +27,23 @@
<project default="site" basedir="." name="forrest">
<property name="version" value="0.6-dev"/>
-
+
+ <property name="forrest.root-dir" location="${forrest.home}/../.."/>
+
+ <property name="forrest.lib-dir" location="${forrest.root-dir}/lib"/>
+ <property name="forrest.core.lib-dir" location="${forrest.lib-dir}/core"/>
+ <property name="forrest.endorsed.lib-dir" location="${forrest.lib-dir}/endorsed"/>
+ <property name="forrest.optional.lib-dir" location="${forrest.lib-dir}/optional"/>
+
+ <property name="forrest.tools-dir" location="${forrest.root-dir}/tools"/>
+ <property name="forrest.ant.tools-dir" location="${forrest.tools-dir}/ant"/>
+ <property name="forrest.ant.lib-dir" location="${forrest.ant.tools-dir}/lib"/>
+ <property name="forrest.jetty.lib-dir" location="${forrest.tools-dir}/jetty"/>
+
+ <property name="forrest.build.lib-dir" location="${forrest.root-dir}/build"/>
+
<import file="targets/validate.xml"/>
<import file="targets/webapp.xml"/>
- <import file="targets/war.xml"/>
<import file="targets/site.xml"/>
<import file="targets/skins.xml"/>
<import file="targets/context.xml"/>
@@ -47,12 +60,12 @@
<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
<classpath>
- <fileset dir="${forrest.home}/lib/core" includes="jing*.jar" />
+ <fileset dir="${forrest.core.lib-dir}" includes="jing*.jar" />
</classpath>
</taskdef>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
- <fileset dir="${forrest.home}/tools/ant/lib" includes="ant-contrib-*.jar" />
+ <fileset dir="${forrest.ant.lib-dir}" includes="ant-contrib-*.jar" />
</classpath>
</taskdef>
@@ -82,8 +95,8 @@
<property file="${project.home}/forrest.properties" />
<echo message="Loading user specific properties from ${user.home}${/}forrest.properties" />
<property file="${user.home}/forrest.properties" />
- <echo message="Loading default properties from ${forrest.home}${/}default-forrest.properties" />
- <property file="${forrest.home}/default-forrest.properties" />
+ <echo message="Loading default properties from ${forrest.home}${/}context${/}default-forrest.properties" />
+ <property file="${forrest.home}/context/default-forrest.properties" />
<!-- people should use forrest.properties to override following defaults -->
<property name="forrest.home" location="." />
@@ -98,8 +111,8 @@
<property name="project.cocoon-work-dir" location="${project.temp-dir}/cocoon-work" />
<property name="project.brokenlinkfile" location="${project.build-dir}/brokenlinks.xml"/>
- <property name="project.configfile" value="${project.webapp}/WEB-INF/cli.xconf" />
- <property name="project.logkitfile" value="${project.webapp}/WEB-INF/logkit.xconf" />
+ <property name="project.configfile" value="${forrest.home}/context/WEB-INF/cli.xconf" />
+ <property name="project.logkitfile" value="${forrest.home}/context/WEB-INF/logkit.xconf" />
<property name="project.logger" value="debug" />
<property name="status" location="${project.home}/${project.status}" />
@@ -156,7 +169,7 @@
<!-- Load properties from user's skinconf.xml, if it is defined -->
- <target name="load-project-props" depends="validation-props, validate-skinconf,prepare-context" if="skinconf.present">
+ <target name="load-project-props" depends="validation-props, prepare-context" if="skinconf.present">
<xmlproperty file="${project.webapp}/skinconf.xml" collapseattributes="true"/>
</target>
@@ -177,7 +190,10 @@
</target>
<!-- Sets up properties and filters -->
- <target name="init" depends="init-props, init-skins"/>
+ <target name="init" depends="init-props, init-skins">
+ <available property="xml-forrest.jar.exists" file="${forrest.build.lib-dir}/xml-forrest.jar"/>
+ <fail unless="xml-forrest.jar.exists">You must build forrest before you can run it. In ${forrest.root-dir} run './build.sh' (linux) or 'build' (windows)</fail>
+ </target>
<!-- ===============================================================
Echo's the settings if requested. [-Dforrest.echo=true]
@@ -198,25 +214,26 @@
<path id="forrest.cp">
<pathelement path="${env.CLASSPATH}" />
<pathelement location="${forrest.home}/context/WEB-INF/classes"/>
- <fileset dir="${forrest.home}/tools/jetty">
+ <pathelement location="${forrest.build.lib-dir}/xml-forrest.jar"/>
+ <fileset dir="${forrest.jetty.lib-dir}">
<include name="*.jar"/>
<include name="*.JAR"/>
<include name="*.zip"/>
<include name="*.ZIP"/>
</fileset>
- <fileset dir="${forrest.home}/lib/endorsed">
+ <fileset dir="${forrest.endorsed.lib-dir}">
<include name="*.jar"/>
<include name="*.JAR"/>
<include name="*.zip"/>
<include name="*.ZIP"/>
</fileset>
- <fileset dir="${forrest.home}/lib/core">
+ <fileset dir="${forrest.core.lib-dir}">
<include name="*.jar"/>
<include name="*.JAR"/>
<include name="*.zip"/>
<include name="*.ZIP"/>
</fileset>
- <fileset dir="${forrest.home}/lib/optional">
+ <fileset dir="${forrest.optional.lib-dir}">
<include name="*.jar"/>
<include name="*.JAR"/>
<include name="*.zip"/>
@@ -295,7 +312,7 @@
<target name="run"
- depends="webapp-local, run_custom_jetty, run_default_jetty"/>
+ depends="init, run_custom_jetty, run_default_jetty"/>
<target name="run_custom_jetty"
if="custom_jetty_config"
@@ -311,16 +328,15 @@
<jvmarg line="${forrest.jvmargs}"/>
<jvmarg line="${forrest.basic.jvmargs}"/>
<jvmarg
- value="-Djava.endorsed.dirs=${java.endorsed.dirs}${path.separator}${forrest.home}/lib/endorsed"/>
+ value="-Djava.endorsed.dirs=${java.endorsed.dirs}${path.separator}${forrest.endorsed.lib-dir}"/>
<arg line="${content-dir}/jettyconf.xml" />
</java>
</target>
<target name="run_default_jetty"
- description="Run Jetty with configuration file found in Forrest"
- depends="webapp-local">
+ description="Run Jetty with configuration file found in Forrest">
<java classname="org.mortbay.jetty.Server"
- dir="${project.webapp}"
+ dir="${forrest.home}/context"
fork="yes"
maxmemory="${forrest.maxmemory}"
failonerror="yes">
@@ -330,7 +346,7 @@
<jvmarg line="${forrest.jvmargs}"/>
<jvmarg line="${forrest.basic.jvmargs}"/>
<jvmarg
- value="-Djava.endorsed.dirs=${java.endorsed.dirs}${path.separator}${forrest.home}/lib/endorsed"/>
+ value="-Djava.endorsed.dirs=${java.endorsed.dirs}${path.separator}${forrest.endorsed.lib-dir}"/>
<arg line="${forrest.home}/context/jettyconf.xml" />
</java>
</target>
Modified: xml/forrest/trunk/src/core/targets/context.xml
==============================================================================
--- xml/forrest/trunk/src/core/targets/context.xml (original)
+++ xml/forrest/trunk/src/core/targets/context.xml Sat May 22 00:53:22 2004
@@ -42,28 +42,12 @@
<echo>____________________________________</echo>
<echo>Using skin ${project.skin}</echo>
<echo>____________________________________</echo>
- <filter token="skin" value="${project.skin}" />
- <filter token="menu-scheme" value="${project.menu-scheme}" />
- <filter token="bugtracking-url" value="${project.bugtracking-url}" />
- <filter token="local-catalog" value="${catalog}" />
- <filter token="catalog-verbosity" value="${forrest.catalog.verbosity}" />
- <filter token="i18n" value="${project.i18n}" />
- <copy todir="${project.webapp}/" >
- <fileset dir="${forrest.home}/context" >
- <exclude name="*.xmap" />
- <exclude name="skins/**" />
- <exclude name="resources/**" />
- <exclude name="WEB-INF/*.xconf" />
- <exclude name="jettyconf.xml" />
- </fileset>
- </copy>
+ <mkdir dir="${project.webapp}"/>
- <copy todir="${project.webapp}/" filtering="true" overwrite="true">
+ <copy todir="${project.webapp}/" filtering="false" overwrite="true">
<fileset dir="${forrest.home}/context" >
- <include name="*.xmap" />
- <include name="WEB-INF/*.xconf" />
- <exclude name="WEB-INF/cocoon-live.xconf"/>
+ <include name="**" />
</fileset>
</copy>
@@ -86,13 +70,13 @@
validate, init, bare-context, copy-sitemap, copy-conf, upgrade-skinconf, copy-status"/>
<target name="copy-conf" if="conf.present">
- <copy toDir="${project.webapp}/WEB-INF" filtering="true"
+ <copy toDir="${project.webapp}/WEB-INF" filtering="false"
overwrite="true" failonerror="false">
<fileset dir="${conf-dir}">
<exclude name="*-${version}.xconf"/>
</fileset>
</copy>
- <copy toDir="${project.webapp}/WEB-INF" filtering="true" overwrite="true"
+ <copy toDir="${project.webapp}/WEB-INF" filtering="false" overwrite="true"
failonerror="false">
<fileset dir="${conf-dir}">
<include name="*-${version}.*"/>
@@ -102,14 +86,14 @@
</target>
<target name="copy-sitemap" if="sitemap.present">
- <copy toDir="${project.webapp}" filtering="true" overwrite="true" failonerror="false">
+ <copy toDir="${project.webapp}" filtering="false" overwrite="true" failonerror="false">
<fileset dir="${sitemap-dir}">
<exclude name="*-${version}.xmap"/>
<include name="*.xmap"/>
<include name="jtidy.properties"/>
</fileset>
</copy>
- <copy toDir="${project.webapp}" filtering="true" overwrite="true">
+ <copy toDir="${project.webapp}" filtering="false" overwrite="true">
<fileset dir="${sitemap-dir}">
<include name="*-${version}.xmap"/>
</fileset>
Modified: xml/forrest/trunk/src/core/targets/site.xml
==============================================================================
--- xml/forrest/trunk/src/core/targets/site.xml (original)
+++ xml/forrest/trunk/src/core/targets/site.xml Sat May 22 00:53:22 2004
@@ -28,45 +28,24 @@
===============================================================
-->
- <target name="site" depends="init, webapp-local, -prepare-classpath" if="project.content.present"
- description="Generates a static HTML website for this project">
+ <target name="site" depends="init, -prepare-classpath, check-contentdir"
+ if="project.content.present"
+ description="Generates a static HTML website for this project">
<!-- clean out the temp space, if we don't cocoon fails on this.
actually clears the cache, not yet sure why it is really needed? -->
<delete dir="${project.cocoon-work-dir}"/>
<mkdir dir="${project.cocoon-work-dir}"/>
<parallel>
- <!--
+<!-- dir="${project.webapp}" -->
<java classname="org.apache.cocoon.Main"
fork="true"
- maxmemory="${forrest.maxmemory}"
- dir="."
- failonerror="true"
- classpathref="forrest.cp">
- <jvmarg line="${forrest.jvmargs}"/>
- <jvmarg line="${forrest.basic.jvmargs}"/>
- <jvmarg
- value="-Djava.endorsed.dirs=${forrest.home}/lib/endorsed${path.separator}${java.endorsed.dirs}"/>
- <arg value="-c${project.webapp}"/> <!- input to the process ->
- <arg value="-d${project.site-dir}"/> <!- output to be put ->
- <arg value="-w${project.cocoon-work-dir}"/> <!- temp dir to use for e.g. cache ->
- <arg value="-u${project.debuglevel}"/> <!- threshold for log messages ->
- <arg value="-C${project.webapp}/WEB-INF/cocoon.xconf"/> <!- cocoon.xconf file to use ->
- <arg value="-b${project.brokenlinkfile}"/> <!- output list of broken links ->
- <arg value="-k${project.webapp}/WEB-INF/logkit.xconf"/> <!- output list of broken links ->
- <arg value="${project.start-uri}"/> <!- starting page ->
- <arg value="-V" /> <!- be verbose ->
- </java>
- -->
-
- <java classname="org.apache.cocoon.Main"
- fork="true"
- dir="${project.webapp}"
+ dir="${forrest.home}/context"
failonerror="true"
maxmemory="${forrest.maxmemory}">
<jvmarg line="${forrest.jvmargs}"/>
<jvmarg line="${forrest.basic.jvmargs}"/>
- <jvmarg value="-Djava.endorsed.dirs=${forrest.home}/lib/endorsed${path.separator}${java.endorsed.dirs}"/>
+ <jvmarg value="-Djava.endorsed.dirs=${forrest.endorsed.lib-dir}${path.separator}${java.endorsed.dirs}"/>
<arg value="--logLevel=${project.debuglevel}"/>
<arg value="--Logger=${project.logger}"/>
<arg value="--logKitconfig=${project.logkitfile}"/>
@@ -78,7 +57,6 @@
</classpath>
</java>
-
<sequential>
<!--
| Copy all non-xdocs content across, as we cannot rely on crawling to
@@ -97,20 +75,30 @@
<mkdir dir="${project.site-dir}/skin/images"/>
<!-- FIXME: we will only be using either project skins or forrest skins - only copy those necessary (don't forget common) -->
<!-- Copy forrest skin images -->
+ <!-- Do the common ones first followed by those for the skin. -->
<copy toDir="${project.site-dir}/skin/images" overwrite="true"
failonerror="false">
<fileset dir="${forrest.skins-dir}/common/images"/>
+ </copy>
+ <copy toDir="${project.site-dir}/skin/images" overwrite="true"
+ failonerror="false">
<fileset dir="${forrest.skins-dir}/${project.skin}/images"/>
</copy>
+
<!-- Copy project skin images -->
+ <!-- Do the common ones first followed by those for the skin. -->
<copy toDir="${project.site-dir}/skin/images" overwrite="true"
failonerror="false">
<fileset dir="${project.skins-dir}/common/images"/>
+ </copy>
+ <copy toDir="${project.site-dir}/skin/images" overwrite="true"
+ failonerror="false">
<fileset dir="${project.skins-dir}/${project.skin}/images"/>
</copy>
<!-- Copy all other non-resource files -->
+ <!-- Do the common ones first followed by those for the skin. -->
<copy toDir="${project.site-dir}/skin"
overwrite="true"
failonerror="false">
@@ -119,13 +107,20 @@
<exclude name="images/**"/>
<exclude name="xslt/**"/>
</fileset>
+ </copy>
+ <copy toDir="${project.site-dir}/skin"
+ overwrite="true"
+ failonerror="false">
+ <mapper type="flatten"/>
<fileset dir="${forrest.skins-dir}/${project.skin}">
<exclude name="images/**"/>
<exclude name="xslt/**"/>
</fileset>
</copy>
+
<!-- Copy all other non-resource files from project skins-->
+ <!-- Do the common ones first followed by those for the skin. -->
<copy toDir="${project.site-dir}/skin"
overwrite="true"
failonerror="false">
@@ -134,6 +129,11 @@
<exclude name="images/**"/>
<exclude name="xslt/**"/>
</fileset>
+ </copy>
+ <copy toDir="${project.site-dir}/skin"
+ overwrite="true"
+ failonerror="false">
+ <mapper type="flatten"/>
<fileset dir="${project.skins-dir}/${project.skin}">
<exclude name="images/**"/>
<exclude name="xslt/**"/>
@@ -165,4 +165,4 @@
</target>
-</project>
\ No newline at end of file
+</project>
Modified: xml/forrest/trunk/src/core/targets/validate.xml
==============================================================================
--- xml/forrest/trunk/src/core/targets/validate.xml (original)
+++ xml/forrest/trunk/src/core/targets/validate.xml Sat May 22 00:53:22 2004
@@ -16,14 +16,17 @@
-->
<project default="validate" basedir="." name="validate">
-
+<!--
<target name="validate" depends="validation-props, validate-xdocs,
- validate-skinconf, validate-sitemap, validate-skins, validate-skinchoice,
+ validate-sitemap, validate-skins, validate-skinchoice,
validate-stylesheets" description="Validates XML doc files in the project"/>
+-->
+ <target name="validate"/>
+
+
<target name="validation-props" depends="examine-proj">
<!-- Validation flags -->
-
<property name="forrest.validate" value="true" />
<condition property="validate">
<istrue value="${forrest.validate}"/>
@@ -31,83 +34,18 @@
<property name="forrest.validate.failonerror" value="true" />
<property name="forrest.validate.includes" value="**/*"/>
<property name="forrest.validate.excludes" value=""/>
-
- <property name="forrest.validate.xdocs" value="${forrest.validate}"/>
- <condition property="validate.xdocs">
- <and>
- <istrue value="${forrest.validate.xdocs}"/>
- <isset property="xdocs.present"/>
- </and>
- </condition>
<property name="forrest.validate.xdocs.includes" value="**/*.xml"/>
<property name="forrest.validate.xdocs.excludes" value="site.xml,.*.swp"/>
- <property name="forrest.validate.xdocs.failonerror"
- value="${forrest.validate.failonerror}" />
-
- <property name="forrest.validate.skinconf" value="${forrest.validate}"/>
- <condition property="validate.skinconf">
- <and>
- <istrue value="${forrest.validate.skinconf}"/>
- <isset property="skinconf.present"/>
- </and>
- </condition>
- <basename file="${skinconf}" property="skinconf-file"/>
<property name="forrest.validate.skinconf.includes" value="${skinconf-file}"/>
<property name="forrest.validate.skinconf.excludes" value=""/>
- <property name="forrest.validate.skinconf.failonerror"
- value="${forrest.validate.failonerror}" />
-
- <property name="forrest.validate.sitemap" value="${forrest.validate}"/>
- <condition property="validate.sitemap">
- <and>
- <istrue value="${forrest.validate.sitemap}"/>
- <isset property="sitemap.present"/>
- </and>
- </condition>
-
- <property name="forrest.validate.sitemap.includes" value=""/>
- <property name="forrest.validate.sitemap.excludes" value=""/>
- <property name="forrest.validate.sitemap.failonerror"
- value="${forrest.validate.failonerror}" />
-
- <property name="forrest.validate.stylesheets" value="${forrest.validate}"/>
- <condition property="validate.stylesheets">
- <and>
- <istrue value="${forrest.validate.stylesheets}"/>
- <isset property="stylesheets.present"/>
- </and>
- </condition>
<property name="forrest.validate.stylesheets.includes" value="**/*.xsl"/>
- <property name="forrest.validate.stylesheets.excludes" value=""/>
- <property name="forrest.validate.stylesheets.failonerror"
- value="${forrest.validate.failonerror}" />
-
- <property name="forrest.validate.skins" value="${forrest.validate}"/>
- <condition property="validate.skins">
- <and>
- <istrue value="${forrest.validate.skins}"/>
- <isset property="skins.present"/>
- </and>
- </condition>
+ <property name="forrest.validate.skinconf.excludes" value=""/>
<property name="forrest.validate.skins.includes" value="**/*"/>
<property name="forrest.validate.skins.excludes" value="**/*.xsl"/>
- <property name="forrest.validate.skins.failonerror"
- value="${forrest.validate.failonerror}" />
-
- <property name="forrest.validate.skins.stylesheets" value="${forrest.validate.skins}"/>
- <condition property="validate.skins.stylesheets">
- <and>
- <istrue value="${forrest.validate.skins.stylesheets}"/>
- <isset property="skins.present"/>
- </and>
- </condition>
<property name="forrest.validate.skins.stylesheets.includes" value="**/*.xsl"/>
<property name="forrest.validate.skins.stylesheets.excludes" value=""/>
- <property name="forrest.validate.skins.stylesheets.failonerror"
- value="${forrest.validate.skins.failonerror}" />
- </target>
-
-
+ </target>
+
<target name="validate-site" depends="load-project-props">
<condition property="forrest.validate.skinconf.disable-xml-link">
<and>
@@ -137,8 +75,8 @@
<echo message="...validated site"/>
</target>
- <target name="validate-xdocs" depends="validation-props" if="validate.xdocs">
- <xmlvalidate failonerror="${forrest.validate.xdocs.failonerror}" lenient="no" warn="yes">
+ <target name="validate-xdocs" depends="validation-props">
+ <xmlvalidate failonerror="${forrest.validate.failonerror}" lenient="no" warn="yes">
<attribute name="http://apache.org/xml/features/validation/dynamic" value="true"/>
<xmlcatalog refid="fcatalog" />
<fileset dir="${xdocs-dir}"
@@ -148,18 +86,6 @@
<echo message="...validated xdocs"/>
</target>
- <target name="validate-skinconf" depends="validation-props"
- if="validate.skinconf">
- <xmlvalidate failonerror="${forrest.validate.skinconf.failonerror}"
- lenient="no" warn="yes">
- <xmlcatalog refid="fcatalog" />
- <fileset dir="${content-dir}"
- includes="${forrest.validate.skinconf.includes}"
- excludes="${forrest.validate.skinconf.excludes}"/>
- </xmlvalidate>
- <echo message="...validated skinconf"/>
- </target>
-
<target name="validate-sitemap" depends="validation-props"
if="validate.sitemap">
<available property="version-specific-sitemap" file="${sitemap-dir}/forrest-${version}.xmap" type="file"/>
@@ -188,8 +114,7 @@
<echo message="...validated sitemap"/>
</target>
- <target name="validate-stylesheets" depends="validation-props"
- if="validate.stylesheets">
+ <target name="validate-stylesheets" depends="validation-props">
<jing rngfile="${forrest.home}/context/resources/schema/relaxng/xslt.rng">
<fileset dir="${stylesheets-dir}"
includes="${forrest.validate.stylesheets.includes}"
@@ -200,8 +125,7 @@
<target name="validate-skins" depends="validate-skins-stylesheets"/>
- <target name="validate-skins-stylesheets" depends="validation-props"
- if="validate.skins.stylesheets">
+ <target name="validate-skins-stylesheets" depends="validation-props">
<jing rngfile="${forrest.home}/context/resources/schema/relaxng/xslt.rng">
<fileset dir="${skins-dir}"
includes="${forrest.validate.skins.stylesheets.includes}"
Modified: xml/forrest/trunk/src/core/targets/webapp.xml
==============================================================================
--- xml/forrest/trunk/src/core/targets/webapp.xml (original)
+++ xml/forrest/trunk/src/core/targets/webapp.xml Sat May 22 00:53:22 2004
@@ -41,10 +41,12 @@
target if you wish to deploy remotely.">
<!-- this will need revisions in the case of the siteplan
extra project-custom classes then will need to be warred in as well. -->
+<!-- should be already there
<mkdir dir="${project.webapp}/WEB-INF"/>
<copy file="${forrest.home}/context/WEB-INF/web.xml" filtering="true"
todir="${project.webapp}/WEB-INF"/>
-
+-->
+
<!-- Prepare the Lucene search index -->
<!-- FIXME: There must be a better way to configure this.
Is this really a concern of the skinconf?
@@ -91,17 +93,23 @@
<copy todir="${project.webapp}/WEB-INF/lib">
<!-- Note: no overwriting, so user's libs and classes get preference -->
- <fileset dir="${forrest.home}/lib/core">
+ <fileset dir="${forrest.core.lib-dir}">
<include name="**.jar"/>
</fileset>
- <fileset dir="${forrest.home}/lib/optional">
+ <fileset dir="${forrest.optional.lib-dir}">
<include name="**.jar"/>
</fileset>
- <fileset dir="${forrest.home}/lib/endorsed">
+ <fileset dir="${forrest.endorsed.lib-dir}">
<include name="**.jar"/>
</fileset>
</copy>
+ <copy todir="${project.webapp}/WEB-INF/lib">
+ <fileset dir="${forrest.build.lib-dir}">
+ <include name="**.jar"/>
+ </fileset>
+ </copy>
+
<copy toDir="${project.webapp}/WEB-INF/classes">
<fileset dir="${forrest.home}/context/WEB-INF/classes"/>
</copy>
@@ -109,7 +117,7 @@
<!-- Copy XML jars if not running JDK 1.4 (where they're built-in) -->
<available property="jdk1.4+" classname="java.lang.CharSequence"/>
<copy todir="${project.webapp}/WEB-INF/lib">
- <fileset dir="${forrest.home}/lib/endorsed">
+ <fileset dir="${forrest.endorsed.lib-dir}">
<include name="*jar" unless="jdk1.4+"/>
</fileset>
</copy>
@@ -117,111 +125,14 @@
<!--
| Copy all non-xdocs content across to the webapp
-->
- <copy toDir="${project.webapp}"
- overwrite="true" failonerror="false">
- <fileset dir="${content-dir}">
- <exclude name="content/xdocs/**"/>
- </fileset>
- </copy>
-
- <!-- Copy Skins -->
- <!-- Copy forrest skin images -->
- <copy toDir="${project.webapp}/skin/common/images" overwrite="true"
- failonerror="false">
- <fileset dir="${forrest.skins-dir}/common/images"/>
- </copy>
- <copy toDir="${project.webapp}/skin/${project.skin}/images" overwrite="true"
- failonerror="false">
- <fileset dir="${forrest.skins-dir}/${project.skin}/images"/>
- </copy>
- <!-- Copy project skin images -->
- <copy toDir="${project.webapp}/skin/common/images" overwrite="true"
- failonerror="false">
- <fileset dir="${project.skins-dir}/common/images"/>
- </copy>
- <copy toDir="${project.webapp}/skin/${project.skin}/images" overwrite="true"
- failonerror="false">
- <fileset dir="${project.skins-dir}/${project.skin}/images"/>
- </copy>
-
- <!-- Copy forrest skin XSLT files -->
- <copy toDir="${project.webapp}/skin/common/xslt" overwrite="true"
- failonerror="false">
- <fileset dir="${forrest.skins-dir}/common/xslt"/>
- </copy>
- <copy toDir="${project.webapp}/skin/${project.skin}/xslt" overwrite="true"
- failonerror="false">
- <fileset dir="${forrest.skins-dir}/${project.skin}/xslt"/>
- </copy>
- <!-- Copy project skin XSLT files -->
- <copy toDir="${project.webapp}/skin/common/xslt" overwrite="true"
- failonerror="false">
- <fileset dir="${project.skins-dir}/common/xslt"/>
- </copy>
- <copy toDir="${project.webapp}/skin/${project.skin}/xslt" overwrite="true"
- failonerror="false">
- <fileset dir="${project.skins-dir}/${project.skin}/xslt"/>
- </copy>
-
- <!-- Copy forrest skin CSS files -->
- <copy toDir="${project.webapp}/skin/common/css" overwrite="true"
- failonerror="false">
- <fileset dir="${forrest.skins-dir}/common/css"/>
- </copy>
- <copy toDir="${project.webapp}/skin/${project.skin}/css" overwrite="true"
- failonerror="false">
- <fileset dir="${forrest.skins-dir}/${project.skin}/css"/>
- </copy>
- <!-- Copy project skin CSS files -->
- <copy toDir="${project.webapp}/skin/common/css" overwrite="true"
- failonerror="false">
- <fileset dir="${project.skins-dir}/common/css"/>
- </copy>
- <copy toDir="${project.webapp}/skin/${project.skin}/css" overwrite="true"
- failonerror="false">
- <fileset dir="${project.skins-dir}/${project.skin}/css"/>
- </copy>
-
- <!-- Copy all other non-resource files from Forrest skins -->
- <copy toDir="${project.webapp}/skin/common"
- overwrite="true"
- failonerror="false">
- <fileset dir="${forrest.skins-dir}/common">
- <exclude name="images/**"/>
- <exclude name="xslt/**"/>
- <exclude name="css/**"/>
- </fileset>
- </copy>
- <copy toDir="${project.webapp}/skin/${project.skin}"
- overwrite="true"
- failonerror="false">
- <fileset dir="${forrest.skins-dir}/${project.skin}">
- <exclude name="images/**"/>
- <exclude name="xslt/**"/>
- <exclude name="css/**"/>
+ <mkdir dir="${project.webapp}/project"/>
+ <copy toDir="${project.webapp}/project" overwrite="true" failonerror="false">
+ <fileset dir="${project.home}">
+ <include name="**"/>
+ <exclude name="build/**"/>
</fileset>
</copy>
- <!-- Copy all other non-resource files from project skins-->
- <copy toDir="${project.webapp}/skin/common"
- overwrite="true"
- failonerror="false">
- <fileset dir="${project.skins-dir}/common">
- <exclude name="images/**"/>
- <exclude name="xslt/**"/>
- <exclude name="css/**"/>
- </fileset>
- </copy>
- <copy toDir="${project.webapp}/skin/${project.skin}"
- overwrite="true"
- failonerror="false">
- <fileset dir="${project.skins-dir}/${project.skin}">
- <exclude name="images/**"/>
- <exclude name="xslt/**"/>
- <exclude name="css/**"/>
- </fileset>
- </copy>
-
<!-- copy custom xmaps -->
<copy toDir="${project.webapp}"
overwrite="true"
@@ -230,54 +141,34 @@
<include name="*.xmap"/>
</fileset>
</copy>
-
- <!-- copy Schemas -->
- <copy toDir="${project.webapp}/resources"
- overwrite="true"
- failonerror="false">
- <fileset dir="${forrest.home}/context/resources"/>
- </copy>
-
- <!-- Change the filter tokens for cocoon.xconf.
- Note that we don't need to change the
- forrest filters since either these are the same as for the local
- webapp or their values can be fixed in the cocoon.xconf template. -->
- <!-- FIXME: Do these tokens need to be customisable via forrest.properties? -->
- <filter token="project.home" value="."/>
- <filter token="project.skins-dir" value="skin"/>
- <filter token="project.skinconf" value="../../../../skinconf.xml"/>
- <filter token="project.content-dir" value="."/>
- <filter token="project.raw-content-dir" value="content"/>
- <filter token="project.xdocs-dir" value="content/xdocs"/>
- <filter token="project.translations-dir" value="translations"/>
- <filter token="project.stylesheets-dir" value="resources/stylesheets"/>
- <filter token="project.images-dir" value="resources/images"/>
- <filter token="local-catalog" value="resources/schema/catalog.xcat"/>
- <!--copy tofile="${project.webapp}/WEB-INF/cocoon.xconf"
- filtering="true"
- overwrite="true"
- file="${forrest.home}/context/WEB-INF/cocoon-live.xconf" -->
-
<loadfile property="webapp-generated-message"
srcFile="${forrest.home}/var/webapp-generated-message.txt">
<filterchain><expandproperties/></filterchain>
</loadfile>
<echo>${webapp-generated-message}</echo>
</target>
- <target name="copy-xdocs" if="xdocs.present">
- <sync toDir="${project.webapp}/content/xdocs">
- <fileset dir="${xdocs-dir}"/>
- </sync>
+
+ <target name="copy-xdocs" if="xdocs.present">
</target>
- <!-- Copy all non-xdocs content -->
<target name="copy-content" if="raw-content.present">
- <copy toDir="${project.webapp}/content"
- overwrite="false" failonerror="false">
- <fileset dir="${raw-content-dir}">
- <exclude name="${xdocs-dir}/**"/>
- </fileset>
- </copy>
</target>
+
+ <!-- ===============================================================
+ Builds a cocoon .war for your project based on the siteplan.
+ param: location to put generated war ${project.war}
+ =============================================================== -->
+ <target name="war" depends="webapp"
+ description="Generates a dynamic servlet-based website (an packaged .war file)">
+
+ <jar destfile="${project.war}" basedir="${project.webapp}"/>
+ <echo>
+---------------------------------
+Webapp .war file generated:
+${project.war}
+---------------------------------
+ </echo>
+ </target>
+
</project>
Modified: xml/forrest/trunk/src/java/org/apache/forrest/conf/AntProperties.java
==============================================================================
--- xml/forrest/trunk/src/java/org/apache/forrest/conf/AntProperties.java (original)
+++ xml/forrest/trunk/src/java/org/apache/forrest/conf/AntProperties.java Sat May 22 00:53:22 2004
@@ -113,29 +113,23 @@
StringTokenizer st = new StringTokenizer(stringToFilter, "@", true);
- String currentToken = st.nextToken();
STATE state;
- if (currentToken.equals("@")) {
+ if (stringToFilter.startsWith("@")) {
state = new STATE(STATE.START_TOKEN);
} else {
state = new STATE(STATE.STRING_NOT_TO_FILTER);
}
- while (st.hasMoreTokens()) {
+ for (String currentToken; st.hasMoreTokens(); state.increment()) {
+
+ currentToken = st.nextToken();
if (state.isStringToFilter()) {
- resultStringBuffer.append(getProperty(currentToken,"@"+currentToken+"@"));
- System.out.println("currentToken to Filter:" + currentToken);
+ resultStringBuffer.append(getProperty(currentToken, "@"
+ + currentToken + "@"));
} else if (state.isStringNOTToFilter()) {
resultStringBuffer.append(currentToken);
- }
-
- System.out.println("resultStringBuffer;" + resultStringBuffer);
-
- {
- currentToken = st.nextToken();
- state.increment();
}
}
Modified: xml/forrest/trunk/src/java/org/apache/forrest/conf/ForrestConfModule.java
==============================================================================
--- xml/forrest/trunk/src/java/org/apache/forrest/conf/ForrestConfModule.java (original)
+++ xml/forrest/trunk/src/java/org/apache/forrest/conf/ForrestConfModule.java Sat May 22 00:53:22 2004
@@ -31,6 +31,7 @@
import org.apache.cocoon.components.modules.input.InputModule;
import org.apache.commons.lang.SystemUtils;
import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceNotFoundException;
import org.apache.excalibur.source.SourceResolver;
/**
@@ -65,77 +66,119 @@
Initializable, ThreadSafe, Serviceable
{
- private String forrestHome, projectHome;
- private SourceResolver m_resolver;
private AntProperties filteringProperties;
+ private String forrestHome, projectHome, contextHome;
+ private SourceResolver m_resolver;
+
+ private final static String defaultHome = "context:/";
- public void service(ServiceManager manager) throws ServiceException {
- System.out.println("getting resolver...");
- m_resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
- System.out.println("gotten resolver:" + m_resolver);
+ public Object getAttribute(String name, Configuration modeConf,
+ Map objectModel) throws ConfigurationException {
+ String original = super.getAttributeValues(name, modeConf, objectModel)[0]
+ .toString();
+ String attributeValue = this.getAttributeValues(name, modeConf,
+ objectModel)[0].toString();
+
+ if (debugging()) debug(" - Requested:" + name);
+ if (debugging()) debug(" - Unfiltered:" + original);
+ if (debugging()) debug(" - Given:" + attributeValue);
+
+ return attributeValue;
+ }
+
+ public Object[] getAttributeValues(String name, Configuration modeConf,
+ Map objectModel) throws ConfigurationException {
+ Object[] attributeValues = super.getAttributeValues(name, modeConf,
+ objectModel);
+ for (int i = 0; i < attributeValues.length; i++) {
+ attributeValues[i] = filteringProperties.filter(attributeValues[i]
+ .toString());
+ }
+
+ return attributeValues;
+ }
+
+ private final String getSystemProperty(String propertyName){
+
+ //if the property is not set, default to the webapp context
+ String propertyValue = System.getProperty(propertyName, defaultHome);
+
+ if (debugging()) debug("system property " + propertyName + "=" + propertyValue);
+
+ return propertyValue;
}
public void initialize() throws Exception {
- // get location of forrest.home
- //
+
//NOTE: Don't do this:
//
// forrestHome = System.getenv("FORREST_HOME");
//
// as it will get FORREST_HOME even when the app
// is run as a .war
- forrestHome = getAndResolveSystemProperty("forrest.home");
+ forrestHome = getSystemProperty("forrest.home");
+ projectHome = getSystemProperty("project.home");
+ if(projectHome.equals(defaultHome)) {
+ projectHome = defaultHome + SystemUtils.FILE_SEPARATOR + "/project";
+ }
+ if(forrestHome.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
+
+ // get forrest.properties and load the values
+ String forrestPropertiesStringURI = projectHome
+ + SystemUtils.FILE_SEPARATOR + "forrest.properties";
- // get location of project.home
- projectHome = getAndResolveSystemProperty("project.home");
+ filteringProperties =
+ loadAntPropertiesFromURI(filteringProperties,forrestPropertiesStringURI);
+
// get default-forrest.properties and load the values
- String defaultRorrestPropertiesStringURI = forrestHome
+ String defaultRorrestPropertiesStringURI = contextHome
+ SystemUtils.FILE_SEPARATOR
+ "default-forrest.properties";
- System.out.println("defaultRorrestPropertiesStringURI:"
- + defaultRorrestPropertiesStringURI);
+ filteringProperties =
+ loadAntPropertiesFromURI(filteringProperties,defaultRorrestPropertiesStringURI);
+
+ if (debugging()) debug("Loaded project forrest.properties:" + filteringProperties);
+ }
+
+ /**
+ * @param antPropertiesStringURI
+ * @throws MalformedURLException
+ * @throws IOException
+ * @throws SourceNotFoundException
+ */
+ private AntProperties loadAntPropertiesFromURI(AntProperties precedingProperties, String antPropertiesStringURI) throws MalformedURLException, IOException, SourceNotFoundException {
+
Source source = null;
InputStream in = null;
try {
- System.out.println("using resolver:" + m_resolver);
- source = m_resolver.resolveURI(defaultRorrestPropertiesStringURI);
-
- System.out.println("Resolved URI:" + source);
+
+ source = m_resolver.resolveURI(antPropertiesStringURI);
+ if (debugging()) debug("Searching for forrest.properties in"
+ + source.getURI());
in = source.getInputStream();
- filteringProperties = new AntProperties();
+ filteringProperties = new AntProperties(precedingProperties);
filteringProperties.load(in);
- System.out.println("Loaded defaults:" + filteringProperties);
-
- } finally {
- if (source != null) {
- m_resolver.release(source);
- }
- if (in != null) {
- try {
- in.close();
- } catch (IOException e) {}
- }
- }
-
- // get forrest.properties and load the values
- String forrestPropertiesStringURI = projectHome
- + SystemUtils.FILE_SEPARATOR + "forrest.properties";
- System.out.println("forrestPropertiesStringURI:"
- + forrestPropertiesStringURI);
-
- try {
- System.out.println("using resolver:" + m_resolver);
- source = m_resolver.resolveURI(forrestPropertiesStringURI);
-
- System.out.println("Resolved URI:" + source);
+ if (debugging()) debug("Loaded:" + antPropertiesStringURI +
+ filteringProperties.toString());
- in = source.getInputStream();
- filteringProperties = new AntProperties(filteringProperties);
- filteringProperties.load(in);
} finally {
if (source != null) {
m_resolver.release(source);
@@ -146,63 +189,28 @@
} catch (IOException e) {}
}
}
-
- System.out.println("Loaded project stuff:" + filteringProperties);
-
- //add forrest.home and project.home to properties
- filteringProperties.setProperty("forrest.home", forrestHome);
- filteringProperties.setProperty("project.home", projectHome);
-
- System.out.println("Loaded all:" + filteringProperties);
-
+
+ return filteringProperties;
}
- public Object[] getAttributeValues(String name, Configuration modeConf,
- Map objectModel) throws ConfigurationException {
- Object[] attributeValues = super.getAttributeValues(name, modeConf,
- objectModel);
- for (int i = 0; i < attributeValues.length; i++) {
- attributeValues[i] = filteringProperties.filter(attributeValues[i]
- .toString());
- }
-
- return attributeValues;
- }
-
- public Object getAttribute(String name, Configuration modeConf,
- Map objectModel) throws ConfigurationException {
- String original = super.getAttributeValues(name, modeConf, objectModel)[0]
- .toString();
- String attributeValue = this.getAttributeValues(name, modeConf,
- objectModel)[0].toString();
-
- System.out.println(" - Requested:" + name);
- System.out.println(" - Original:" + original);
- System.out.println(" - Given:" + attributeValue);
- return attributeValue;
- }
-
- private final String getAndResolveSystemProperty(String propertyName)
- throws MalformedURLException, IOException {
- String raw = System.getProperty(propertyName, ".");
-
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("raw " + propertyName + "=" + raw);
-
- }
-
- System.out.println("raw " + propertyName + "=" + raw);
- System.out.println("resolver: " + m_resolver);
-
- String value = m_resolver.resolveURI(raw).getURI();
-
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("resolved " + propertyName + "=" + value);
-
- }
-
- return raw;
+ public void service(ServiceManager manager) throws ServiceException {
+ m_resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
}
+
+ /**
+ * Rocked science
+ */
+ private final boolean debugging() {
+ return getLogger().isDebugEnabled();
+ }
+
+ /**
+ * Rocked science
+ * @param debugString
+ */
+ private final void debug(String debugString) {
+ getLogger().debug(debugString);
+ }
+
}
-