You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pi...@apache.org on 2002/05/05 03:58:22 UTC
cvs commit: jakarta-tomcat-connectors/webapp/docs/images corner.gif jakarta.gif pixel.gif webapp.gif
pier 02/05/04 18:58:22
Added: webapp/docs building.xml cvs.xml index.xml menu.idx
style.css style.xsl
webapp/docs/images corner.gif jakarta.gif pixel.gif
webapp.gif
Log:
Added new documentation in XML.
Revision Changes Path
1.1 jakarta-tomcat-connectors/webapp/docs/building.xml
Index: building.xml
===================================================================
<?xml version="1.0"?>
<document title="Building WebApp">
<description>
Building the WebApp Module
</description>
<section title="Windows Users">
<description>
Note for Microsoft Windows operating system users
</description>
<p>
<b>Nope, the WebApp module still doesn't run under Windows and currently
any Microsoft operating system is not supported.</b> Since the past
release, though, many improvements were made, and we had positive repors
that the WebApp module actually tries to work also in that environment.
</p>
<p>
The effort to bring WebApp under Microsoft Windows lacks of active
developers, people (<b>like you</b>) who have access to this set of
operating systems (from Windows 98 to XP), have access to their
development tools and can make the difference.
</p>
<p>
Multi-threaded support has now been added since the multi threaded
environment is now available also under UNIX based operating systems via
Apache 2.0, therefore the only things left to do are a little bit of
porting (not much, since the WebApp module is based on the , which does
most of the job for you) and a lot of testing.
</p>
<p>
<b>You</b> will be more than welcome to join the effort.
</p>
</section>
<section title="Sources or CVS">
<description>
Getting a hold on the sources: tarball or CVS?
</description>
<todo/>
</section>
<section title="Prerequisites">
<description>
What other software you need to have to build the module
</description>
<todo/>
</section>
</document>
1.1 jakarta-tomcat-connectors/webapp/docs/cvs.xml
Index: cvs.xml
===================================================================
<?xml version="1.0"?>
<document title="CVS Access">
<description>
How to download the WebApp sources from CVS
</description>
<section title="Environment">
<description>
Setting up your CVS work environment
</description>
<p>
First of all set up your CVSROOT environment variable and log in onto
our CVS server. When prompted for a password, you can enter <b>anoncvs</b>:
</p>
<screen>
<note>if you're using CSH/TCSH</note>
<type>setenv CVSROOT :pserver:anoncvs@apache.org:/home/cvspublic</type>
<type/>
<note>if you're using SH/BASH</note>
<type>CVSROOT=":pserver:anoncvs@apache.org:/home/cvspublic</type>
<type>export CVSROOT</type>
<type/>
<note>and then log in on the CVS server</note>
<type>cvs login</type>
<read>(Logging in to anoncvs@cvs.apache.org)</read>
<read>CVS password: <enter>anoncvs</enter></read>
<type/>
</screen>
<p>
You then have to check out the sources of the WebApp module, those
reside in the <b>jakarta-tomcat-connectors</b> repository, under the
<b>webapp</b> directory. To check the sources out, do:
</p>
<screen>
<type>cvs checkout jakarta-tomcat-connectors/webapp</type>
<read>cvs server: Updating jakarta-tomcat-connectors/webapp</read>
<read>U jakarta-tomcat-connectors/webapp/.cvsignore</read>
<wait/>
<read>U jakarta-tomcat-connectors/webapp/support/wa_version.m4</read>
<read>cvs server: Updating webapplib</read>
<type/>
<note>and let's move them into a more accessible location</note>
<type>mv jakarta-tomcat-connectors/webapp webapp</type>
<type>rm -rf jakarta-tomcat-connectors</type>
<type/>
<note>then it's always better to clean up the checked out structure</note>
<type>cd webapp</type>
<type dir="webapp">cvs update -APd</type>
<read>cvs server: Updating .</read>
<read>cvs server: Updating apache-1.3</read>
<wait/>
<read>cvs server: Updating support</read>
<read>cvs server: Updating webapplib</read>
<type dir="webapp">cd ..</type>
<type/>
</screen>
</section>
<section title="APR sources">
<description>
Dealing with the Apache Portable Runtime sources
</description>
<p>
Perfect. Now, if you're building the WebApp module for Apache 2.0, you
won't need to check out the Apache Portable Runtime library, since it is
already included into the web server distribution. If, instead, you are
building the WebApp module for Apache 1.3, you <b>need</b> to obtain a
copy of APR, and you can do that checking out a copy of their CVS
repository (namedly, <b>apr</b>):
</p>
<screen>
<type>cvs checkout apr</type>
<read>cvs server: Updating apr</read>
<read>U apr/.cvsignore</read>
<wait/>
<read>U apr/user/win32/groupinfo.c</read>
<read>U apr/user/win32/userinfo.c</read>
<type>mv apr jakarta-tomcat-connectors/webapp</type>
<note>and let's clean up this directory structure as well</note>
<type>cd apr</type>
<type dir="apr">cvs update -APd</type>
<read>cvs server: Updating .</read>
<read>cvs server: Updating atomic</read>
<wait/>
<read>cvs server: Updating user/unix</read>
<read>cvs server: Updating user/win32</read>
<type dir="apr">cd ..</type>
<type/>
</screen>
</section>
<section title="AutoConf">
<description>
All that AutoConf magic
</description>
<p>
Great, now, for semplicity's sake we can move the APR directory in the
WebApp module directory, as it is in all pre-rolled source distribution
tarballs, and create the <b>configure</b> script. Please note that
WebApp <b>requires</b> GNU AutoConf version 2.52 or greater to build the
<b>configure</b> script from its M4 sources, if you don't have this
version, you can easily download a nigtly source distribution, which
includes a pre-built <b>configure</b> script.
</p>
<screen>
<note>let's move APR within the WebApp module directory</note>
<type>mv apr webapp</type>
<type/>
<note>and create the configure script for both of them</note>
<type>cd webapp</type>
<type dir="webapp">./support/buildconf.sh</type>
<read>--- Checking "autoconf" version</read>
<read>autoconf version 2.52 detected.</read>
<wait/>
<read>Creating configure ...</read>
<read>--- All done</read>
<type dir="webapp">cd ..</type>
<type/>
</screen>
<p>
Please note that if you didn't move the APR directory inside the WebApp
module directory, the <b>buildconf.sh</b> script will nag about not
finding the APR sources, you just have to generate APR's configure as
well, and then, when you're going to run the configure script for the
WebApp module, you'll have to specify the <b>--with-apr=directory</b>
parameter on the command line, of course replacing <b>directory</b> with
the path of where you checked out the APR sources, right?
</p>
<screen>
<type dir="webapp">./support/buildconf.sh</type>
<wait/>
<read>--- Cannot run APR "buildconf" script</read>
<read>If you need to build the WebApp module for Apache 1.3</read>
<read>you will have to download the APR library sources from</read>
<read>http://apr.apache.org/ and run its "buildconf" script</read>
<wait/>
<read>Creating configure ...</read>
<read>--- All done</read>
<type dir="webapp">cd ..</type>
<type>cd apr</type>
<type dir="apr">./buildconf</type>
<read>buildconf: checking installation...</read>
<read>buildconf: autoconf version 2.52 (ok)</read>
<wait/>
<read>Creating include/arch/unix/apr_private.h.in ...</read>
<read>Creating configure ...</read>
<type dir="apr">cd ..</type>
<type/>
</screen>
</section>
<section title="Conclusion">
<description>
Whoha, that's IT?
</description>
<p>
That's it, now you basically have a full WebApp module source
distribution (well, apart from this documentation, which gets generated
when we roll the sources tarballs). Now you're ready to go and try out
the incredible wonders (and bugs) of the very latest sources of the
WebApp module.
</p>
</section>
</document>
1.1 jakarta-tomcat-connectors/webapp/docs/index.xml
Index: index.xml
===================================================================
<?xml version="1.0"?>
<document title="Introduction" description="The WebApp Module for the Apache Web Server">
<section title="Description" description="What is the WebApp Module"/>
<section title="Purpose" description="Why should I use the WebApp Module?"/>
<section title="Alternatives" description="Are there alternative ways to connect Apache and Tomcat?"/>
</document>
1.1 jakarta-tomcat-connectors/webapp/docs/menu.idx
Index: menu.idx
===================================================================
<?xml version="1.0"?>
<index>
<document href="index.xml"/>
<document href="building.xml"/>
<document href="cvs.xml"/>
</index>
1.3 +107 -77 jakarta-tomcat-connectors/webapp/docs/style.css
1.1 jakarta-tomcat-connectors/webapp/docs/style.xsl
Index: style.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/xhtml1/strict">
<!--
Let's start by declaring HOW this stylesheet must behave.
-->
<xsl:output method="html" indent="no"
doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>
<!--
Match the ROOT of the source document and process its "document" element.
-->
<xsl:template match="/">
<xsl:apply-templates select="document"/>
</xsl:template>
<!--
Match the roote "document" element, let's prepare the layout of the whole
page.
-->
<xsl:template match="document">
<html>
<!--
This is the page header, we want a title from this document title
the <meta> copyright statement and all authors in "meta" headers.
-->
<head>
<title>
<xsl:if test="string-length(description/text()) = 0">
<xsl:value-of select="@title"/>
</xsl:if>
<xsl:value-of select="description/text()"/>
</title>
<meta name="copyright" content="1999-2002 The Apache Software Foundation"/>
<xsl:for-each select="author">
<meta name="author" content="text()"/>
<meta name="author" content="@email"/>
</xsl:for-each>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<!--
This describes the layout of the page
-->
<body bgcolor="#ffffff" text="#000000" alink="#666666" vlink="#333333" link="#666666">
<a name="TOP"/>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<!--
An empty row (thank you stupid IE).
-->
<tr height="1">
<td width="150" bgcolor="#666666" height="1" class="nil">
<img src="images/pixel.gif" border="0" width="150" height="1" vspace="0" hspace="0"/>
</td>
<td width="*" bgcolor="#666666" height="1" class="nil">
<img src="images/pixel.gif" border="0" width="570" height="1" vspace="0" hspace="0"/>
</td>
</tr>
<!--
Our first row contains the Jakarta and the WebApp logos.
-->
<tr>
<td bgcolor="#666666" class="logo" colspan="2" width="*">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left">
<img src="images/jakarta.gif" border="0" width="270" height="75" align="left"/>
</td>
<td align="right">
<img src="images/webapp.gif" border="0" width="400" height="75" align="right"/>
</td>
</tr>
</table>
</td>
</tr>
<!--
A Turbine-style bar with links to the ASF, Jakarta and Tomcat.
-->
<tr>
<td bgcolor="#999999" class="head" align="right" width="*" colspan="2">
<nobr>
<a class="head" href="http://www.apache.org/">
<xsl:text>Apache Software Foundation</xsl:text>
</a> |
<a class="head" href="http://jakarta.apache.org/">
<xsl:text>Jakarta Project</xsl:text>
</a> |
<a class="head" href="http://jakarta.apache.org/tomcat/">
<xsl:text>Apache Tomcat</xsl:text>
</a>
</nobr>
</td>
</tr>
<!--
Sidebar menu in a nested table and main content.
-->
<tr>
<td bgcolor="#ffffff" width="150" valign="top">
<!--
This is the sidebar menu, we have links to all documents specified
in "menu.idx", and if this is the current document, we go deeper
and write an index of the sections as well.
-->
<table border="0" width="150" cellspacing="0" cellpadding="0" class="menu">
<!-- Empty row, thanks IE -->
<tr height="1">
<td width="10" bgcolor="#cccccc" height="1" class="nil">
<img src="images/pixel.gif" border="0" width="10" height="1" vspace="0" hspace="0"/>
</td>
<td width="140" bgcolor="#cccccc" height="1" class="nil">
<img src="images/pixel.gif" border="0" width="140" height="1" vspace="0" hspace="0"/>
</td>
</tr>
<!--
All the files we want to have processed in the final pages are
stored (in order) in a file called "menu.idx". We set a variable
name with the current URL, and then we process each "document"
within the index.
-->
<xsl:variable name="root" select="document-location(.)"/>
<xsl:for-each select="document('menu.idx')/index/document">
<tr>
<td bgcolor="#cccccc" width="150" colspan="2">
<nobr>
<a class="menu">
<xsl:call-template name="converturi">
<xsl:with-param name="href" select="@href"/>
</xsl:call-template>
</a>
</nobr>
</td>
</tr>
<!--
Slightly more complicated, we use the document-location function
and compare against it to see whether we are in the same file or
not. If we actually are, we expand to the "section" level.
-->
<xsl:if test="$root = document-location(document(@href))">
<xsl:for-each select="document(@href)/document/section">
<tr>
<td bgcolor="#cccccc" width="10"/>
<td bgcolor="#cccccc" width="140">
<a class="menu" href="#section_{position()}">
<xsl:value-of select="@title"/>
</a>
</td>
</tr>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</table>
</td>
<!--
Done with the sidebar, now, do we want some content as well or WHAT?
-->
<td bgcolor="#ffffff" width="*" valign="top" class="body">
<xsl:apply-templates select="section"/>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
<!--
Match the "author" tag only in mode "header" (meaning that we have to
process it for the HTML <head> element.
-->
<xsl:template match="author" mode="header">
<meta name="author" content="{text()}"/>
<meta name="email" content="{@email}"/>
</xsl:template>
<!--
Present a canonical representation of an author.
-->
<xsl:template match="author">
<a href="mailto:{@email}"><xsl:value-of select="text()"/></a>
</xsl:template>
<xsl:template match="section">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td bgcolor="#666666" class="section" valign="top" align="left">
<img src="images/corner.gif" valign="top" align="left" hspace="0" vspace="0" border="0"/>
<xsl:if test="string-length(description/text()) = 0">
<xsl:value-of select="@title"/>
</xsl:if>
<xsl:value-of select="description/text()"/>
</td>
</tr>
</table>
<xsl:apply-templates select="p|screen|todo"/>
<br/>
</xsl:template>
<xsl:template match="todo">
<p class="todo">
This paragraph has not been written yet, but <b>you</b> can contribute to it.
<xsl:if test="string-length(@note) > 0">
The original author left a note attached to this TO-DO item:
<b><xsl:value-of select="@note"/></b>
</xsl:if>
</p>
</xsl:template>
<xsl:template match="p">
<p class="section"><xsl:apply-templates select="b|text()"/></p>
</xsl:template>
<xsl:template match="b">
<b><font color="#333333"><xsl:apply-templates select="text()"/></font></b>
</xsl:template>
<xsl:template match="br">
<br/>
</xsl:template>
<xsl:template match="screen">
<p class="screen">
<div align="center">
<table width="80%" border="1" cellspacing="0" cellpadding="2" bgcolor="#cccccc">
<tr>
<td bgcolor="#cccccc">
<xsl:apply-templates select="note|wait|type|read"/>
</td>
</tr>
</table>
</div>
</p>
</xsl:template>
<xsl:template match="note">
<div class="screen">
<xsl:value-of select="text()"/>
</div>
</xsl:template>
<xsl:template match="wait">
<div class="screen">[...]</div>
</xsl:template>
<xsl:template match="type">
<code>
<nobr>
<em class="screen">
<xsl:text>[user@host] ~</xsl:text>
<xsl:if test="string-length(@dir) > 0">
<xsl:text>/</xsl:text>
<xsl:value-of select="@dir"/>
</xsl:if>
<xsl:text> $ </xsl:text>
</em>
<xsl:if test="string-length(text()) > 0">
<b class="screen"><xsl:value-of select="text()"/></b>
</xsl:if>
</nobr>
</code>
<br/>
</xsl:template>
<xsl:template match="read">
<code>
<nobr>
<xsl:apply-templates select="text()|enter"/>
</nobr>
</code>
<br/>
</xsl:template>
<xsl:template match="enter">
<b class="screen"><xsl:value-of select="text()"/></b>
</xsl:template>
<xsl:template match="a">
<b>
<a>
<xsl:call-template name="converturi">
<xsl:with-param name="href" select="@href"/>
<xsl:with-param name="text" select="text()"/>
<xsl:with-param name="attr" select="'href'"/>
</xsl:call-template>
</a>
</b>
</xsl:template>
<!--
Convert the name of the matching "href" attribute (if needed) from
"file.xml#anchor" to "file.html#anchor", and insert the title of
the target document as the only text child of the resulting html
<a /> tag. (Of course, don't convert fully qualified URIs).
-->
<xsl:template name="converturi">
<xsl:param name="attr" select="'href'"/>
<xsl:param name="href" select="''"/>
<xsl:param name="text" select="''"/>
<xsl:choose>
<!--
If the "href" parameter contains ":" this is most definitely an URL,
therefore we need to quote it "as is" without translating its value.
The text is either supplied, or it's the value of the URL itself
(without the trailing anchor, if any).
-->
<xsl:when test="contains($href,':')">
<xsl:attribute name="{$attr}"><xsl:value-of select="$href"/></xsl:attribute>
<xsl:if test="string-length($text) = 0">
<xsl:choose>
<xsl:when test="contains($href,'#')">
<xsl:value-of select="substring-before($href,'#')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$href"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:value-of select="$text"/>
</xsl:when>
<!--
Nope, we don't have a full URL, therefore we interpret this as a
relative hyperlink to another document. We need to translate its
name from "*.xml" to "*.html" (because this is how we convert the
names) and the text included in this will be the title of the
target document.
-->
<xsl:otherwise>
<!--
The "file" variable contains the part of the "href" before
the "#" character. Yes, the "file" name.
-->
<xsl:variable name="file">
<xsl:choose>
<xsl:when test="contains($href,'#')">
<xsl:value-of select="substring-before($href,'#')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$href" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!--
Like "file" the "anchor" variable contains the part of the "href"
after the "#" character.
-->
<xsl:variable name="anchor">
<xsl:if test="contains($href,'#')">
<xsl:value-of select="'#'" />
<xsl:value-of select="substring-after($href,'#')" />
</xsl:if>
</xsl:variable>
<!--
Good, now we check if "file" ends in ".xml", if so, we replace that
with ".html", otherwise we keep its original value, then we add the
anchor we gathered before. We call this "target".
-->
<xsl:variable name="target">
<xsl:if test="string-length($file) > 0">
<xsl:choose>
<xsl:when test="substring($file,string-length($file)-3) = '.xml'">
<xsl:value-of select="substring($file,1,string-length($file)-3)"/>
<xsl:value-of select="'html'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$file"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:value-of select="$anchor"/>
</xsl:variable>
<!--
Now, we want to set the attribute to contain the "target" variable.
-->
<xsl:attribute name="{$attr}">
<xsl:value-of select="$target"/>
</xsl:attribute>
<!--
To finish we want to set the body of this element: if we have "text"
the body of the element will be just that, otherwise, it will be
the "target" value (the translated href) if there was no text,
or the "title" of the target document if we actually translated
something
-->
<xsl:if test="string-length($text) = 0">
<xsl:choose>
<xsl:when test="$target = $href">
<xsl:value-of select="$file"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="document($file)/document/@title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
1.1 jakarta-tomcat-connectors/webapp/docs/images/corner.gif
<<Binary file>>
1.1 jakarta-tomcat-connectors/webapp/docs/images/jakarta.gif
<<Binary file>>
1.1 jakarta-tomcat-connectors/webapp/docs/images/pixel.gif
<<Binary file>>
1.1 jakarta-tomcat-connectors/webapp/docs/images/webapp.gif
<<Binary file>>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>