huber 2003/02/09 06:06:21
Added: src/scratchpad/webapp/samples/taglib TaglibTest.xhtml
parent.xhtml sitemap.xmap variable-p.xhtml
variable-r.xhtml variable-s.xhtml variable.xhtml
Log:
add taglib sample
Revision Changes Path
1.1
xml-cocoon2/src/scratchpad/webapp/samples/taglib/TaglibTest.xhtml
Index: TaglibTest.xhtml
===================================================================
<html xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Taglib Samples Intro</title>
</head>
<body bgcolor="#ffffff">
Samples to explain the possibilities of Tags
<table width="100%" align="center" cellpadding="2" cellspacing="2" border="1">
<tbody>
<tr>
<td align="center" width="50%">
<a href="parent.xhtml">ParentResolving and Iteration</a>
</td>
<td align="center" width="50%">
LocaleTag in Kombination with MonthTag
</td>
</tr>
<tr>
<td align="center" width="50%">
<a href="variable-p.xhtml">XPath-Resolving and Variables</a>
</td>
<td align="center" width="50%">
OutTag
</td>
</tr>
</tbody>
</table>
<p align="center">
<br />
<font size="-1">Copyright © 1999-2002
<a href="http://www.apache.org/">The Apache Software Foundation</a>
.
<br />
All rights reserved.</font>
</p>
</body>
</html>
1.1 xml-cocoon2/src/scratchpad/webapp/samples/taglib/parent.xhtml
Index: parent.xhtml
===================================================================
<?xml version="1.0"?>
<html xmlns:core="urn:apache:taglib:core" xmlns:dt="urn:apache:taglib:datetime"
xmlns:i18n="urn:apache:taglib:i18n"
xmlns:jxpath="urn:apache:taglib:jxpath:core"
xmlns:string="urn:apache:taglib:string" xmlns:test="urn:apache:taglib:test">
<title>Tag Test</title>
<h2>tag test</h2>
<i18n:locale localeRef="$session/locale" >
<h3>forEach</h3>
<p>
<table border="1" cellspaceing="0" cellpadding="5">
<tr>
<td>
<ul>
<jxpath:forEach varStatus="n" var="i" begin="2" end="10" step="2">
<li><jxpath:out value="$n/count" />. that's number <jxpath:out
value="i" /></li>
</jxpath:forEach>
</ul>
</td>
<td>
<ul><br/>
<jxpath:forEach varStatus="n" var="i" begin="2" end="10" step="2">
<br/>       <li><jxpath:out value="$n/count"
/>. that's number <jxpath:out value="i" /></li>
<br/></jxpath:forEach><br/>
</ul>
</td>
</tr>
</table>
</p>
<ul>
<jxpath:forEach varStatus="n" var="i" items="$request/BrowserLocales" >
<li><jxpath:out value="$n/count" />. <jxpath:out value="$i/language"
/></li>
</jxpath:forEach>
</ul>
<ul>
<jxpath:forEach varStatus="n" var="j" items="$session/RequestInfo" >
<li><jxpath:out value="$n/count" />. <jxpath:out value="j" /></li>
</jxpath:forEach>
</ul>
<jxpath:out value="$session/RequestInfo[5]/language" />
<h3>locale</h3>
<i18n:locale language="en">
<p>
<form>
<table border="1" >
<tr>
<i18n:locale>
<td>session language</td>
<td>
<select size="1" name="month">
<dt:months var="mon">
<option><jxpath:out value="$mon/month" /></option>
</dt:months>
</select>
</td>
</i18n:locale>
</tr>
<tr>
<i18n:locale language="de" country="DE">
<td>german</td>
<td>
<select size="1" name="month">
<dt:months var="mon">
<option><jxpath:out value="$mon/month" /></option>
</dt:months>
</select>
</td>
</i18n:locale>
</tr>
<tr>
<td colspan="2">
<i18n:locale><br/>
<td><br/>
<select size="1" name="month"><br/>
<dt:months var="mon"><br/>
<option><jxpath:out value="$mon/month"
/></option><br/>
</dt:months><br/>
</select><br/>
</td><br/>
</i18n:locale><br/>
</td>
</tr>
</table>
</form>
</p>
</i18n:locale>
</i18n:locale>
<p>
<a href="TaglibTest.xhtml">Back</a>
</p>
</html>
1.1 xml-cocoon2/src/scratchpad/webapp/samples/taglib/sitemap.xmap
Index: sitemap.xmap
===================================================================
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:components>
<map:transformers>
<map:transformer name="tag"
src="org.apache.cocoon.transformation.TagTransformer" pool-max="64" pool-min="0"
pool-grow="2" logger="sitemap.transformer.newtag">
<transformer-hint>tag</transformer-hint>
</map:transformer>
</map:transformers>
<map:actions>
<map:action name="tagtest" logger="sitemap.action.locale"
src="org.apache.cocoon.taglib.test.acting.TagtestAction" />
<map:action name="locale" logger="sitemap.action.locale"
src="org.apache.cocoon.acting.LocaleAction">
<store-in-session>true</store-in-session>
<create-session>true</create-session>
</map:action>
</map:actions>
</map:components>
<map:pipelines>
<map:pipeline>
<map:match pattern="**.xhtml">
<map:act type="locale" />
<map:act type="tagtest" />
<map:generate src="{1}.xhtml"/>
<map:transform type="tag" label="tag" />
<map:serialize />
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/taglib/variable-p.xhtml
Index: variable-p.xhtml
===================================================================
<?xml version="1.0"?>
<html xmlns:core="urn:apache:taglib:core" xmlns:dt="urn:apache:taglib:datetime"
xmlns:i18n="urn:apache:taglib:i18n"
xmlns:jxpath="urn:apache:taglib:jxpath:core"
xmlns:string="urn:apache:taglib:string" xmlns:test="urn:apache:taglib:test">
<title>Tag Test</title>
<h2>tag test</h2>
<string:trim var="p">pipeline</string:trim>
<string:trim var="$request/r">request</string:trim>
<string:trim var="$session/s">session</string:trim>
<string:trim var="$application/a">application</string:trim>
<h3>variables in pipeline</h3>
<p>
<table>
<tr>
<td>pipeline: </td><td><jxpath:out value="p" /></td>
</tr>
<tr>
<td>request: </td><td><jxpath:out value="$request/r" /></td>
</tr>
<tr>
<td>session: </td><td><jxpath:out value="$session/s" /></td>
</tr>
<tr>
<td>application: </td><td><jxpath:out value="$application/a" /></td>
</tr>
</table>
</p>
<a href="variable-p.xhtml">pipeline</a>
<a href="variable-r.xhtml">request</a>
<a href="variable-s.xhtml">session & application</a>
<p>
<a href="TaglibTest.xhtml">Back</a>
</p>
</html>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/taglib/variable-r.xhtml
Index: variable-r.xhtml
===================================================================
<?xml version="1.0"?>
<html xmlns:core="urn:apache:taglib:core" xmlns:dt="urn:apache:taglib:datetime"
xmlns:i18n="urn:apache:taglib:i18n"
xmlns:jxpath="urn:apache:taglib:jxpath:core"
xmlns:string="urn:apache:taglib:string" xmlns:test="urn:apache:taglib:test">
<title>Tag Test</title>
<h2>tag test</h2>
<string:trim var="p">pipeline</string:trim>
<string:trim var="$request/r">request</string:trim>
<h3>variables in request</h3>
<p>
<core:source src="variable.xhtml" />
</p>
<a href="variable-p.xhtml">pipeline</a>
<a href="variable-r.xhtml">request</a>
<a href="variable-s.xhtml">session & application</a>
<p>
<a href="TaglibTest.xhtml">Back</a>
</p>
</html>
1.1
xml-cocoon2/src/scratchpad/webapp/samples/taglib/variable-s.xhtml
Index: variable-s.xhtml
===================================================================
<?xml version="1.0"?>
<html xmlns:core="urn:apache:taglib:core" xmlns:dt="urn:apache:taglib:datetime"
xmlns:i18n="urn:apache:taglib:i18n"
xmlns:jxpath="urn:apache:taglib:jxpath:core"
xmlns:string="urn:apache:taglib:string" xmlns:test="urn:apache:taglib:test">
<title>Tag Test</title>
<h2>tag test</h2>
<h3>variables in session & application</h3>
<p>
<table>
<!--
<tr>
<td>pipeline: </td><td><jxpath:out value="p" /></td>
</tr>
-->
<tr>
<td>request: </td><td><jxpath:out value="$request/r" /></td>
</tr>
<tr>
<td>session: </td><td><jxpath:out value="$session/s" /></td>
</tr>
<tr>
<td>application: </td><td><jxpath:out value="$application/a" /></td>
</tr>
</table>
</p>
<a href="variable-p.xhtml">pipeline</a>
<a href="variable-r.xhtml">request</a>
<a href="variable-s.xhtml">session & application</a>
<p>
<a href="TaglibTest.xhtml">Back</a>
</p>
</html>
1.1 xml-cocoon2/src/scratchpad/webapp/samples/taglib/variable.xhtml
Index: variable.xhtml
===================================================================
<?xml version="1.0"?>
<html xmlns:core="urn:apache:taglib:core" xmlns:dt="urn:apache:taglib:datetime"
xmlns:i18n="urn:apache:taglib:i18n"
xmlns:jxpath="urn:apache:taglib:jxpath:core"
xmlns:string="urn:apache:taglib:string" xmlns:test="urn:apache:taglib:test">
<table>
<!-- tr>
<td>pipeline: </td><td><jxpath:out value="p" /></td>
</tr -->
<tr>
<td>request: </td><td><jxpath:out value="$request/r" /></td>
</tr>
<tr>
<td>session: </td><td><jxpath:out value="$session/s" /></td>
</tr>
<tr>
<td>application: </td><td><jxpath:out value="$application/a" /></td>
</tr>
</table>
</html>
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]