huber 2003/01/07 15:29:20
Added: src/scratchpad/webapp/samples/mail sitemap.xmap
src/scratchpad/webapp/samples/mail/docs/bottom-col-1
index.xml index.xml~
src/scratchpad/webapp/samples/mail/docs/head-col-1 index.xml
index.xsp mail.xsp
src/scratchpad/webapp/samples/mail/docs/mid-col-1 index.xml
index.xsp login.xml mail.xml mail.xsp
src/scratchpad/webapp/samples/mail/docs/mid-col-2 about.xml
asciiart-generator.xml changes.xml
extendedresourceexists-action.xml faq.xml
howto-cocoon-webmail.xml index.xml
linktranslatormap-action.xml login.xml logout.xsp
mail-action.xml mail.xml mail.xsp plans.xml
regexpuridefaults-matcher.xml snapshot.xml
src/scratchpad/webapp/samples/mail/docs/mid-col-3 index.xml
index.xsp logout.xml mail.xml
src/scratchpad/webapp/samples/mail/docs/top-col-1 index.xml
src/scratchpad/webapp/samples/mail/pagesheets htmlpages.xml
mailhtmlpages.xml
src/scratchpad/webapp/samples/mail/resources/asciiart
directory-hierarchy.txt layout.txt
mailaction-dataflow.txt serving-document-page-1.txt
serving-document-page.txt
serving-dynamic-page-1.txt serving-dynamic-page.txt
uri-space.txt
src/scratchpad/webapp/samples/mail/resources/images
built-with-cocoon.gif cocoon-webmail-1.jpg
cocoon-webmail-2.jpg cocoon-webmail-3.jpg
favicon.ico powered-by-cocoon.png
src/scratchpad/webapp/samples/mail/resources/styles main.css
src/scratchpad/webapp/samples/mail/stylesheets
filterlinks.xsl mail-envelopes2document.xsl
mail-folder2document.xsl mail-message2document.xsl
mail-unknown2document.xsl mail2document.xsl
site2html.xsl site2wml.xsl
Log:
intial version of Cocoon WebMail application
Revision Changes Path
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/sitemap.xmap
Index: sitemap.xmap
===================================================================
<?xml version="1.0"?>
<!--
Version <![CDATA[ $Id: sitemap.xmap,v 1.1 2003/01/07 23:29:17 huber Exp $
]]>
Cocoon Webmail sitemap definition
-->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- =========================== Components ================================
-->
<map:components>
<!-- ===== generators =====
-->
<map:generators default="file">
<map:generator name="file"
src="org.apache.cocoon.generation.FileGenerator"
label="content"
logger="sitemap.generator.file"
pool-max="32" pool-min="1" pool-grow="4"
/>
<map:generator name="html"
src="org.apache.cocoon.generation.HTMLGenerator"
label="content"
logger="sitemap.generator.file"
pool-max="32" pool-min="1" pool-grow="4"
/>
<map:generator name="asciiart-svg"
src="org.apache.cocoon.generation.asciiart.AsciiArtSVGGenerator"
label="content"
logger="sitemap.generator.asciiart-svg"
/>
</map:generators>
<!-- ===== transformers =====
-->
<map:transformers default="xslt">
<map:transformer name="xslt"
src="org.apache.cocoon.transformation.TraxTransformer"
logger="sitemap.transformer.xslt" pool-max="32" pool-min="1"
pool-grow="2">
<use-request-parameters>false</use-request-parameters>
<use-browser-capabilities-db>false</use-browser-capabilities-db>
<use-deli>false</use-deli>
</map:transformer>
<!--map:transformer name="tofile"
src="org.apache.cocoon.transformation.SourceWritingTransformer">
<map:parameter name="serializer" value="xml"/>
</map:transformer-->
<map:transformer name="paginate"
src="org.apache.cocoon.transformation.pagination.Paginator"/>
</map:transformers>
<!-- ===== readers =====
-->
<map:readers default="resource">
<map:reader name="resource"
src="org.apache.cocoon.reading.ResourceReader" logger="sitemap.reader.resource"
pool-max="32" pool-min="1" pool-grow="4"/>
</map:readers>
<!-- ===== serializers =====
-->
<map:serializers default="html">
<map:serializer name="html"
src="org.apache.cocoon.serialization.HTMLSerializer"
mime-type="text/html">
<encoding>iso8859-1</encoding>
</map:serializer>
<map:serializer name="wml"
src="org.apache.cocoon.serialization.XMLSerializer"
mime-type="text/vnd.wap.wml"
logger="sitemap.serializer.wml">
<doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public>
<doctype-system>http://www.wapforum.org/DTD/wml_1.1.xml</doctype-system>
<encoding>iso8859-1</encoding>
<omit-xml-declaration>no</omit-xml-declaration>
</map:serializer>
<map:serializer name="xml"
src="org.apache.cocoon.serialization.XMLSerializer"
mime-type="text/xml">
<indent>yes</indent>
</map:serializer>
<map:serializer name="links"
src="org.apache.cocoon.serialization.LinkSerializer"
/>
<map:serializer name="svg2jpeg"
src="org.apache.cocoon.serialization.SVGSerializer"
mime-type="image/jpeg">
<parameter name="quality" type="float" value="0.75"/>
</map:serializer>
</map:serializers>
<!-- ===== matchers =====
-->
<map:matchers default="wildcard">
<map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcher"
logger="sitemap.matcher.wildcard"/>
<map:matcher name="regexp"
src="org.apache.cocoon.matching.RegexpURIMatcher"
logger="sitemap.matcher.regexp"/>
<map:matcher name="regexp-defaults"
src="org.apache.cocoon.matching.RegexpURIDefaultsMatcher"
logger="sitemap.matcher.regexp"/>
</map:matchers>
<!-- ===== selectors =====
-->
<map:selectors default="parameter">
<map:selector name="parameter"
src="org.apache.cocoon.selection.ParameterSelector"
logger="sitemap.selector.parameter"/>
<map:selector name="request-parameter"
src="org.apache.cocoon.selection.RequestParameterSelector"
logger="sitemap.selector.request-parameter">
<parameter-name>cmd</parameter-name>
</map:selector>
<map:selector name="request-attribute"
src="org.apache.cocoon.selection.RequestAttributeSelector"
logger="sitemap.selector.request-attribute">
<parameter-name>cmd</parameter-name>
</map:selector>
</map:selectors>
<!-- ===== actions =====
-->
<map:actions>
<map:action name="simple-resource-exists"
src="org.apache.cocoon.acting.ResourceExistsAction"
logger="sitemap.action.simple-resource-exists"/>
<map:action name="resource-exists"
src="org.apache.cocoon.acting.ExtendedResourceExistsAction"
logger="sitemap.action.resource-exists"/>
<map:action name="link-translator-map"
src="org.apache.cocoon.acting.LinkTranslatorMapAction"
logger="sitemap.action.link-translator-map"/>
<map:action name="mail" src="org.apache.cocoon.mail.MailAction"
logger="sitemap.action.mail"/>
</map:actions>
</map:components>
<!-- =========================== Views =================================== -->
<map:views>
<map:view name="content" from-label="content">
<map:serialize type="xml"/>
</map:view>
<map:view name="links" from-position="last">
<map:transform src="stylesheets/filterlinks.xsl"/>
<map:serialize type="links"/>
</map:view>
</map:views>
<!-- =========================== Resources =============================== -->
<map:resources>
<!-- generate a page by merging all parts making up a page
-->
<map:resource name="show-page">
<map:aggregate element="site">
<map:part src="cocoon:/page-{page}-top-col-1" element="top-col-1"
strip-root="true"/>
<map:part src="cocoon:/page-{page}-head-col-1" element="head-col-1"
strip-root="true"/>
<map:part src="cocoon:/page-{page}-mid-col-1" element="mid-col-1"
strip-root="true"/>
<map:part src="cocoon:/page-{page}-mid-col-2" element="mid-col-2"
strip-root="true"/>
<map:part src="cocoon:/page-{page}-mid-col-3" element="mid-col-3"
strip-root="true"/>
<map:part src="cocoon:/page-{page}-bottom-col-1" element="bottom-col-1"
strip-root="true"/>
</map:aggregate>
</map:resource>
<!-- load a page of a section if page is not available load index page
of this section, plain XML
-->
<map:resource name="load-page">
<map:select type="parameter">
<map:parameter name="parameter-selector-test"
value="{resource-exists}"/>
<map:when test="true">
<map:generate src="docs/{sect}/{page}.xml"/>
</map:when>
<map:otherwise>
<map:generate src="docs/{sect}/index.xml"/>
</map:otherwise>
</map:select>
<map:serialize type="xml"/>
</map:resource>
<!-- load a page of a section if page is not available load index page
of this section, assume XSP
-->
<map:resource name="load-xsp-page">
<map:select type="parameter">
<map:parameter name="parameter-selector-test"
value="{resource-exists}"/>
<map:when test="true">
<map:generate type="serverpages" src="docs/{sect}/{page}.xsp"/>
</map:when>
<map:otherwise>
<map:generate type="serverpages" src="docs/{sect}/index.xsp"/>
</map:otherwise>
</map:select>
<map:serialize type="xml"/>
</map:resource>
</map:resources>
<!-- =========================== Pipelines =================================
-->
<map:pipelines>
<!-- mail/ handling, mail/ URI denotes pages of Cocoon Webmail,
presenting javamail objects
-->
<map:pipeline internal-only="true">
<map:match pattern="page-mail/*-head-col-1">
<map:act type="resource-exists" src="docs/head-col-1/{1}.xsp">
<map:call resource="load-xsp-page">
<map:parameter name="sect" value="head-col-1"/>
<map:parameter name="page" value="{../1}"/>
<map:parameter name="resource-exists" value="{resource-exists}"/>
</map:call>
</map:act>
</map:match>
<map:match pattern="page-mail/mail-mid-col-1">
<map:generate type="serverpages" src="docs/mid-col-1/mail.xsp"/>
<map:transform src="stylesheets/mail2document.xsl"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="page-mail/*-mid-col-1">
<map:act type="resource-exists" src="docs/mid-col-1/{1}.xsp">
<map:call resource="load-xsp-page">
<map:parameter name="sect" value="mid-col-1"/>
<map:parameter name="page" value="{../1}"/>
<map:parameter name="resource-exists" value="{resource-exists}"/>
</map:call>
</map:act>
</map:match>
<map:match pattern="page-mail/mail-mid-col-2">
<map:generate type="serverpages" src="docs/mid-col-2/mail.xsp"/>
<!--
select stylesheet on the cmd request parameter
-->
<map:select type="request-attribute">
<map:parameter name="attribute-name"
value="mail-current-working-command"/>
<map:when test="cat-folder">
<map:transform src="stylesheets/mail-folder2document.xsl"/>
</map:when>
<map:when test="list-folder-messages">
<map:transform src="stylesheets/mail-envelopes2document.xsl"/>
</map:when>
<map:when test="search-folder-messages">
<map:transform src="stylesheets/mail-envelopes2document.xsl"/>
</map:when>
<map:when test="list-folder">
<map:transform src="stylesheets/mail-folder2document.xsl"/>
</map:when>
<map:when test="list-folder-recursivly">
<map:transform
src="stylesheets/mail-folderrecursivly2document.xsl"/>
</map:when>
<map:when test="cat-message-by-uid">
<map:transform src="stylesheets/mail-message2document.xsl"/>
</map:when>
<map:when test="cat-message-by-id">
<map:transform src="stylesheets/mail-message2document.xsl"/>
</map:when>
<map:otherwise>
<map:transform src="stylesheets/mail-unknown2document.xsl"/>
</map:otherwise>
</map:select>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="page-mail/*-mid-col-2">
<map:act type="resource-exists" src="docs/mid-col-2/{1}.xsp">
<map:call resource="load-xsp-page">
<map:parameter name="sect" value="mid-col-2"/>
<map:parameter name="page" value="{../1}"/>
<map:parameter name="resource-exists" value="{resource-exists}"/>
</map:call>
</map:act>
</map:match>
<map:match pattern="page-mail/*-mid-col-3">
<map:act type="resource-exists" src="docs/mid-col-3/{1}.xml">
<map:call resource="load-page">
<map:parameter name="sect" value="mid-col-3"/>
<map:parameter name="page" value="{../1}"/>
<map:parameter name="resource-exists" value="{resource-exists}"/>
</map:call>
</map:act>
</map:match>
</map:pipeline>
<!-- general page section handling
-->
<map:pipeline internal-only="true">
<!-- pipeline matching a section of a page
-->
<!-- matched by simple URI *.html, eg. index.html becomes
page-index-top-col-1
and mail/*.html, eg. mail/logout.html becomes page-mail/logout-top-col-1
-->
<map:match pattern="page-**-top-col-1">
<map:act type="resource-exists" src="docs/top-col-1/{1}.xml">
<map:call resource="load-page">
<map:parameter name="sect" value="top-col-1"/>
<map:parameter name="page" value="{../1}"/>
<map:parameter name="resource-exists" value="{resource-exists}"/>
</map:call>
</map:act>
</map:match>
<map:match pattern="page-*-head-col-1">
<map:act type="resource-exists" src="docs/head-col-1/{1}.xml">
<map:call resource="load-page">
<map:parameter name="sect" value="head-col-1"/>
<map:parameter name="page" value="{../1}"/>
<map:parameter name="resource-exists" value="{resource-exists}"/>
</map:call>
</map:act>
</map:match>
<map:match pattern="page-*-mid-col-1">
<map:act type="resource-exists" src="docs/mid-col-1/{1}.xml">
<map:call resource="load-page">
<map:parameter name="sect" value="mid-col-1"/>
<map:parameter name="page" value="{../1}"/>
<map:parameter name="resource-exists" value="{resource-exists}"/>
</map:call>
</map:act>
</map:match>
<map:match pattern="page-*-mid-col-2">
<map:generate src="docs/mid-col-2/{1}.xml"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="page-*-mid-col-3">
<map:act type="resource-exists" src="docs/mid-col-3/{1}.xml">
<map:call resource="load-page">
<map:parameter name="sect" value="mid-col-3"/>
<map:parameter name="page" value="{../1}"/>
<map:parameter name="resource-exists" value="{resource-exists}"/>
</map:call>
</map:act>
</map:match>
<!-- bottom-col matches mail/*, too
-->
<map:match pattern="page-**-bottom-col-1">
<map:act type="resource-exists" src="docs/bottom-col-1/{1}.xml">
<map:call resource="load-page">
<map:parameter name="sect" value="bottom-col-1"/>
<map:parameter name="page" value="{../1}"/>
<map:parameter name="resource-exists" value="{resource-exists}"/>
</map:call>
</map:act>
</map:match>
</map:pipeline>
<!-- top level URI matching a page
-->
<map:pipeline>
<!-- handle *.html, and *([0-9]*).html pages
-->
<map:match pattern="^([^(/)0-9]+)(\(([0-9]+)+\))?\.html$"
type="regexp-defaults">
<map:parameter name="map-default:2" value="(1)"/>
<map:parameter name="map-default:3" value="1"/>
<!-- setup link rewriting mapping
-->
<map:act type="link-translator-map" src="{1}.html"/>
<map:call resource="show-page">
<map:parameter name="page" value="{1}"/>
</map:call>
<map:transform type="paginate" src="pagesheets/htmlpages.xml">
<map:parameter name="page" value="{3}"/>
</map:transform>
<map:transform src="stylesheets/site2html.xsl"/>
<map:serialize/>
</map:match>
</map:pipeline>
<map:pipeline>
<!-- handle mail/*.html, and mail/*([0-9]*).html pages
-->
<map:match pattern="^mail/([a-z]+)(\(([0-9]+)+\))?\.html$"
type="regexp-defaults">
<map:parameter name="map-default:2" value="(1)"/>
<map:parameter name="map-default:3" value="1"/>
<!-- setup link rewriting mapping
-->
<map:act type="link-translator-map">
<map:parameter name="url-base" value=""/>
<map:parameter name="linkMap:main.css" value="../main.css"/>
<map:parameter name="linkMap:built-with-cocoon.gif"
value="../built-with-cocoon.gif"/>
<map:parameter name="linkMap:powered-by-cocoon.png"
value="../powered-by-cocoon.png"/>
<map:parameter name="linkMap:favicon.ico" value="../favicon.ico"/>
</map:act>
<!-- create javamail objects
-->
<map:act type="mail" src="{1}">
<!--
define the imap store url as urlname template,
-->
<map:parameter name="store-urlname"
value="imap://''mail-userid'':''mail-passwd''@imap-server-host-name/"/>
<map:parameter name="javax.mail.Session.props:mail.debug"
value="true"/>
</map:act>
<map:call resource="show-page">
<map:parameter name="page" value="mail/{1}"/>
</map:call>
<map:transform type="paginate" src="pagesheets/mailhtmlpages.xml">
<map:parameter name="page" value="{3}"/>
</map:transform>
<map:transform src="stylesheets/site2html.xsl"/>
<map:serialize/>
</map:match>
</map:pipeline>
<!-- top level URI matching resources of a page
-->
<map:pipeline>
<map:match pattern="*.css">
<map:read mime-type="text/css" src="resources/styles/{1}.css"/>
</map:match>
<map:match pattern="*.gif">
<map:read mime-type="image/gif" src="resources/images/{1}.gif"/>
</map:match>
<map:match pattern="*.png">
<map:read mime-type="image/png" src="resources/images/{1}.png"/>
</map:match>
<map:match pattern="*.jpg">
<map:read mime-type="image/jpeg" src="resources/images/{1}.jpg"/>
</map:match>
<map:match pattern="favicon.ico">
<map:read mime-type="application/ico"
src="resources/images/favicon.ico"/>
</map:match>
<!-- handle ascii art, generate SVG from TXT, and serialize SVG as jpeg
-->
<map:match pattern="asciiart/*.jpg">
<map:generate type="asciiart-svg" src="resources/asciiart/{1}.txt">
</map:generate>
<map:serialize type="svg2jpeg"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/bottom-col-1/index.xml
Index: index.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>Footer</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<p align="center" class="footer">
<i>Have fun!</i> |
Copyright (C) Apache 2003 |
<link href="page:about">About</link>
<br/>
<img align="center" src="built-with-cocoon.gif"/>
</p>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/bottom-col-1/index.xml~
Index: index.xml~
===================================================================
<?xml version="1.0"?>
<root>
<p align="center" class="footer">
<a href="mailto:[EMAIL PROTECTED]">Contact</a> |
Copyright (C) by FooBar |
Disclaimer |
All rights reserved
<br/>
<br/>
<img align="center" src="built-with-cocoon.gif"/>
</p>
</root>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/head-col-1/index.xml
Index: index.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>Top Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<div>
Here you will find a list of available commands, as soon as you login.
</div>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/head-col-1/index.xsp
Index: index.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Version CVS: $Id: index.xsp,v 1.1 2003/01/07 23:29:18 huber Exp $
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<document>
<header>
<title>Top Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<div>
Here you will find a list of available commands, as soon as you login.
</div>
</body>
</document>
</xsp:page>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/head-col-1/mail.xsp
Index: mail.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Version CVS: $Id: mail.xsp,v 1.1 2003/01/07 23:29:18 huber Exp $
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<document>
<header>
<title>Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<div class="row" style="margin: 1px; padding: 1px;">
<ul class="inline">
<li class="inline">
<strong>Folder </strong>
<xsp-request:get-attribute name="mail-current-working-folder"/>
</li>
<li class="last">
<strong>Last Command </strong>
<xsp-request:get-attribute name="mail-current-working-command"/>
</li>
</ul>
<ul class="inline">
<li class="inline">
<a>
<xsp:attribute name="href">mail.html?cmd=cat-folder</xsp:attribute>
Folder Info
</a>
</li>
<li class="inline">
<a>
<xsp:attribute
name="href">mail.html?cmd=list-folder-messages</xsp:attribute>
Messages
</a>
</li>
<li class="inline">
<a>
<xsp:attribute
name="href">mail.html?cmd=refresh-folder</xsp:attribute>
Refresh Folder
</a>
</li>
<li class="inline">
<a>
<xsp:attribute
name="href">mail.html?cmd=list-folder&folder=~</xsp:attribute>
Folders
</a>
</li>
<li class="inline">
<a>
<xsp:attribute
name="href">mail.html?cmd=cat-message-by-id&id=1</xsp:attribute>
Message
</a>
</li>
<li class="inline">
<a>
<xsp:attribute name="href">logout.html</xsp:attribute>
Logout
</a>
</li>
<li class="last">
<form style="display: inline" action="mail.html">
<input type="text" name="search" lenght="15"/>
<input type="hidden" name="cmd" value="search-folder-messages"/>
<input type="submit" value="Search"/>
</form>
</li>
</ul>
</div>
</body>
</document>
</xsp:page>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-1/index.xml
Index: index.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<header>
<title>Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="Start using Cocoon Webmail">
<p>
Start using Cocoon Webmail now!
It's easy, and simple. Don't hesitate to use it.
<br/>
<link href="page:login">Login</link>
</p>
<p><strong>WebMail Docs</strong>
</p>
<ul>
<li class="g"> <link href="page:howto-cocoon-webmail">Howto Cocoon
Webmail</link> </li>
<li class="g"> <link href="page:mail-action">Mail Action
Userdoc</link> </li>
</ul>
<p><strong>More Sitemap Docs</strong>
</p>
<ul>
<li class="g"> <link href="page:asciiart-generator">AsciiArt
Generator Userdoc</link> </li>
<li class="g"> <link
href="page:extendedresourceexists-action">Extended Resource Exists Action
Userdoc</link> </li>
<li class="g"> <link href="page:linktranslatormap-action">Link
Translator Map Action Userdoc</link> </li>
<br/>
</ul>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-1/index.xsp
Index: index.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Version CVS: $Id: index.xsp,v 1.1 2003/01/07 23:29:18 huber Exp $
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<document>
<header>
<title>Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<p>
</p>
</body>
</document>
</xsp:page>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-1/login.xml
Index: login.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<header>
<title>Login</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="Start using Cocoon Webmail">
<p>
As your login succeeds...
</p>
<ul>
<li>See a list of available folders</li>
<li>See the messages of a folder</li>
<li>See the content of a message</li>
<li>Search for messages</li>
</ul>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-1/mail.xml
Index: mail.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<header>
<title>Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<p> <strong>FolderList</strong>
a list of available folders, starting from root
or relative to current folder
</p>
<p> <strong>Folder</strong>
some folder infos....
</p>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-1/mail.xsp
Index: mail.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Version CVS: $Id: mail.xsp,v 1.1 2003/01/07 23:29:18 huber Exp $
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>
<document>
<header>
<title>Status</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="Folder Info">
<xsp-request:get-attribute name="folder" as="object"/>
</s1>
</body>
</document>
</xsp:page>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/about.xml
Index: about.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>About</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="About This Site">
<p>
This site is for demonstrating cool features of
<link href="http://xml.apache.org/cocoon">Cocoon</link>.
Especially demonstrating JavaMail access using Cocoon.
</p>
<p>
Thanks to
</p>
<ul>
<li><link href="http://xml.apache.org/cocoon">Apache Community</link>
for support.
</li>
<li><link href="http://www.alistapart">A List Apart</link> for their
cool webdesign tips.
</li>
</ul>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/asciiart-generator.xml
Index: asciiart-generator.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN"
"../../dtd/document-v10.dtd">
<document>
<header>
<title>AsciiArtSVGGenerator in Cocoon</title>
<version>0.9</version>
<type>Technical document</type>
<authors>
<person name="Bernhard Huber" email="huber.at.apache.org"/>
</authors>
<abstract>This document describes the AsciiArtSVGGenerator of
Cocoon.</abstract>
</header>
<body>
<s1 title="AsciiArtSVGGenerator">
<table>
<tr>
<td>NAME</td><td>asciiart-svg</td>
</tr>
<tr>
<td>WHAT</td><td>The <code>AsciiArtSVGGenerator</code> component is
used
to serve ascii art text as SVGserve data.
</td>
</tr>
<tr>
<td>TYPE</td><td>Generator, Sitemap Component</td>
</tr>
<tr>
<!-- choose Core, the block name, or Scratchpad
depending on where AsciiArtSVGGenerator sources live
-->
<td>BLOCK</td><td>Block-Mail/Scratchpad</td>
</tr>
<tr>
<td>CLASS</td><td>org.apache.cocoon.generation.asciiart.AsciiArtSVGGenerator</td>
</tr>
<!-- uncomment folling tr iff AsciiArtSVGGenerator is deprecated -->
<!--tr>
<td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td>
</tr-->
<tr>
<td>SINCE</td><td>Cocoon 2.1</td>
</tr>
<tr>
<td>CACHEABLE</td><td>yes</td>
</tr>
</table>
</s1>
<s1 title="Description">
<p>
The <code>AsciiArtSVGGenerator</code> reads a plain ascii text
document
and generates SVG/XML SAX events.
</p>
</s1>
<s1 title="Usage">
<p>
The <code>AsciiArtSVGGenerator</code> can be used to serve
figural information in a quick, and simple way.
</p>
<p>
The following snippet represents an ascii art which can be served
by <code>AsciiArtSVGGenerator</code>
</p>
<source><![CDATA[
+==============+
| Mail_Header |
| +========+ |
| | Body | |
| +==+==+==+ |
| |a |a |a | |
| |1 |2 |3 | |
| +==+==+==+ |
+==============+
]]></source>
<p>
Storing this as <code>image/asciiart/mail.txt</code>, and using
the matching snippet below, the mail ascii art can get embedded
in your document as
</p>
<source><![CDATA[
<p> Talking about mail ....</p>
<figure alt="Mail Structure" src="image/asciiart/mail.png"/>
]]></source>
<s2 title="Sitemap pipeline examples">
<p>
The snippet below matches URI of the format
<code>image/asciiart/*.png</code>, and
serves them from ascii art files from the directory
<code>resources/asciiart/*.txt</code>.
</p>
<source><![CDATA[
<map:match pattern="image/asciiart/*.png">
<map:generate type="asciiart-svg"
src="resources/asciiart/{1}.txt">
<!-- option sitemap parameters -->
</map:generate>
<map:serialize type="svg2png"/>
</map:match>
]]></source>
</s2>
<s2 title="Sitemap component configuration example">
<p>
The snippet below declares the <code>AsciiArtGenerator</code>
in the sitmap components section.
</p>
<source><![CDATA[
<map:generators...
<map:generator name="asciiart-svg"
src="org.apache.cocoon.generation.AsciiArtSVGGenerator"
logger="sitemap.generator.asciiart-svg"
/>
<!-- optional generator configuration -->
...
</map:generators>
...
]]></source>
</s2>
<s2 title="Configuration">
<p>
The <code>AsciiArtGenerator</code> has no configurational options.
</p>
</s2>
<s2 title="Setup">
<p>
Setting up the <code>AsciiArtGenerator</code> is simply specifying
the plain ascii text source.
</p>
<p>
Moreover following sitemap parameters are accepted
</p>
<table>
<tr><th>Parametername</th><th>Default</th><th>Comment</th></tr>
<tr><td>line-attribute</td><td><![CDATA[stroke:black;
stroke-width:1.5]]></td>
<td>Style of generated SVG lines</td></tr>
<tr><td>text-attribute</td><td><![CDATA[font-size: 12;
font-family:Times Roman; fill:blue;]]></td>
<td>Style of generated SVG text</td></tr>
<tr><td>x-grid</td><td>10</td>
<td>X Grid size</td></tr>
<tr><td>y-grid</td><td>12</td>
<td>Y Grid size</td></tr>
</table>
</s2>
<s2 title="Effect on Object Model and Sitemap Parameters">
<p>
The <code>AsciiArtGenerator</code> has no side effects on the
objectModel, or other sitemap parameters.
</p>
</s2>
</s1>
<s1 title="Bugs/Caveats">
<p>
The <code>AsciiArtGenerator</code> is a quick shot, and
does not handle all characters visually consistently.
</p>
</s1>
<s1 title="History">
<p>
01-05-02: initial creation
</p>
</s1>
<s1 title="Copyright">
<p>
Copyright (C) 1999-2002 The Apache Software Foundation. All rights
reserved.
</p>
</s1>
<s1 title="See also">
<p>
Read more information about
<link href="http://www.w3.org/TR/SVG/">SVG</link>,
and about
<link
href="http://xml.apache.org/cocoon/userdocs/serializers/svg-serializer.html">SVG
Serializer</link>
family.
</p>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/changes.xml
Index: changes.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<document>
<header>
<title>Changes</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="Changes">
<ul>
<li>28th December 2002, initial version start.
</li>
</ul>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/extendedresourceexists-action.xml
Index: extendedresourceexists-action.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN"
"../../dtd/document-v10.dtd">
<document>
<header>
<title>ExtendedResourceExistsAction in Cocoon</title>
<version>0.9</version>
<type>Technical document</type>
<authors>
<person name="Bernhard Huber" email="huber.at.apache.org"/>
</authors>
<abstract>This document describes the ExtendedResourceExistsAction of
Cocoon.</abstract>
</header>
<body>
<s1 title="ExtendedResourceExistsAction">
<table>
<tr>
<td>NAME</td><td>extended-resource-exists</td>
</tr>
<tr>
<td>WHAT</td><td>The <code>ExtendedResourceExistsAction</code>
component is used
to detect existance of a resource.
</td>
</tr>
<tr>
<td>TYPE</td><td>Action, Sitemap Component</td>
</tr>
<tr>
<!-- choose Core, the block name, or Scratchpad
depending on where ExtendedResourceExistsAction sources live
-->
<td>BLOCK</td><td>Block-Mail/Scratchpad</td>
</tr>
<tr>
<td>CLASS</td><td>org.apache.cocoon.acting.ExtendedResourceExistsAction</td>
</tr>
<!-- uncomment folling tr iff ExtendedResourceExistsAction is
deprecated -->
<!--tr>
<td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td>
</tr-->
<tr>
<td>SINCE</td><td>Cocoon 2.1</td>
</tr>
<tr>
<td>CACHEABLE</td><td>not applicable</td>
</tr>
</table>
</s1>
<s1 title="Description">
<p>
The <code>ExtendedResourceExistsAction</code> checks the existance of
a resource.
If the resource exists a sitemap parameter to <code>true</code>,
otherwise to <code>false</code>.
</p>
</s1>
<s1 title="Usage">
<p>
The <code>ExtendedResourceExistsAction</code> is used to control the
sitemap
processing depending on the existance of a resource.
</p>
<p>
A use case of <code>ExtendedResourceExistsAction</code> is serving
default
pages, in case of non-existance of a page.
</p>
<p>
The snippet below uses <code>ExtendedResourceExistsAction</code>
serving the document <code>docs/index.html</code> if the
requested document does not exist.
</p>
<source><![CDATA[
<map:match pattern="*.html">
<map:act type="extended-resource-exists"
src="docs/{1}.html"
<map:select type="parameter">
<map:parameter name="parameter-selector-test"
value="{resource-exists}"/>
<map:when test="true">
<!-- resource exists, access the matched URI via {../1} -->
<map:generate src="docs/{../1}.xml"/>
</map:when>
<map:otherwise>
<!-- resource does not exist, serve default page -->
<map:generate src="docs/index.xml"/>
</map:otherwise>
</map:select>
>
...
</map:act>
</map:match>
]]></source>
<s2 title="Sitemap pipeline examples">
<p>
The snippet below presents the basic usage of
<code>ExtendedResourceExistsAction</code>.
Note that <code>ExtendedResourceExistsAction</code> creates an
objectMap having exactly on entry named
<code>resource-exists</code>. This entry
may have value <code>true</code>, or <code>false</code>.
</p>
<p>
Thus accessing the wildcard result use <code>{../1}</code>, instead
of the
simple <code>{1}</code>.
</p>
<source><![CDATA[
<map:match pattern="*.html">
<map:action type="extended-resource-exists"
src="docs/{1}.xml">
...
</map:action>
</map:match>
]]></source>
</s2>
<s2 title="Sitemap component configuration example">
<p>
The snippet below confiures the
<code>ExtendedResourceExistsAction</code>
component in the sitemap's components section.
</p>
<source><![CDATA[
<map:actions...
<map:action name="extended-resource-exists"
src="org.apache.cocoon.acting.ExtendedResourceExistsAction"
logger="sitemap.action.resource-exists"
/>
...
</map:actions>
...
]]></source>
</s2>
<s2 title="Configuration">
<p>
The <code>ExtendedResourceExistsAction</code> has no
configurational options.
</p>
</s2>
<s2 title="Setup">
<p>
Setting up the <code>ExtendedResourceExistsAction</code> needs
only specifying the resource by setting the <code>src</code>
attribute
of the <code><map:act></code> element. This way
<code>ExtendedResourceExistsAction</code> knows what resource to
test
for existance.
</p>
<p>
The <code>ExtendedResourceExistsAction</code> accepts optionally a
the
sitemap parameter <code>url</code>, overriding the value presented
by the <code>src</code> attribute.
</p>
</s2>
<s2 title="Effect on Object Model and Sitemap Parameters">
<p>
The <code>ExtendedResourceExistsAction</code> creates alway an
objectMap table, and always sets an <code>resource-exists</code>
entry in this table.
</p>
</s2>
</s1>
<s1 title="Bugs/Caveats">
<p>
The entry name <code>resource-exists</code> of the objectMap table
entry
is fixed, it is not configurable.
</p>
<p>
The <code>ExtendedResourceExistsAction</code> checks the existance of
a resource
by resolving the name of the resource, and trying to get an
<code>InputStream</code>
of this resource, accessing remote resources may take some time before
it is obvious that the resource is, or is not available.
</p>
</s1>
<s1 title="History">
<p>
01-05-02: initial creation
</p>
</s1>
<s1 title="Copyright">
<p>
Copyright (C) 1999-2002 The Apache Software Foundation. All rights
reserved.
</p>
</s1>
<s1 title="See also">
<p>
Cocoon has already an <code>ResourceExistsAction</code>. This action
creates an objectMap, only in case of resource existance.
</p>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/faq.xml
Index: faq.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<header>
<title>FAQ</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="FAQ">
<p>
Frequently asked questions
</p>
<p>
Neither questions, nor answers available, yet.
</p>
<dl>
<dt>Your question</dt>
<dd>Your answer
</dd>
</dl>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/howto-cocoon-webmail.xml
Index: howto-cocoon-webmail.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN"
"../../dtd/document-v10.dtd">
<document>
<header>
<title>How to use Cocoon WebMail Site</title>
<version>0.9</version>
<type>Technical document</type>
<authors>
<person name="Bernhard Huber" email="huber.at.apache.org"/>
</authors>
<abstract>This document describes Cocoon WebMail.</abstract>
</header>
<body>
<s1 title="Cocoon WebMail Site">
<p>
This document describes the Cocoon WebMail Site.
The overview section describes the URI space, layout and
resource mapping used by
Cocoon WebMail Site.
</p>
<p>
The next sections describes the Cocoon sitemap components
used in the Cocoon WebMail Site.
</p>
<p>
The target audience of this document are sitemap designer, and
developers interested in setting up a Cocoon WebMail Site.
</p>
</s1>
<s1 title="Overview">
<s2 title="URI Space">
<p>
The URI space has following structure, <em>root</em> denotes the
root
of this URI space.
</p>
<figure alt="URI space" src="asciiart/uri-space.jpg"/>
<p>
As you may figure out <code>*.html</code> serves static document
pages,
mail/mail.html, and mail/logout.html serves dynamic Cocoon Webmail
pages.
All other resources are static, like images, cascaded stylesheet,
and icons.
The <code>asciiart/*.jpg</code> are jpg resource created from
simple ascii art text.
</p>
<p>
The document pages all have the format <code>*.html</code>,
eg. <code>index.html</code>, or
<code>howto-cocoon-webmail.html</code>.
The dynamic Cocoon Webmail pages all have the format
<code>mail/*.html</code>,
eg. <code>mail/maill.html</code>, or <code>mail/logout.html</code>.
</p>
</s2>
<s2 title="Layout">
<p>
The visible layout of Cocoon Webmail Site is a simple multi column
layout.
</p>
<figure alt="Layout" src="asciiart/layout.jpg"/>
<p>
The sections contain following piece of information
</p>
<ul>
<li>
The header section displays the Cocoon Webmail banner;
the top section is empty for document pages, for
dynamic pages it contains a list of available commands.
</li>
<li>
The col1 section presents auxilliary information.
</li>
<li>
The col2 section contains for document pages the document content;
for dynamic pages it presents the content of an executed command,
like a list of mail folders, a list of messages, the content of a
message.
</li>
<li>
The col3 section presents additional links.
</li>
<li>
Finally the bottom section displays the Cocoon Webmail footer.
</li>
</ul>
<s3 title="Implementing the Layout">
<p>
For the sake of flexibilty a page requested by an URI is
aggregated.
The aggregation parts are located in the resource section
directories.
</p>
<p>
The column layout is realized by using positioning features of
CSS. Each aggregation
part is wrapped by an <div> which has CSS positional
settings for placing
it some concrete page position.
</p>
</s3>
</s2>
<s2 title="Resource Mapping">
<p>
The Cocoon Webmail Site uses following directory structure
on the filesystem:
</p>
<figure alt="Directory structure"
src="asciiart/directory-hierarchy.jpg"/>
<p>
As you can figure out each layout section is mapped to a directory.
Each of these
directories contains the documents of one section.
</p>
<p>
Thus for example the request URI of this page is
<code>howto-cocoon-webmail.html</code>.
The <code>mid-col-2</code> section of this page expects an xml
document
in the filesystem as
<code>docs/mid-col-2/howto-cocoon-webmail.xml</code>.
</p>
<p>
By design dynamic pages of the Cocoon Webmail application are
requested by an URI of the format <code>mail/*.html</code>, the
resource mapping
of these pages maps to the same directories as the static pages.
Thus <code>mail/mail.html</code> maps for the section
<code>mid-col-2</code> to
<code>docs/mid-col-2/mail.xsp</code>.
</p>
</s2>
</s1>
<s1 title="Cocoon's Sitemap Elements">
<p>
Beside the usage of the sitemap <code>MailAction</code> there are
several sitemap
components, and sitemap constructs used in sitemap of the Cocoon
Webmail.
</p>
<p>
The following sections detail most important Cocoon's sitemap
components
of Cocoon WebMail. All of these components are listed in the
sitemap componts section.
</p>
<s2 title="Actions">
<ul>
<li>resource-exists - Checks existance of a resource</li>
<li>link-translator - Defines link rewriting patterns</li>
<li>mail - action of the Cocoon Webmail application, executes
commands, manages
http session, and javamail session.
</li>
</ul>
</s2>
<s2 title="Generators">
<ul>
<li>file - generates XML from an XML file</li>
<li>serverpages - generates XML from an XSP file</li>
<li>asciiart-svg - generates SVG from a TXT file</li>
</ul>
</s2>
<s2 title="Matchers">
<ul>
<li>wildcard - matches simple wildcard of the format
<code>*</code>, and <code>**</code></li>
<li>regexp-default - extension of regexp matcher for setting
default values.
It is used to for matching both paginated, and non-paginted URI
request.
Setting the default paginator page to 1.
</li>
</ul>
</s2>
<s2 title="Readers">
<ul>
<li>resource - simple resource reader for serving images, and CSS
files</li>
</ul>
</s2>
<s2 title="Selectors">
<ul>
<li>request-attribute - selects processing depending on the
existance, and content
of a request attribute, selects the suitable XSLT stylesheet for
javamail object
to document page transformation.
</li>
</ul>
</s2>
<s2 title="Transformers">
<ul>
<li>xslt - XSLT transformer for transforming aggregated site
document to html,
transforming javamail documents to a document.
</li>
<li>paginator - Paginator transformer for splitting up long pages,
separating document pages by
<code>pagesheets/htmlpages.xml</code>, and
separating dynamic pages by
<code>pagesheets/mailhtmlpages.xml</code>,
</li>
</ul>
</s2>
<s2 title="Views">
<ul>
<li>content - defines a view requesting the 'pure' content of a
page.</li>
<li>links - defines a view for requesting all outbounding links of
a page.</li>
</ul>
</s2>
<s2 title="Resources">
<ul>
<li>show-page - aggregates a requested URI, triggering the
generation of its parts.
The sections making up the content of a page are invoked from
here.
</li>
<li>load-page - Decides what page file should get loaded, due to
the existing
of a resource in the filesystem, serving default pages in case of
non-existance
of a requested resource document.
</li>
<li>show-page-xsp - Decides what page file should get loaded, due
to the existing
of a resource in the filesystem, serving default pages in case of
non-existance
of a requested resource document. It generates from XSP instead
of XML, in
contrast to <code>load-page</code>.
</li>
</ul>
</s2>
</s1>
<s1 title="Serving a Document Page">
<p>
Each requested document URI uses following sitemap data flow:
</p>
<figure alt="serving document page"
src="asciiart/serving-document-page.jpg"/>
<p>
Each aggregate part follows in principal following sitemap data flow:
</p>
<figure alt="serving document detail"
src="asciiart/serving-document-page-1.jpg"/>
</s1>
<s1 title="Serving a Dynamic Page">
<p>
Each requested dynamic URI uses following sitemap data flow:
</p>
<figure alt="serving dynamic page"
src="asciiart/serving-dynamic-page.jpg"/>
<p>
Each aggregate part follows in principal following sitemap data flow:
</p>
<figure alt="serving dynamic page detail"
src="asciiart/serving-dynamic-page-1.jpg"/>
</s1>
<s1 title="MailAction Dataflow">
<p>
As <code>MailAction</code> access a lot of parameters
the following diagram gives an overview of all
parameters involved for processing a request.
</p>
<figure alt="MailAction Dataflow"
src="asciiart/mailaction-dataflow.jpg"/>
</s1>
<s1 title="Summary">
<p>
As the basic structure of Cocoon WebMail Site has been explained,
setting up, and maintaing a Cocoon WebMail site
- reusing ideas, sitemap snippets, and Cocoon's sitemap components -
shall be easy.
</p>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/index.xml
Index: index.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<header>
<title>CocoonMail Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="CocoonMail Index">
<p>
This site demonstrates using Cocoon as Webmail Engine.
As it is a demo site you can use Cocoon Webmail.
Moreover some documentation about:
</p>
<ul>
<li>installing,</li>
<li>configuring, </li>
<li>customizing, and </li>
<li>technical background </li>
</ul>
<p>
is available, too.
</p>
</s1>
<s1 title="Using Webmail Demo Application">
<p>
Some quick installation notes:
</p>
<ul>
<li>Find an IMAP server access.</li>
<li>Configure the <code>sitemap.xmap</code>, by
entering the IMAP server configuration in the format
<code>imap://''mail-userid'':''mail-passwd''@imap-server.foo.bar/</code>.
Replacing <code>imap-server.foo.bar</code> by your imap server.
</li>
<li>Try to <link href="page:login">login</link>.
</li>
</ul>
</s1>
<s1 title="Feedback">
<p>
Send your feedback to Cocoon.
</p>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/linktranslatormap-action.xml
Index: linktranslatormap-action.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN"
"../../dtd/document-v10.dtd">
<document>
<header>
<title>LinkTranslatorMapAction in Cocoon</title>
<version>0.9</version>
<type>Technical document</type>
<authors>
<person name="Your Name" email="your-email"/>
</authors>
<abstract>This document describes the LinkTranslatorMapAction of
Cocoon.</abstract>
</header>
<body>
<s1 title="LinkTranslatorMapAction">
<table>
<tr>
<td>NAME</td><td>link-translator-map</td>
</tr>
<tr>
<td>WHAT</td><td>The <code>LinkTranslatorMapAction</code> component
is used
setup a simple link rewriting.
</td>
</tr>
<tr>
<td>TYPE</td><td>Action, Sitemap Component</td>
</tr>
<tr>
<!-- choose Core, the block name, or Scratchpad
depending on where LinkTranslatorMapAction sources live
-->
<td>BLOCK</td><td>Block-Mail/Scratchpad</td>
</tr>
<tr>
<td>CLASS</td><td>org.apache.cocoon.acting.LinkTranslatorMapAction</td>
</tr>
<!-- uncomment folling tr iff LinkTranslatorMapAction is deprecated
-->
<!--tr>
<td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td>
</tr-->
<tr>
<td>SINCE</td><td>Cocoon 2.1</td>
</tr>
<tr>
<td>CACHEABLE</td><td>not applicable</td>
</tr>
</table>
</s1>
<s1 title="Description">
<p>
The <code>LinkTranslatorMapAction</code> sets up a simple link
rewriting
mapping.
</p>
</s1>
<s1 title="Usage">
<p>
Keeping outbounding links independing from its publishing URI
is a simple usage scenario of <code>LinkTranslatorMapAction</code>.
</p>
<s2 title="Sitemap pipeline examples">
<p>
</p>
<source><![CDATA[
<map:match pattern="mail/*.html">
<map:action type="link-translator-map">
<!-- sitemap parameters -->
<map:parameter name="main.css" value="../main.css"/>
</map:action>
</map:match>
]]></source>
</s2>
<s2 title="Sitemap component configuration example">
<p></p>
<source><![CDATA[
<map:actions...
<map:action name="link-translator-map"
src="org.apache.cocoon.acting.LinkTranslatorMapAction"
logger="sitemap.action.link-translator-map"
/>
...
</map:actions>
...
]]></source>
</s2>
<s2 title="Configuration">
<p>
Explain the sitemap action configuration, options when declaring
template action
</p>
</s2>
<s2 title="Setup">
<p>
Explain the sitemap action setup, ie options when using template
action
</p>
</s2>
<s2 title="Effect on Object Model and Sitemap Parameters">
<p>
</p>
</s2>
</s1>
<s1 title="Bugs/Caveats">
<p>
Describe limitation, bugs of LinkTranslatorMapAction
</p>
</s1>
<s1 title="History">
<p>
01-05-02: initial creation
</p>
</s1>
<s1 title="Copyright">
<p>
Copyright (C) 1999-2002 The Apache Software Foundation. All rights
reserved.
</p>
</s1>
<s1 title="See also">
<p>
Links to related components pages.
</p>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/login.xml
Index: login.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<header>
<title>CocoonMail Login</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="CocoonMail Login">
<p>
A simple site for Using Cocoon as WebMail Engine.
</p>
<div
style="background-color: lightgrey; border: 1px dotted #333; padding:
5px; margin: 5px;"
>
<p>
Enter your login and password for your IMAP access...
</p>
<form action="mail/mail.html" method="GET">
<div class="row">
<span class="label">Userid</span>
<span class="formw"><input type="text" name="mail-userid"/></span>
</div>
<div class="row">
<span class="label">Password</span>
<span class="formw"><input type="password"
name="mail-password"/></span>
</div>
<div class="row">
<span class="label"></span>
<span class="formw"><input name="Login" value="Login"
type="submit"/></span>
</div>
<input type="hidden" name="cmd" value="list-folder"/>
<input type="hidden" name="folder" value="~"/>
</form>
<br/>
</div>
<p>
You may want to check your sitemap, again?
</p>
<p>
Be sure that the IMAP server is configured properly in your
<code>sitemap.xmap</code>.
</p>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/logout.xsp
Index: logout.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Version CVS: $Id: logout.xsp,v 1.1 2003/01/07 23:29:18 huber Exp $
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>
<document>
<xsp-session:remove-attribute name="mail-context"/>
<xsp-session:invalidate/>
<header>
<title>CocoonMail Logout</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="CocoonMail Logout">
<p>
Your Cocoon Webmail Session has been destroyed.
</p>
<p>
If you want to continue, using
CocoonMail <link href="page:../login">login</link>, again.
</p>
<p>
You can read more about CocoonMail <link
href="page:../index">here</link>.
</p>
</s1>
</body>
</document>
</xsp:page>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/mail-action.xml
Index: mail-action.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN"
"../../dtd/document-v10.dtd">
<document>
<header>
<title>MailAction in Cocoon</title>
<version>0.9</version>
<type>Technical document</type>
<authors>
<person name="Bernhard Huber" email="huber.at.apache.org"/>
</authors>
<abstract>This document describes the MailAcion of Cocoon.</abstract>
</header>
<body>
<s1 title="MailAction">
<table>
<tr>
<td>NAME</td><td>mail</td>
</tr>
<tr>
<td>WHAT</td><td>The <code>MailAction</code> component is used for
creating javamail objects, and putting them into the request
attribute map.
</td>
</tr>
<tr>
<td>TYPE</td><td>Action, Sitemap Component</td>
</tr>
<tr>
<!-- choose Core, the block name, or Scratchpad
depending on where MailAction sources live
-->
<td>BLOCK</td><td>Scratchpad/Block-Mail</td>
</tr>
<tr>
<td>CLASS</td><td>org.apache.cocoon.mail.MailAction</td>
</tr>
<!-- uncomment folling tr iff MailAction is deprecated -->
<!--tr>
<td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td>
</tr-->
<tr>
<td>SINCE</td><td>Cocoon 2.1</td>
</tr>
<tr>
<td>CACHEABLE</td><td>not applicable</td>
</tr>
</table>
</s1>
<s1 title="Description">
<p>
The <code>MailAction</code> is the central for triggering the
creation of javamail objects.
Javamail objects as they are created are put into the request
attribute map.
</p>
<p>
Moreover <code>MailAction</code> maintains an http-session, and
putting into the
http-session the <code>mail-context</code> of a mail session.
</p>
</s1>
<s1 title="Usage">
<p>
Use the <code>MailAction</code> in case of accessing information
accessible via
IMAP, or more general accessible via an registed javamail provider.
</p>
<s2 title="Sitemap pipeline examples">
<p>
Setting up the MailAction requires configuring the mail session.
The parameter <code>store-urlname</code> identifies the store which
should be used.
The snippet below spefies using the protocol <code>imap</code>, and
using the
imap server host <code>imap-server-host-name</code>.
<br/>
Moreover the request parameters <code>mail-userid</code>, and
<code>mail-passwd</code>
replaces the placeholders <code>''mail-userid''</code>, and
<code>''mail-passwd''</code>
</p>
<p>
Finally as the javamail Session class accepts properties, for
configuration purpose,
the snippet below switches off the session debugging explicitly.
Parameter names having prefix
<code>javax.mail.Session.props:</code> are put
into the javamail session properties map, stripping off the prefix
first..
</p>
<source><![CDATA[
<map:match pattern="mail/*.html">
<map:action type="mail">
<!-- configure MailAction -->
<map:parameter name="store-urlname"
value="imap://''mail-userid'':''mail-passwd''@imap-server-host-name/"/>
<map:parameter name="javax.mail.Session.props:mail.debug"
value="false"/>
</map:action>
<!-- access javamail objects -->
<map:generator type="serverpages" src="docs/{1}.xsp"/>
<map:transform src="stylesheets/mail2html.xsl"/>
<map:transform type="html"/>
</map:match>
]]></source>
</s2>
<s2 title="Sitemap component configuration example">
<p>
The <code>MailAction</code> has no specific configuration
possibilities.
</p>
<source><![CDATA[
<map:actions...
<map:action name="mail"
src="org.apache.cocoon.mail.Action"
logger="sitemap.action.mail"
/>
...
]]></source>
</s2>
<s2 title="Configuration">
<p>
The <code>MailAction</code> has no specific configuration
possibilities.
</p>
</s2>
<s2 title="Setup">
<p>
Setting up the MailAction specifies the javamail Session to use,
and
principal javamail Store to use.
</p>
</s2>
<s2 title="Effect on Object Model and Sitemap Parameters">
<p>
</p>
</s2>
<s2 title="Request Attribute Objects">
<p>
As noted above <code>MailAction</code> puts XMLizable javamail
objects
into the request attribute map. The following table lists the
request attribute
names, set by <code>MailAction</code>.
</p>
<table>
<caption>Request Attribues Set By MailAction</caption>
<tr><th>Request Attribute Name</th><th>Comment</th></tr>
<tr><td>folder</td><td>A single folder</td></tr>
<tr><td>folders</td><td>Multiple folders</td></tr>
<tr><td>message</td><td>A single message</td></tr>
<tr><td>messages</td><td>Multiple messages</td></tr>
<tr><td>mail-current-working-folder</td><td>The current working
folder name</td></tr>
<tr><td>mail-current-working-command</td><td>The command processded
by MailAction</td></tr>
</table>
<p>
Each command generates zero, one, or more javamail objects, which
are wrapped
to become XMLizable, and put into the request attribute map.
</p>
</s2>
</s1>
<s1 title="MailAction Commands">
<p>
The <code>MailAction</code> supports following commands
</p>
<table>
<caption>List Of MailAction commands</caption>
<tr><th>Command</th><th>Class</th></tr>
<tr><td>cat-folder</td><td>MailCommandManager.MailFolderCatCommand</td></tr>
<tr><td>refresh-folder</td><td>MailCommandManager.MailRefreshFolderCommand</td></tr>
<tr><td>list-folder</td><td>MailCommandManager.MailListFolderCommand</td></tr>
<tr><td>list-folder-messages</td><td>MailCommandManager.MailListMessagesCommand</td></tr>
<tr><td>search-folder-messages</td><td>MailCommandManager.MailSearchMessagesCommand</td></tr>
<tr><td>cat-message-by-id</td><td>MailCommandManager.MailCatMessageByIdCommand</td></tr>
<tr><td>cat-message-by-uid</td><td>MailCommandManager.MailCatMessageByUIDCommand</td></tr>
<tr><td>cat-attachment-of-message-by-id</td><td>MailCommandManager.MailCatAttachmentMessageByIdCommand</td></tr>
</table>
<p>
The following sections describe each of the commands above.
</p>
<s2 title="MailFolderCatCommand">
<p>
This command cats information about a folder
</p>
<table>
<caption>MailFolderCatCommand parameters</caption>
<tr><th>Parametername</th><th>Mode</th><th>Comment</th></tr>
<tr><td>folder</td><td>optional</td><td>Speficies the
foldername</td></tr>
</table>
</s2>
<!-- begin of description of commands -->
<s2 title="MailRefreshFolderCommand">
<p>
This command closes, and opens a folder, as a side effects new
messages of a folder
are read.
</p>
<table>
<caption>MailRefreshFolderCommand parameters</caption>
<tr><th>Parametername</th><th>Mode</th><th>Comment</th></tr>
<tr><td>folder</td><td>optional</td><td>Speficies the
foldername</td></tr>
</table>
</s2>
<s2 title="MailListFolderCommand">
<p>
This command list all subfolders of a folder.
</p>
<table>
<caption>MailListFolderCommand parameters</caption>
<tr><th>Parametername</th><th>Mode</th><th>Comment</th></tr>
<tr><td>folder</td><td>optional</td><td>Speficies the
foldername</td></tr>
<tr><td>folder-pattern</td><td>optional</td><td>Speficies the
folder-pattern to use,
see javamail documentation for allowed wildcards, by default the
folder-pattern '%' is used.
</td>
</tr>
</table>
</s2>
<s2 title="MailListMessagesCommand">
<p>
This command lists all messages of a folder. This command does not
requests
the mail content, only the mail header information is prefetched.
</p>
<table>
<caption>MailListMessagesCommand parameters</caption>
<tr><th>Parametername</th><th>Mode</th><th>Comment</th></tr>
<tr><td>folder</td><td>optional</td><td>Speficies the
foldername</td></tr>
</table>
</s2>
<s2 title="MailSearchMessagesCommand">
<p>
This command searches for messages. It uses the javamail
<code>SearchTerm</code>
for searching, and it searches only in Subject, and From fields of
each message.
It uses <code>SubjectTerm</code>, and <code>FromStringTerm</code>
for searching.
See the javamail documentation for <code>SearchTerm</code> details.
</p>
<table>
<caption>MailSearchMessagesCommand parameters</caption>
<tr><th>Parametername</th><th>Mode</th><th>Comment</th></tr>
<tr><td>folder</td><td>optional</td><td>Speficies the
foldername</td></tr>
<tr><td>search</td><td>optional</td><td>Speficies the search
string, by default it has the
value of an empty string, matching all messages.</td>
</tr>
</table>
</s2>
<s2 title="MailCatMessageByIdCommand">
<p>
This command cats information about a message. The message is
specified by
it message id. This command requests the content of a message.
</p>
<table>
<caption>MailCatMessageByIdCommand parameters</caption>
<tr><th>Parametername</th><th>Mode</th><th>Comment</th></tr>
<tr><td>folder</td><td>optional</td><td>Speficies the
foldername</td></tr>
<tr><td>id</td><td>mandatory</td><td>Speficies the msgid integer
value</td></tr>
</table>
</s2>
<s2 title="MailCatMessageByUIDCommand">
<p>
This command cats information about a message. The message is
specified by
it message id. This command requests the content of a message.
</p>
<table>
<caption>MailCatMessageByUIDCommand parameters</caption>
<tr><th>Parametername</th><th>Mode</th><th>Comment</th></tr>
<tr><td>folder</td><td>optional</td><td>Speficies the
foldername</td></tr>
<tr><td>uid</td><td>mandatory</td><td>Speficies the uid of a
message</td></tr>
</table>
</s2>
<s2 title="MailCatAttachmentMessageByIdCommand paramters">
<p>
This command cats an attachment of a mail.
</p>
<table>
<caption>MailCatMessageByIdCommand parameters</caption>
<tr><th>Parametername</th><th>Mode</th><th>Comment</th></tr>
<tr><td>folder</td><td>optional</td><td>Speficies the
foldername</td></tr>
<tr><td>id</td><td>mandatory</td><td>Speficies the msgid integer
value</td></tr>
<tr><td>part-id</td><td>mandatory</td><td>Speficies the id of the
requested mail part.</td></tr>
</table>
</s2>
<!-- end of description of commands -->
</s1>
<s1 title="Marshalling Javamail Objects">
<p>
As <code>MailAction</code> puts XMLizable javamail objects like
<code>javax.mail.Folder</code>, <code>javax.mail.Message</code> into
the request
attribute map, the following sections describe the xml document
structure of
these objects
</p>
</s1>
<s1 title="Bugs/Caveats">
<p>
The <code>MailAction</code> is still work in progress.
The http-session handling, and the javamail session handling is not
stable
under every cirumstances.
</p>
</s1>
<s1 title="History">
<p>
01-04-03: initial creation
</p>
</s1>
<s1 title="Copyright">
<p>
Copyright (C) 1999-2002 The Apache Software Foundation. All rights
reserved.
</p>
</s1>
<s1 title="See also">
<p>
As <code>MailAction</code> relies on the javamail package, read more
about
<link
href="http://java.sun.com/products/javamail/index.html">javamail</link>.
</p>
<p>
</p>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/mail.xml
Index: mail.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<header>
<title>CocoonMail Login</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="CocoonMail Main">
<p>
Main page login successful, display folders, messages here...
</p>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/mail.xsp
Index: mail.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Version CVS: $Id: mail.xsp,v 1.1 2003/01/07 23:29:18 huber Exp $
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>
<root>
<xsp-request:get-attribute name="folder" as="object"/>
<xsp-request:get-attribute name="folders" as="object"/>
<xsp-request:get-attribute name="message" as="object"/>
<xsp-request:get-attribute name="messages" as="object"/>
<!--xsp-request:get-attribute name="attachments" as="object"/-->
</root>
</xsp:page>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/plans.xml
Index: plans.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<document>
<header>
<title>Plans</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="Plans TODO">
<ul>
<li>no plans,yet
</li>
</ul>
</s1>
<s1 title="Plans Realized">
<ul>
<li>no realizer plans, yet
</li>
</ul>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/regexpuridefaults-matcher.xml
Index: regexpuridefaults-matcher.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN"
"../../dtd/document-v10.dtd">
<!--
<![CDATA[ CVS Version: $Id: regexpuridefaults-matcher.xml,v 1.1 2003/01/07
23:29:18 huber Exp $
]]>
-->
<document>
<header>
<title>RegexpURIDefaultsMatcher in Cocoon</title>
<version>0.9</version>
<type>Technical document</type>
<authors>
<person name="Bernhard Huber" email="huber.at.apache.org"/>
</authors>
<abstract>This document describes the RegexpURIDefaultsMatcher of
Cocoon.</abstract>
</header>
<body>
<s1 title="RegexpURIDefaultsMatcher">
<table>
<tr>
<td>NAME</td><td>template</td>
</tr>
<tr>
<td>WHAT</td><td>The <code>RegexpURIDefaultsMatcher</code>
component is used
to serve data in a sitemap pipeline.
</td>
</tr>
<tr>
<td>TYPE</td><td>Matcher, Sitemap Component</td>
</tr>
<tr>
<!-- choose Core, the block name, or Scratchpad
depending on where RegexpURIDefaultsMatcher sources live
-->
<td>BLOCK</td><td>Core/Block-Name/Scratchpad</td>
</tr>
<tr>
<td>CLASS</td><td>org.apache.cocoon.matching.RegexpURIDefaultsMatcher</td>
</tr>
<!-- uncomment folling tr iff RegexpURIDefaultsMatcher is deprecated
-->
<!--tr>
<td>DEPRECATED</td><td>Cocoon 2.0, 2.1</td>
</tr-->
<tr>
<td>SINCE</td><td>Cocoon X.Y</td>
</tr>
<tr>
<td>CACHEABLE</td><td>not applicable</td>
</tr>
</table>
</s1>
<s1 title="Description">
<p>
A general description of RegexpURIDefaultsMatcher
</p>
</s1>
<s1 title="Usage">
<p>
A usage scenario of RegexpURIDefaultsMatcher
</p>
<s2 title="Sitemap pipeline examples">
<p></p>
<source><![CDATA[
<map:pipelines>
<map:pipeline>
<map:match pattern="page-*.html">
<map:generator
src="{1}"
>
<!-- option sitemap parameters -->
</map:generator>
</map:match>
</map:pipeline>
...
]]></source>
</s2>
<s2 title="Sitemap component configuration example">
<p></p>
<source><![CDATA[
<map:matchers...
<map:matcher name="template"
src="org.apache.cocoon.matching.RegexpURIDefaultsMatcher"
logger="sitemap.matcher.template"
/>
<!-- optional matcher configuration -->
...
</map:matcher>
...
]]></source>
</s2>
<s2 title="Configuration">
<p>
Explain the sitemap matcher configuration, options when declaring
template matcher
</p>
</s2>
<s2 title="Setup">
<p>
Explain the sitemap matcher setup, ie options when using template
matcher
</p>
</s2>
<s2 title="Effect on Object Model and Sitemap Parameters">
<p>
</p>
</s2>
</s1>
<s1 title="Bugs/Caveats">
<p>
<!-- Describe limitation, bugs of RegexpURIDefaultsMatcher -->
</p>
</s1>
<s1 title="History">
<p>
MM-DD-YY: initial creation
</p>
</s1>
<s1 title="Copyright">
<p>
Copyright (C) 1999-2002 The Apache Software Foundation. All rights
reserved.
</p>
</s1>
<s1 title="See also">
<p>
<!-- Links to related components pages. -->
A general documentation about matchers is available at
<link href="../concepts/matchers_selectors.html">Matchers and
Selectors</link>.
</p>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-2/snapshot.xml
Index: snapshot.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>Snapshot of Cocoon Webmail</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="Snapshot">
<p>
You might want to see some nice pictures of Cocoon Webmail
before installing, and configuring this application.
</p>
<s2 title="A List of Folders">
<p>
Cocoon Webmail presents a list of available folders;
select a folder to list the messages, or list subfolders.
</p>
<figure alt="List of folders" src="cocoon-webmail-1.jpg"/>
</s2>
<s2 title="A List of Messages">
<p>
Cocoon Webmail presents a list of messages holded
by a folder; select a message #id in order to show
the content of a mail.
</p>
<figure alt="List of messages" src="cocoon-webmail-2.jpg"/>
</s2>
<s2 title="Message Content">
<p>
Cocoon Webmail shows the content of a mail.
</p>
<figure alt="Message content" src="cocoon-webmail-3.jpg"/>
</s2>
</s1>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-3/index.xml
Index: index.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<p>
<strong>Cocoon WebMail</strong>
</p>
<ul>
<li class="r"><link href="page:login">Login</link></li>
<li class="r"><link href="page:index">Index</link> </li>
</ul>
<p>
<strong>More...</strong>
</p>
<ul>
<li class="g"> <link href="page:snapshot">Snapshots</link> </li>
<li class="g"> <link href="page:changes">Changes</link> </li>
<li class="g"> <link href="page:plans">Plans</link> </li>
<li class="g"> <link href="page:faq">FAQ</link> </li>
</ul>
<p>
<strong>Links</strong>
</p>
<ul>
<li class="b"><a target="new"
href="http://xml.apache.org/cocoon/">Cocoon</a></li>
<li class="b"><a target="new"
href="http://outerthought.net/wiki/Wiki.jsp?page=Main">Cocoon Wiki</a></li>
</ul>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-3/index.xsp
Index: index.xsp
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Version CVS: $Id: index.xsp,v 1.1 2003/01/07 23:29:19 huber Exp $
-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<document>
<header>
<title>Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<p>
</p>
</body>
</document>
</xsp:page>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-3/logout.xml
Index: logout.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<p>
<strong>Articles</strong>
</p>
<ul>
<li class="r"><link href="page:../index">Index</link> </li>
</ul>
<p>
<strong>More</strong>
</p>
<ul>
<li class="g"> <link href="page:../changes">Changes</link> </li>
<li class="g"> <link href="page:../plans">Plans</link> </li>
<li class="g"> <link href="page:../faq">FAQ</link> </li>
</ul>
<p>
<strong>Links</strong>
</p>
<ul>
<li class="b"><a target="new"
href="http://xml.apache.org/cocoon/">Cocoon</a></li>
<li class="b"><a target="new"
href="http://outerthought.net/wiki/Wiki.jsp?page=Main">Cocoon Wiki</a></li>
</ul>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/mid-col-3/mail.xml
Index: mail.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<p>
<strong>Articles</strong>
</p>
<ul>
<li class="r"><link href="page:../index">Index</link> </li>
</ul>
<p>
<strong>More</strong>
</p>
<ul>
<li class="g"> <link href="page:../changes">Changes</link> </li>
<li class="g"> <link href="page:../plans">Plans</link> </li>
<li class="g"> <link href="page:../faq">FAQ</link> </li>
</ul>
<p>
<strong>Links</strong>
</p>
<ul>
<li class="b"><a target="new"
href="http://xml.apache.org/cocoon/">Cocoon</a></li>
<li class="b"><a target="new"
href="http://outerthought.net/wiki/Wiki.jsp?page=Main">Cocoon Wiki</a></li>
</ul>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/docs/top-col-1/index.xml
Index: index.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>Index</title>
<authors>
<person name="Bernhard Huber" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<span style="width:60%" class="left">
<span class="header">Cocoon WebMail Client Application</span>
</span>
<span style="width:30%" class="right">
<img alt="Powered by Cocoon" hspace="0" vspace="0"
src="powered-by-cocoon.png"/>
</span>
</body>
</document>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/pagesheets/htmlpages.xml
Index: htmlpages.xml
===================================================================
<?xml version="1.0"?>
<pagesheet xmlns="http://apache.org/cocoon/paginate/1.0">
<rules>
<count type="element" name="s1" num="5" />
<link type="unit" num="1"/>
</rules>
</pagesheet>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/pagesheets/mailhtmlpages.xml
Index: mailhtmlpages.xml
===================================================================
<?xml version="1.0"?>
<pagesheet xmlns="http://apache.org/cocoon/paginate/1.0">
<rules>
<count type="element" name="tr" num="10" />
<link type="unit" num="2"/>
<link type="range" value="10"/>
</rules>
</pagesheet>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/asciiart/directory-hierarchy.txt
Index: directory-hierarchy.txt
===================================================================
contextroot
|
+---docs
| +---top_col_1
| +---mid_col_1
| +---mid_col_2
| +---mid_col_3
| +---mid_col_4
| \---bottom_col_1
|
+---resources
| |---styles
| |---asciiart
| \---images
|
+---stylesheets
|
+---pagesheets
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/asciiart/layout.txt
Index: layout.txt
===================================================================
+----------------------------------------+
| top_col_1 |
+----------------------------------------+
| head_col_1 |
+-----------+--------------+-------------+
| | | |
| mid_col_1 | mid_col_2 | mid_col_3 |
| | | |
| +--------------+ |
| | bottom_col_1 | |
+-----------+--------------+-------------+
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/asciiart/mailaction-dataflow.txt
Index: mailaction-dataflow.txt
===================================================================
request_parameter
|
+---cmd
+---folder
+---uid
+---search
+---...
|
+---http_session
| |
| +---mail_context
| |
| +---folder:{folder_name}
| +---param:{request_parameter}
| +---mail_session
| +---mail_store
|
++-----------+
| MailAction +----sitemap_parameters
++-----------+
|
+---request_attribute
| |
| +---folder
| +---folders
| +---message
| +---messages
| +---mail_current_working_folder
| +---mail_current_working_command
|
++-----------+
| Generator |
++-----------+
|
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/asciiart/serving-document-page-1.txt
Index: serving-document-page-1.txt
===================================================================
request_part_page_{page}_top_col_1
|
+-+------------------+
| resource_exists_in |
| docs_top_col_1 |
+-+------------------+
|
| +------------------+
+---+load_page_resource|
++-----------------+
|
+--select
| +--generate_page
| |
| \--generate_default_page
+-- serialze_xml
+----+
|
response_part_page_{page}_top_col_1
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/asciiart/serving-document-page.txt
Index: serving-document-page.txt
===================================================================
request_html
|
| +--------------------+
+---+ show_page_resource |
+-+------------------+
|
+--aggregate
| +--part:page_{page}_top_col_1
| +--part:page_{page}_head_col_1
| +--part:page_{page}_mid_col_1
| +--part:page_{page}_mid_col_2
| +--part:page_{page}_mid_col_3
| \--part:page_{page}_bottom_col_1
+-----+
|
+-+------------------+
| transform_site2html|
+-+------------------+
|
+-+------------------+
| serialize_html |
+-+------------------+
|
response_html
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/asciiart/serving-dynamic-page-1.txt
Index: serving-dynamic-page-1.txt
===================================================================
request_part_page_{page}_top_col_1
|
+-+-----------------+
| resource_exists |
| in_docs_top_col_1 |
+-+-----------------+
|
| +------------------+
+---+load_page_resource|
++-----------------+
|
+--select_parameter
| |
| +--generate_XSP_page
| +--generate_default_page
+--serialze_xml
+----+
|
response_part_page_{page}_top_col_1
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/asciiart/serving-dynamic-page.txt
Index: serving-dynamic-page.txt
===================================================================
request_html
|
+-+-----------------+
| invoke_MailAction |
+-+-----------------+
|
| +--------------------+
+---+ show_page_resource |
+-+------------------+
|
+--aggregate
| |
| +--part:page_{page}_top_col_1
| +--part:page_{page}_head_col_1
| +--part:page_{page}_mid_col_1
| +--part:page_{page}_mid_col_2
| +--part:page_{page}_mid_col_3
| +--part:page_{page}_bottom_col_1
+-----+
|
+-+------------------+
| transform_site2html|
+-+------------------+
|
+-+------------------+
| serialize_html |
+-+------------------+
|
response_html
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/asciiart/uri-space.txt
Index: uri-space.txt
===================================================================
root
|
+---*.html
|
+---mail
| +
| +---mail.html
| \---logout.html
|
+---*.css
|
+---*.gif;*.jpg;*.png
|
+---favicon.ico
|
+---asciiart
+
\----*.jpg
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/images/built-with-cocoon.gif
<<Binary file>>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/images/cocoon-webmail-1.jpg
<<Binary file>>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/images/cocoon-webmail-2.jpg
<<Binary file>>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/images/cocoon-webmail-3.jpg
<<Binary file>>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/images/favicon.ico
<<Binary file>>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/images/powered-by-cocoon.png
<<Binary file>>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/resources/styles/main.css
Index: main.css
===================================================================
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
}
/* big header font
*/
.header {
font-size: 240%;
font-weight: bold;
}
/* small footer font
*/
.footer {
font-size: 75%;
}
.list {
border-top: 1px dotted #999999;
font-size: 80%;
padding: 3px;
margin: 3px auto;
}
table {
font-size: 100%;
border-collapse: collapse;
border: thin solid #887788;
margin: auto;
}
table caption {
margin:auto;
color: #887788;
}
table td {
border: thin solid #887788;
}
/* source like blocks use a light background color
*/
pre {
padding: 2px;
background-color: #FFEEFF;
font-size: 90%;
}
/* mid-col-1, and mid-col-3 bullet list
*/
#mid-col-1 ul {
margin: 1px;
padding: 1px;
list-style: inside;
}
/* redsquare bullet
*/
#mid-col-1 ul li.r {
list-style-type:square;
color: #FF0000;
}
/* green square bullet
*/
#mid-col-1 ul li.g {
list-style-type:square;
color: #00FF00;
}
/* blue square bullet
*/
#mid-col-1 ul li.b {
list-style-type:square;
color: #0000FF;
}
#mid-col-3 ul {
margin: 1px;
padding: 1px;
list-style: inside;
}
/* redsquare bullet
*/
#mid-col-3 ul li.r {
list-style-type:square;
color: #FF0000;
}
/* green square bullet
*/
#mid-col-3 ul li.g {
list-style-type:square;
color: #00FF00;
}
/* blue square bullet
*/
#mid-col-3 ul li.b {
list-style-type:square;
color: #0000FF;
}
/* special header formatting for mid-col-2 section
*/
h1 {
color: #887788;
}
/* special header formatting for mid-col-2 section
*/
h2 {
color: #887788;
}
/* special header formatting for mid-col-2 section
*/
h3 {
color: #887788;
}
/* make dt text in mid-col-2 section bold, and use
same color as defined for the hX
*/
#mid-col-2 dt {
color: #887788;
font-weight: bold;
}
ul.inline {
margin: 2px;
padding: 2px;
}
li.inline {
display: inline;
padding-left: 3px;
padding-right: 7px;
border-right: 1px dotted #066;
margin: 1px;
}
li.last {
display: inline;
padding-left: 3px;
padding-right: 3px;
border-right: 0px;
}
div.row {
clear: both;
padding: 5px;
}
div.spacer {
clear: both;
}
div.row span.label {
float: left;
width: 10%;
text-align: right;
}
div.row span.formw {
float: right;
width: 86%;
text-align: left;
}
div.row span.left {
float: left;
text-align: left;
width: 48%;
}
div.row span.right {
float: right;
text-align: right;
padding-right: 2px;
width: 48%;
}
#top-section {
position:relative;
left:0;
top:0;
}
#head-section {
position:relative;
left:0;
top:0;
}
#mid-section {
position:relative;
left:0;
top:0;
}
#bottom-section {
position:relative;
left:0;
top:0;
}
#top-col-1 {
position:relative;
background-color: #EEDDEE;
color: #776677;
padding: 5px;
margin: 0px;
}
#head-col-1 {
background-color: lightgrey;
position:relative;
padding-left:5px;
margin: 0px;
}
#mid-col-1 {
position:absolute;
top:0;
left:0;
width:20%;
}
#mid-col-2 {
position:relative;
top:0;
left:20%;
width:68%;
border-left: 1px dotted #999999;
border-right: 1px dotted #999999;
padding: 3px
}
#mid-col-3 {
position:absolute;
top:0;
left:90%;
width:10%;
}
#bottom-col-1 {
position:relative;
padding-left:10%;
padding-right:10px;
}
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/stylesheets/filterlinks.xsl
Index: filterlinks.xsl
===================================================================
<?xml version="1.0"?>
<!--
This stylesheet filters all references which should
be ignored by any cocoon link crawling
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="@href">
<xsl:if test="not(contains(.,'.zip'))">
<xsl:copy>
<xsl:apply-templates select="."/>
</xsl:copy>
</xsl:if>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/stylesheets/mail-envelopes2document.xsl
Index: mail-envelopes2document.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:page="http://apache.org/cocoon/paginate/1.0"
xmlns:mail="http://apache.org/cocoon/mail/1.0"
exclude-result-prefixes="xsl page mail"
>
<xsl:template match="/">
<!--xsl:copy-of select="."/-->
<document>
<header>
<title>Folder</title>
</header>
<body>
<s1 title="Folder">
<table style="margin-left: auto; margin-right: auto;
width: 95%;
border-collapse: collapse;
border-top: 1px dotted;
border-bottom: 1px dotted;
"
class="list">
<tr>
<th align="left">#</th>
<th align="left">From</th>
<th align="left">Subject</th>
<th align="left">Sent</th>
<th align="left">Size</th>
</tr>
<xsl:apply-templates/>
</table>
</s1>
</body>
</document>
</xsl:template>
<xsl:template match="mail:message-envelope">
<tr >
<td style="border-top: 1px dotted; " >
<link>
<xsl:attribute
name="href">mail.html?cmd=cat-message-by-id&id=<xsl:value-of
select="mail:message-number"/></xsl:attribute>
<xsl:value-of select="mail:message-number"/>
</link>
</td>
<td style="border-top: 1px dotted; " ><xsl:value-of
select="mail:from/@personal"/> <<xsl:value-of
select="mail:from/@email-address"/>> </td>
<td style="border-top: 1px dotted; " ><xsl:value-of
select="mail:subject"/> </td>
<td style="border-top: 1px dotted; " ><xsl:value-of
select="mail:sent-date"/> </td>
<td style="border-top: 1px dotted; " ><xsl:value-of
select="mail:size"/> </td>
</tr>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/stylesheets/mail-folder2document.xsl
Index: mail-folder2document.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:page="http://apache.org/cocoon/paginate/1.0"
xmlns:mail="http://apache.org/cocoon/mail/1.0"
exclude-result-prefixes="xsl page"
>
<xsl:template match="/">
<!--xsl:copy-of select="."/-->
<document>
<header>
<title>Folder</title>
</header>
<body>
<xsl:apply-templates/>
</body>
</document>
</xsl:template>
<xsl:template match="mail:folder">
<xsl:attribute name="title">Folder - <xsl:value-of
select="@name"/></xsl:attribute>
<xsl:variable name="is-directory" select="@is-directory"/>
<xsl:variable name="holds-messages" select="@holds-messages"/>
<div class="list" style="width: 90%;">
<div class="row">
<span style="color: #887788; font-size:150%" class="left">
Name <xsl:value-of select="@full-name"/>
<xsl:text> </xsl:text>
<xsl:if test="$is-directory = 'yes'">
<a>
<xsl:attribute
name="href">mail.html?cmd=list-folder&folder=<xsl:value-of
select="@full-name"/></xsl:attribute>
folders
</a>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:if test="$holds-messages = 'yes'">
<xsl:if test="@has-new-messages = 'yes'">
has new messages
<xsl:text> </xsl:text>
</xsl:if>
<a>
<xsl:attribute
name="href">mail.html?cmd=list-folder-messages&folder=<xsl:value-of
select="@full-name"/></xsl:attribute>
messages
</a>
</xsl:if>
</span>
</div>
<div class="row">
<span class="left">Total/New/Deleted/Unread Messages </span>
<span class="right">
<xsl:value-of select="@total-messages"/> /
<xsl:value-of select="@new-messages"/> /
<xsl:value-of select="@deleted-messages"/> /
<xsl:value-of select="@unread-messages"/>
</span>
</div>
<div class="spacer"/>
</div>
</xsl:template>
<xsl:template match="@*|*|text()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/stylesheets/mail-message2document.xsl
Index: mail-message2document.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:page="http://apache.org/cocoon/paginate/1.0"
xmlns:mail="http://apache.org/cocoon/mail/1.0"
exclude-result-prefixes="xsl page"
>
<xsl:template match="/">
<!--xsl:copy-of select="."/-->
<document>
<header>
<title>Message</title>
</header>
<body>
<!-- get subject having a max. number of chars
-->
<xsl:variable name="subject"
select="/root/mail:mail/mail:message-envelope/mail:subject"/>
<xsl:variable name="subject-title">
<xsl:choose>
<xsl:when test="string-length($subject) > 32">
<xsl:value-of select="substring($subject, 1, 32 )"/>...
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$subject"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<s1>
<xsl:attribute name="title">Message #<xsl:value-of
select="/root/mail:mail/mail:message-envelope/mail:message-number"/> <xsl:text>
- </xsl:text><xsl:value-of select="$subject-title"/> </xsl:attribute>
<table class="list" style="margin-left: auto; margin-right: auto;
width: 95%;
border-collapse: collapse;
border-top: 1px dotted;
border-bottom: 1px dotted;
" >
<tr>
<th align="left">#</th>
<th align="left">From</th>
<th align="left">Subject</th>
<th align="left">Sent</th>
</tr>
<xsl:apply-templates
select="/root/mail:mail/mail:message-envelope"/>
</table>
<div class="row">
<span class="left">
<xsl:variable name="prev"
select="/root/mail:mail/mail:message-envelope/mail:message-number -1"/>
[<link href="mail.html?id={$prev}">Prev</link>]
</span>
<span class="right">
<xsl:variable name="next"
select="/root/mail:mail/mail:message-envelope/mail:message-number +1"/>
[<link href="mail.html?id={$next}">Next</link>]
</span>
</div>
<s2 title="Body">
<xsl:apply-templates select="/root/mail:mail/mail:part"/>
</s2>
<s2 title="Attachments">
<ul>
<xsl:apply-templates select="/root/mail:mail/mail:part"
mode="attachment"/>
</ul>
</s2>
</s1>
</body>
</document>
</xsl:template>
<xsl:template match="mail:message-envelope">
<tr>
<td><xsl:value-of select="mail:message-number"/></td>
<td><xsl:value-of select="mail:from/@personal"/> <<xsl:value-of
select="mail:from/@email-address"/>> </td>
<td><xsl:value-of select="mail:subject"/> </td>
<td><xsl:value-of select="mail:sent-date"/> </td>
</tr>
</xsl:template>
<xsl:template match="mail:[EMAIL PROTECTED] = 'multipart/report']">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="mail:[EMAIL PROTECTED] = 'multipart/alternative']">
<xsl:apply-templates select="mail:content/mail:part"/>
</xsl:template>
<xsl:template match="mail:[EMAIL PROTECTED] = 'multipart/mixed']">
<xsl:apply-templates select="mail:content/mail:part"/>
</xsl:template>
<xsl:template match="mail:[EMAIL PROTECTED] = 'text/plain']">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="mail:part">
</xsl:template>
<xsl:template match="mail:content">
<source>
<xsl:value-of select="."/>
</source>
</xsl:template>
<!-- attachments -->
<xsl:template match="mail:[EMAIL PROTECTED] = 'multipart/mixed']"
mode="attachment">
<xsl:apply-templates select="mail:content/mail:part" mode="attachment"/>
</xsl:template>
<xsl:template match="mail:part" mode="attachment">
<li>
Part: <xsl:value-of select="@part-num"/>,
<xsl:value-of select="@name"/>,
<xsl:value-of select="@file-name"/>,
<xsl:value-of select="@base-type"/>,
</li>
</xsl:template>
<xsl:template match="mail:content" mode="attachment">
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/stylesheets/mail-unknown2document.xsl
Index: mail-unknown2document.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:page="http://apache.org/cocoon/paginate/1.0"
xmlns:mail="http://apache.org/cocoon/mail/1.0"
exclude-result-prefixes="page mail"
>
<xsl:template match="/">
<document>
<header>
<title>Unknown</title>
</header>
<body>
<s1 title="Application Message">
<p>
Not content available
</p>
</s1>
</body>
</document>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/stylesheets/mail2document.xsl
Index: mail2document.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:page="http://apache.org/cocoon/paginate/1.0"
xmlns:mail="http://apache.org/cocoon/mail/1.0"
exclude-result-prefixes="xsl page mail"
>
<xsl:template match="document">
<document>
<body>
<xsl:apply-templates select="body/*"/>
</body>
</document>
</xsl:template>
<xsl:template match="body">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="mail:mail">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="mail:folder">
<div class="list" style="width: 90%;">
<div class="row">
<span class="left">Name</span> <span class="right"> <xsl:value-of
select="@name"/> </span>
</div>
<div class="row">
<span class="left">Total Messages</span> <span class="right">
<xsl:value-of select="@total-messages"/> </span>
</div>
<div class="row">
<span class="left">New Messages</span> <span class="right">
<xsl:value-of select="@new-messages"/> </span>
</div>
<div class="row">
<span class="left">Deleted Messages</span> <span class="right">
<xsl:value-of select="@deleted-messages"/> </span>
</div>
<div class="row">
<span class="left">Unread Message</span> <span class="right">
<xsl:value-of select="@unread-messages"/></span>
</div>
<div class="spacer"/>
<ul style="padding: 5px; ">
<li>Name <xsl:value-of select="@name"/></li>
<li>Fullname <xsl:value-of select="@full-name"/></li>
<li>URLname <xsl:value-of select="@url-name"/></li>
</ul>
<div class="spacer"/>
</div>
</xsl:template>
<xsl:template match="@*|*|text()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/stylesheets/site2html.xsl
Index: site2html.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Version <![CDATA[ $Id: site2html.xsl,v 1.1 2003/01/07 23:29:20 huber Exp $
]]>
Transformation of an aggregated site document to html
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:page="http://apache.org/cocoon/paginate/1.0"
exclude-result-prefixes="page"
>
<xsl:template match="site">
<!--xsl:copy-of select="."/-->
<html>
<head>
<title><xsl:value-of select="/site/mid-col-2/header/title"/></title>
<meta name="keywords" content="Cocoon, Java, IMAP, SMTP, XML, XSL, XSLT,
MultiChannel, publishing"/>
<meta name="description" content="A site mail access via Cocoon."
/>
<link rel="stylesheet" type="text/css" media="screen" title=""
href="main.css"/>
<link rel="icon" href="favicon.ico"/>
</head>
<body>
<div id="top-section">
<div id="top-col-1">
<xsl:apply-templates select="/site/top-col-1/*"/>
</div>
</div>
<div id="head-sectin">
<div id="head-col-1">
<xsl:apply-templates select="/site/head-col-1/*"/>
</div>
</div>
<div id="mid-section">
<div id="mid-col-1">
<xsl:apply-templates select="/site/mid-col-1/*"/>
</div>
<div id="mid-col-2">
<xsl:apply-templates select="/site/mid-col-2/*"/>
<br/>
<xsl:apply-templates select="/site/page:page"/>
<br/>
<xsl:apply-templates select="/site/bottom-col-1/*"/>
</div>
<div id="mid-col-3">
<xsl:apply-templates select="/site/mid-col-3/*"/>
</div>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="header">
</xsl:template>
<xsl:template match="body">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s1">
<h1><xsl:value-of select="@title"/></h1>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s2">
<h2><xsl:value-of select="@title"/></h2>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s3">
<h3><xsl:value-of select="@title"/></h3>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="source">
<pre><code><xsl:value-of select="."/></code></pre>
</xsl:template>
<xsl:template match="figure">
<p align="center">
<xsl:choose>
<xsl:when test="string(@width) and string(@height)">
<img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]" width="[EMAIL
PROTECTED]" height="[EMAIL PROTECTED]" border="0" vspace="4" hspace="4"/>
</xsl:when>
<xsl:otherwise>
<img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]" border="0"
vspace="4" hspace="4"/>
</xsl:otherwise>
</xsl:choose>
</p>
</xsl:template>
<xsl:template match="img">
<img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]" border="0" vspace="4"
hspace="4" align="right"/>
</xsl:template>
<xsl:template match="icon">
<img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]" border="0"
align="absmiddle"/>
</xsl:template>
<xsl:template match="link">
<a href="[EMAIL PROTECTED]">
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="jump">
<a href="[EMAIL PROTECTED]@anchor}">
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="anchor">
<a name="[EMAIL PROTECTED]"/>
</xsl:template>
<xsl:template match="page:page">
<div class="row">
<span class="left">
<xsl:for-each select="page:[EMAIL PROTECTED]'prev']">
[<a href="[EMAIL PROTECTED]"> <xsl:value-of select="@page"/> </a>]
</xsl:for-each>
<xsl:for-each select="page:[EMAIL PROTECTED]'prev']">
[<a href="[EMAIL PROTECTED]"> <xsl:value-of select="@page"/> </a>]
</xsl:for-each>
</span>
<span class ="right">
<xsl:for-each select="page:[EMAIL PROTECTED]'next']">
[<a href="[EMAIL PROTECTED]"> <xsl:value-of select="@page"/> </a>]
</xsl:for-each>
<xsl:for-each select="page:[EMAIL PROTECTED]'next']">
[<a href="[EMAIL PROTECTED]"><xsl:value-of select="@page"/></a>]
</xsl:for-each>
</span>
</div>
<div class="spacer"/>
<div class="row" align="center">
<xsl:value-of select="@current"/> / <xsl:value-of select="@total"/>
</div>
</xsl:template>
<xsl:template match="@*|*|text()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/mail/stylesheets/site2wml.xsl
Index: site2wml.xsl
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Version <![CDATA[ $Id: site2wml.xsl,v 1.1 2003/01/07 23:29:20 huber Exp $
]]>
Transformation of an aggregated site document to wml
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:page="http://apache.org/cocoon/paginate/1.0"
exclude-result-prefixes="page"
>
<xsl:template match="site">
<!--xsl:copy-of select="."/-->
<wml>
<template>
<do type="prev" name="prev" label="Zur�ck">
<prev/>
</do>
</template>
<card id="Main">
<xsl:attribute name="title"><xsl:value-of
select="/site/mid-col-2/header/title"/></xsl:attribute>
<xsl:apply-templates select="/site/mid-col-2/body/*"/>
<!--xsl:apply-templates select="/site/bottom-col-1/body/*"/-->
<p>
<xsl:apply-templates select="/site/page:page"/>
</p>
<p> <a href="#Links">Links</a>
</p>
</card>
<card id="Links" title="Links">
<xsl:apply-templates select="/site/top-col-1"/>
<xsl:apply-templates select="/site/mid-col-1/body/*"/>
<xsl:apply-templates select="/site/mid-col-3/body/*"/>
</card>
</wml>
</xsl:template>
<xsl:template match="top-col-1">
<p>
<em>
<xsl:value-of select="body/p"/>
</em>
</p>
</xsl:template>
<xsl:template match="ul|ol">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="li">
<xsl:text>»</xsl:text>
<xsl:apply-templates/>
<br/>
</xsl:template>
<xsl:template match="s1">
<p>
<strong><xsl:value-of select="@title"/></strong>
</p>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s2">
<p>
<em><xsl:value-of select="@title"/></em>
</p>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="s3">
<p>
<u><xsl:value-of select="@title"/></u>
</p>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="p">
<xsl:variable name="pcontent" select="."/>
<xsl:choose>
<xsl:when test="string-length($pcontent) > 120">
<p>
<xsl:value-of select="substring($pcontent, 1, 120 )"/>
<xsl:text>...</xsl:text>
</p>
</xsl:when>
<xsl:otherwise>
<p>
<xsl:apply-templates/>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="p/br">
<br/>
</xsl:template>
<xsl:template match="blockquote">
<p> <xsl:text> + </xsl:text>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="pre|source">
<p>
<xsl:text> ... </xsl:text>
</p>
</xsl:template>
<xsl:template match="link">
<xsl:variable name="href" select="@href"/>
<xsl:choose>
<xsl:when test="not(contains( $href, '.wml' ))">
<xsl:value-of select="."/>
<xsl:text>: </xsl:text>
<u><xsl:value-of select="@href"/></u>
</xsl:when>
<xsl:otherwise>
<a><xsl:attribute
name="href"><xsl:value-of
select="@href"/></xsl:attribute><xsl:value-of
select="."/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="jump">
<a href="[EMAIL PROTECTED]@anchor}">
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="page:page">
<xsl:if test="page:[EMAIL PROTECTED]'prev']">
[<a href="{page:[EMAIL PROTECTED] = 'prev']/@uri}">Back</a>]
</xsl:if>
 
<xsl:if test="page:[EMAIL PROTECTED]'next']">
[<a href="{page:[EMAIL PROTECTED] = 'next']/@uri}">Next</a>]
</xsl:if>
</xsl:template>
</xsl:stylesheet>
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]