vmassol 2003/01/28 06:58:22
Modified: documentation/docs/dtds sitemap-v10.dtd
documentation build.xml
documentation/src/java/org/apache/cactus/documentation
CheckSitemapTask.java
documentation/docs/skins/jakarta.apache.org/stylesheets
common.xsl document2html.xsl
documentation/docs/xdocs sitemap.xml
Log:
- Added support for arbitrary file types for <link>, <jump>, etc tags. We are now
able to use
"site:" mechanism for images
- Modified DTD for <resource> in sitemap. Attribute has been changed from "source"
to "target" as it now represents the location of the generated file
- Updated the checksitemap task in accordance and modified build script so that the
check for broken links now happens after the doc generation and it is performed on the
generated tree (and not on the source tree)
Revision Changes Path
1.6 +1 -1 jakarta-cactus/documentation/docs/dtds/sitemap-v10.dtd
Index: sitemap-v10.dtd
===================================================================
RCS file: /home/cvs/jakarta-cactus/documentation/docs/dtds/sitemap-v10.dtd,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sitemap-v10.dtd 28 Jan 2003 14:12:34 -0000 1.5
+++ sitemap-v10.dtd 28 Jan 2003 14:58:22 -0000 1.6
@@ -24,7 +24,7 @@
<!ELEMENT resource (#PCDATA)>
<!ATTLIST resource
id ID #REQUIRED
- source CDATA #IMPLIED
+ target CDATA #IMPLIED
name CDATA #IMPLIED
check CDATA #IMPLIED
>
1.32 +25 -28 jakarta-cactus/documentation/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/documentation/build.xml,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- build.xml 22 Jan 2003 17:52:47 -0000 1.31
+++ build.xml 28 Jan 2003 14:58:22 -0000 1.32
@@ -151,8 +151,7 @@
Compile utility Java code
========================================================================
-->
- <target name="compile"
- depends="init"
+ <target name="compile" depends="init"
description="Compile utility Java code">
<mkdir dir="${target.classes.java.dir}"/>
@@ -166,8 +165,7 @@
Generate the documentation
========================================================================
-->
- <target name="doc.prepare"
- depends="init">
+ <target name="doc.prepare" depends="init">
<mkdir dir="${target.xdoc.dir}"/>
<mkdir dir="${target.doc.dir}"/>
@@ -205,9 +203,7 @@
</target>
- <target name="doc.cvschangelog"
- depends="doc.prepare"
- unless="offline">
+ <target name="doc.cvschangelog" depends="init" unless="offline">
<!-- Generate CVS log -->
<mkdir dir="${target.xdoc.dir}/cvslog"/>
@@ -227,8 +223,7 @@
</target>
- <target name="doc.validate"
- depends="doc.cvschangelog">
+ <target name="doc.validate" depends="doc.prepare">
<xmlvalidate warn="yes">
<xmlcatalog refid="documentation.dtds"/>
@@ -240,25 +235,7 @@
</target>
- <target name="doc.checksitemap"
- depends="compile, doc.validate">
-
- <taskdef name="checksitemap"
- classname="org.apache.cactus.documentation.CheckSitemapTask">
- <classpath>
- <pathelement location="${target.classes.java.dir}"/>
- </classpath>
- </taskdef>
-
- <!-- Check the sitemap for invalid links -->
- <checksitemap sitemap="${target.xdoc.dir}/sitemap.xml">
- <xmlcatalog refid="documentation.dtds"/>
- </checksitemap>
-
- </target>
-
- <target name="doc"
- depends="doc.checksitemap">
+ <target name="doc.generate" depends="doc.prepare,doc.cvschangelog">
<!-- Generate the docs -->
<style basedir="${target.xdoc.dir}" destdir="${target.doc.dir}"
@@ -293,6 +270,26 @@
</style>
+ </target>
+
+ <target name="doc.checksitemap" depends="compile,doc.prepare">
+
+ <taskdef name="checksitemap"
+ classname="org.apache.cactus.documentation.CheckSitemapTask">
+ <classpath>
+ <pathelement location="${target.classes.java.dir}"/>
+ </classpath>
+ </taskdef>
+
+ <!-- Check the sitemap for invalid links -->
+ <checksitemap sitemap="${target.xdoc.dir}/sitemap.xml"
+ outputDir="${target.doc.dir}">
+ <xmlcatalog refid="documentation.dtds"/>
+ </checksitemap>
+
+ </target>
+
+ <target name="doc" depends="doc.validate,doc.generate,doc.checksitemap">
</target>
<!--
1.4 +41 -19
jakarta-cactus/documentation/src/java/org/apache/cactus/documentation/CheckSitemapTask.java
Index: CheckSitemapTask.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/documentation/src/java/org/apache/cactus/documentation/CheckSitemapTask.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CheckSitemapTask.java 28 Jan 2003 14:12:34 -0000 1.3
+++ CheckSitemapTask.java 28 Jan 2003 14:58:22 -0000 1.4
@@ -93,9 +93,9 @@
private boolean failOnError = true;
/**
- * The directory in which the sitemap is located.
+ * The output directory where files are generated.
*/
- private File sitemapDir;
+ private File outputDir;
/**
* For resolving entities such as DTDs.
@@ -113,6 +113,15 @@
}
/**
+ * @param theOutputDir the location of the output directory where files are
+ * generated
+ */
+ public void setOutputDir(File theOutputDir)
+ {
+ this.outputDir = theOutputDir;
+ }
+
+ /**
* Sets whether the task should fail when an error occurs.
*
* @param theFailOnError Whether to fail on errors
@@ -153,16 +162,21 @@
{
throw new BuildException("The [sitemap] attribute must be set");
}
+ if (this.outputDir == null)
+ {
+ throw new BuildException("The [outputDir] attribute must be set");
+ }
+
if (!this.sitemap.exists())
{
throw new BuildException(
"The [sitemap] attribute must point to an existing file");
}
- log("Checking sitemap at " + sitemap + "", Project.MSG_INFO);
-
- this.sitemapDir = sitemap.getParentFile();
-
+ log("Checking sitemap at [" + sitemap + "]", Project.MSG_INFO);
+ log("Generated doc output directory is [" + outputDir + "]",
+ Project.MSG_INFO);
+
try
{
DocumentBuilder builder = getDocumentBuilder();
@@ -234,22 +248,28 @@
*/
private boolean checkSitemapResource(Element theElement)
{
+ String id = theElement.getAttribute("id");
+
if (isResourceToBeChecked(theElement))
{
- String id = theElement.getAttribute("id");
- String source = theElement.getAttribute("source");
+ String target = theElement.getAttribute("target");
- if ((source == null) || (source.length() == 0))
+ if ((target == null) || (target.length() == 0))
{
log("Skipping remote resource [" + id + "]",
Project.MSG_VERBOSE);
}
else
{
- checkLocalSitemapResource(id, source);
+ checkLocalSitemapResource(id, target);
}
}
+ else
+ {
+ log("This resource should not be checked: [" + id + "]",
+ Project.MSG_VERBOSE);
+ }
return true;
}
@@ -262,7 +282,9 @@
{
// Checks are enabled by default
boolean isToBeChecked = true;
- if (theElement.getAttribute("check") != null)
+
+ if ((theElement.getAttribute("check") != null)
+ && (theElement.getAttribute("check").length() > 0))
{
isToBeChecked =
(new Boolean(theElement.getAttribute("check"))).booleanValue();
@@ -275,20 +297,20 @@
* file.
*
* @param theId The <code>id</code> attribute of the resource element
- * @param theSource The <code>source</code> attribute of the resource
+ * @param theTarget The <code>target</code> attribute of the resource
* element, the relative path from the directory containing the sitemap file
- * to the resource file
+ * to the generated file
* @return Whether the file exists
*/
- private boolean checkLocalSitemapResource(String theId, String theSource)
+ private boolean checkLocalSitemapResource(String theId, String theTarget)
{
- File sourceFile = new File(sitemapDir, theSource);
- log("Checking resource [" + theId + "] at [" + theSource + "]",
+ File targetFile = new File(this.outputDir, theTarget);
+ log("Checking resource [" + theId + "] at [" + theTarget + "]",
Project.MSG_DEBUG);
- if (!sourceFile.exists())
+ if (!targetFile.exists())
{
log("Sitemap resource [" + theId + "] not found under ["
- + theSource + "]", Project.MSG_ERR);
+ + targetFile + "]", Project.MSG_ERR);
return false;
}
return true;
1.3 +2 -4
jakarta-cactus/documentation/docs/skins/jakarta.apache.org/stylesheets/common.xsl
Index: common.xsl
===================================================================
RCS file:
/home/cvs/jakarta-cactus/documentation/docs/skins/jakarta.apache.org/stylesheets/common.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- common.xsl 18 Jan 2003 14:57:59 -0000 1.2
+++ common.xsl 28 Jan 2003 14:58:22 -0000 1.3
@@ -121,15 +121,13 @@
<xsl:template name="get-target-file">
<xsl:param name="id"/>
- <xsl:param name="extension"/>
<xsl:variable name="source">
<xsl:call-template name="get-source-from-id">
<xsl:with-param name="id" select="$id"/>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name="get-base-directory"/>
- <xsl:value-of select="substring($source,0,string-length($source)-3)"/>
- <xsl:text>.</xsl:text><xsl:value-of select="$extension"/>
+ <xsl:value-of select="$source"/>
</xsl:template>
</xsl:stylesheet>
1.23 +1 -2
jakarta-cactus/documentation/docs/skins/jakarta.apache.org/stylesheets/document2html.xsl
Index: document2html.xsl
===================================================================
RCS file:
/home/cvs/jakarta-cactus/documentation/docs/skins/jakarta.apache.org/stylesheets/document2html.xsl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- document2html.xsl 22 Jan 2003 18:21:13 -0000 1.22
+++ document2html.xsl 28 Jan 2003 14:58:22 -0000 1.23
@@ -683,7 +683,6 @@
<xsl:when test="starts-with(@href,'site:')">
<xsl:call-template name="get-target-file">
<xsl:with-param name="id" select="substring-after(@href,'site:')"/>
- <xsl:with-param name="extension" select="'html'"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="starts-with(@href,'ext:')">
1.8 +64 -64 jakarta-cactus/documentation/docs/xdocs/sitemap.xml
Index: sitemap.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/sitemap.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- sitemap.xml 28 Jan 2003 14:13:44 -0000 1.7
+++ sitemap.xml 28 Jan 2003 14:58:22 -0000 1.8
@@ -7,91 +7,91 @@
<!-- Internal links -->
- <resource id="index" source="index.xml" name="What is Cactus?">
+ <resource id="index" target="index.html" name="What is Cactus?">
Describes what is the Cactus framework, defines several types of
unit tests and explains what are those best achieved with Cactus.
</resource>
- <resource id="news" source="news.xml" name="News">
+ <resource id="news" target="news.html" name="News">
Latest news and events about Cactus.
</resource>
- <resource id="changes" source="changes.xml" name="Changes">
+ <resource id="changes" target="changes.html" name="Changes">
Cactus release changelogs and list of all the web site pages that
have been recently changed.
</resource>
- <resource id="features" source="features.xml" name="Features/Status">
+ <resource id="features" target="features.html" name="Features/Status">
Cactus feature list.
</resource>
- <resource id="goals" source="goals.xml" name="Goals">
+ <resource id="goals" target="goals.html" name="Goals">
Short and long term goals for Cactus.
</resource>
- <resource id="todo" source="participating/todo.xml" name="Roadmap/Todo">
+ <resource id="todo" target="participating/todo.html" name="Roadmap/Todo">
List of todo tasks for the next Cactus releases.
</resource>
- <resource id="contributors" source="participating/contributors.xml"/>
- <resource id="contributing" source="participating/contributing.xml"/>
- <resource id="users" source="participating/users.xml"/>
- <resource id="testedon" source="testedon.xml"/>
- <resource id="license" source="license.xml"/>
- <resource id="downloads" source="downloads.xml"/>
- <resource id="how_it_works" source="how_it_works.xml"/>
- <resource id="how_it_works_uml" source="how_it_works_uml.xml"/>
- <resource id="getting_started" source="getting_started.xml"/>
- <resource id="mock_vs_cactus" source="mock_vs_cactus.xml"/>
- <resource id="javadoc" source="javadoc.xml"/>
- <resource id="javadoc_12" source="javadoc_12.xml"/>
- <resource id="javadoc_13" source="javadoc_13.xml"/>
- <resource id="faq" source="faq.xml"/>
- <resource id="eclipse_plugin" source="spines/eclipse/eclipse_plugin.xml"/>
- <resource id="howto_classpath" source="spines/manual/howto_classpath.xml"/>
- <resource id="howto_config" source="spines/manual/howto_config.xml"/>
- <resource id="howto_migration" source="howto_migration.xml"/>
- <resource id="howto_testcase" source="writing/howto_testcase.xml"/>
- <resource id="howto_testcase_servlet"
source="writing/howto_testcase_servlet.xml"/>
- <resource id="howto_testcase_jsp" source="writing/howto_testcase_jsp.xml"/>
- <resource id="howto_testcase_filter" source="writing/howto_testcase_filter.xml"/>
- <resource id="howto_jsp" source="writing/howto_jsp.xml"/>
- <resource id="howto_runner" source="spines/howto_runner.xml"/>
- <resource id="howto_security" source="writing/howto_security.xml"/>
- <resource id="howto_ant" source="spines/ant/howto_ant.xml"/>
- <resource id="howto_ant_cactus" source="spines/ant/howto_ant_cactus.xml"/>
- <resource id="howto_ant_install" source="spines/ant/howto_ant_install.xml"/>
- <resource id="howto_ant_primer" source="spines/ant/howto_ant_primer.xml"/>
- <resource id="howto_httpunit" source="writing/howto_httpunit.xml"/>
- <resource id="howto_sample" source="howto_sample.xml"/>
- <resource id="howto_ejb" source="writing/howto_ejb.xml"/>
- <resource id="howto_ejb_j2eeri" source="writing/howto_ejb_j2eeri.xml"/>
- <resource id="howto_ide" source="spines/manual/howto_ide.xml"/>
- <resource id="howto_ide_vajava_wte"
source="spines/manual/howto_ide_vajava_wte.xml"/>
- <resource id="howto_ide_vajava_tomcat"
source="spines/manual/howto_ide_vajava_tomcat.xml"/>
- <resource id="howto_ide_jbuilder4"
source="spines/manual/howto_ide_jbuilder4.xml"/>
- <resource id="howto_ide_jbuilder5"
source="spines/manual/howto_ide_jbuilder5.xml"/>
- <resource id="howto_tomcat" source="spines/browser/howto_tomcat.xml"/>
- <resource id="howto_junitee" source="spines/browser/howto_junitee.xml"/>
- <resource id="mailinglist" source="mailinglist.xml"/>
- <resource id="cactusname" source="cactusname.xml"/>
- <resource id="logos" source="participating/logos.xml"/>
- <resource id="resources" source="resources.xml"/>
- <resource id="coverage" source="participating/coverage.xml"/>
- <resource id="coverage_12" source="participating/coverage_12.xml"/>
- <resource id="coverage_13" source="participating/coverage_13.xml"/>
- <resource id="coverage_empty" source="participating/coverage_empty.xml"/>
- <resource id="webalizer" source="webalizer.xml"/>
- <resource id="coding_conventions" source="participating/coding_conventions.xml"/>
- <resource id="build_result" source="build_result.xml"/>
- <resource id="release_checklist" source="participating/release_checklist.xml"/>
- <resource id="howto_build" source="participating/howto_build.xml"/>
+ <resource id="contributors" target="participating/contributors.html"/>
+ <resource id="contributing" target="participating/contributing.html"/>
+ <resource id="users" target="participating/users.html"/>
+ <resource id="testedon" target="testedon.html"/>
+ <resource id="license" target="license.html"/>
+ <resource id="downloads" target="downloads.html"/>
+ <resource id="how_it_works" target="how_it_works.html"/>
+ <resource id="how_it_works_uml" target="how_it_works_uml.html"/>
+ <resource id="getting_started" target="getting_started.html"/>
+ <resource id="mock_vs_cactus" target="mock_vs_cactus.html"/>
+ <resource id="javadoc" target="javadoc.html"/>
+ <resource id="javadoc_12" target="javadoc_12.html"/>
+ <resource id="javadoc_13" target="javadoc_13.html"/>
+ <resource id="faq" target="faq.html"/>
+ <resource id="eclipse_plugin" target="spines/eclipse/eclipse_plugin.html"/>
+ <resource id="howto_classpath" target="spines/manual/howto_classpath.html"/>
+ <resource id="howto_config" target="spines/manual/howto_config.html"/>
+ <resource id="howto_migration" target="howto_migration.html"/>
+ <resource id="howto_testcase" target="writing/howto_testcase.html"/>
+ <resource id="howto_testcase_servlet"
target="writing/howto_testcase_servlet.html"/>
+ <resource id="howto_testcase_jsp" target="writing/howto_testcase_jsp.html"/>
+ <resource id="howto_testcase_filter" target="writing/howto_testcase_filter.html"/>
+ <resource id="howto_jsp" target="writing/howto_jsp.html"/>
+ <resource id="howto_runner" target="spines/howto_runner.html"/>
+ <resource id="howto_security" target="writing/howto_security.html"/>
+ <resource id="howto_ant" target="spines/ant/howto_ant.html"/>
+ <resource id="howto_ant_cactus" target="spines/ant/howto_ant_cactus.html"/>
+ <resource id="howto_ant_install" target="spines/ant/howto_ant_install.html"/>
+ <resource id="howto_ant_primer" target="spines/ant/howto_ant_primer.html"/>
+ <resource id="howto_httpunit" target="writing/howto_httpunit.html"/>
+ <resource id="howto_sample" target="howto_sample.html"/>
+ <resource id="howto_ejb" target="writing/howto_ejb.html"/>
+ <resource id="howto_ejb_j2eeri" target="writing/howto_ejb_j2eeri.html"/>
+ <resource id="howto_ide" target="spines/manual/howto_ide.html"/>
+ <resource id="howto_ide_vajava_wte"
target="spines/manual/howto_ide_vajava_wte.html"/>
+ <resource id="howto_ide_vajava_tomcat"
target="spines/manual/howto_ide_vajava_tomcat.html"/>
+ <resource id="howto_ide_jbuilder4"
target="spines/manual/howto_ide_jbuilder4.html"/>
+ <resource id="howto_ide_jbuilder5"
target="spines/manual/howto_ide_jbuilder5.html"/>
+ <resource id="howto_tomcat" target="spines/browser/howto_tomcat.html"/>
+ <resource id="howto_junitee" target="spines/browser/howto_junitee.html"/>
+ <resource id="mailinglist" target="mailinglist.html"/>
+ <resource id="cactusname" target="cactusname.html"/>
+ <resource id="logos" target="participating/logos.html"/>
+ <resource id="resources" target="resources.html"/>
+ <resource id="coverage" target="participating/coverage.html"/>
+ <resource id="coverage_12" target="participating/coverage_12.html"/>
+ <resource id="coverage_13" target="participating/coverage_13.html"/>
+ <resource id="coverage_empty" target="participating/coverage_empty.html"/>
+ <resource id="webalizer" target="webalizer.html"/>
+ <resource id="coding_conventions" target="participating/coding_conventions.html"/>
+ <resource id="build_result" target="build_result.html"/>
+ <resource id="release_checklist" target="participating/release_checklist.html"/>
+ <resource id="howto_build" target="participating/howto_build.html"/>
- <resource id="javadoc_anttasks_api" check="false"
source="api/anttasks/index.html"/>
- <resource id="javadoc_framework_12_api" check="false"
source="api/framework-12/index.html"/>
- <resource id="javadoc_framework_13_api" check="false"
source="api/framework-13/index.html"/>
- <resource id="coverage_clover_12_report" check="false"
source="clover-12/index.html"/>
- <resource id="coverage_clover_13_report" check="false"
source="clover-13/index.html"/>
+ <resource id="javadoc_anttasks_api" check="false"
target="api/anttasks/index.html"/>
+ <resource id="javadoc_framework_12_api" check="false"
target="api/framework-12/index.html"/>
+ <resource id="javadoc_framework_13_api" check="false"
target="api/framework-13/index.html"/>
+ <resource id="coverage_clover_12_report" check="false"
target="clover-12/index.html"/>
+ <resource id="coverage_clover_13_report" check="false"
target="clover-13/index.html"/>
<!-- External links (sorted alphabetically by id) -->
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>