unico 2003/12/10 09:20:26
Modified: src/blocks/slide/samples sitemap.xmap flow.js
Added: src/blocks/slide/samples/styles description2html4locks.xsl
description2html4permissions.xsl
description2html4content.xsl
description2html4properties.xsl
principal2html4users.xsl
src/blocks/slide/samples/screens login-failed.xml logout.xml
authentication.jx login.xml
Removed: src/blocks/slide/samples description2html4content.xsl
logout.xml login.xml login-failed.xml
principal2html4users.xsl
description2html4properties.xsl principal2auth.xsl
redirect4login.xsl description2html4permissions.xsl
Log:
continue refactoring slide samples:
- move screens and styles in subdirectories
- handle authentication in flow
- remove some redundant stuff
- lock and property management
Revision Changes Path
1.12 +18 -38 cocoon-2.1/src/blocks/slide/samples/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/sitemap.xmap,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- sitemap.xmap 9 Dec 2003 09:53:22 -0000 1.11
+++ sitemap.xmap 10 Dec 2003 17:20:25 -0000 1.12
@@ -23,9 +23,6 @@
<map:selectors default="browser"/>
<map:actions>
- <map:action logger="sitemap.action.slide" name="principal-actions"
- src="org.apache.cocoon.acting.PrincipalMultiAction"/>
-
<map:action name="auth-protect" logger="sitemap.action.auth-protect"
src="org.apache.cocoon.webapps.authentication.acting.AuthAction"/>
<map:action name="auth-login" logger="sitemap.action.auth-login"
@@ -63,8 +60,8 @@
<authentication-manager>
<handlers>
<handler name="slidehandler"
xmlns:map="http://apache.org/cocoon/sitemap/1.0">
- <redirect-to uri="cocoon://samples/slide/login.html"/>
- <authentication uri="cocoon:raw:/authenticate"/>
+ <redirect-to uri="cocoon://slide-samples/login.html"/>
+ <authentication uri="cocoon:/authenticate"/>
</handler>
</handlers>
</authentication-manager>
@@ -84,13 +81,14 @@
</map:match>
<map:match pattern="authenticate">
- <map:generate src="cocoon:/principallist"/>
- <map:transform type="xslt" src="principal2auth.xsl">
- <map:parameter name="use-request-parameters" value="true"/>
- </map:transform>
- <map:serialize type="xml"/>
+ <map:call function="authenticate" />
</map:match>
+ <map:match pattern="authentication">
+ <map:generate type="jx" src="screens/authentication.jx" />
+ <map:serialize type="xml"/>
+ </map:match>
+
<!-- ============= Source description ============= -->
<map:match pattern="description/*/**">
<map:generate type="traverse" src="slide://[EMAIL
PROTECTED]:namespace}/{2}">
@@ -111,15 +109,10 @@
</map:match>
<map:match pattern="login.html">
- <map:generate src="login.xml"/>
+ <map:generate src="screens/login.xml"/>
<map:transform
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
<map:parameter name="contextPath" value="{request:contextPath}"/>
</map:transform>
- <!--
- <map:transform src="redirect4login.xsl">
- <map:parameter name="destination" value="{request-param:resource}"/>
- </map:transform>
- -->
<map:serialize/>
</map:match>
@@ -135,11 +128,6 @@
<map:transform
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
<map:parameter name="contextPath" value="{request:contextPath}"/>
</map:transform>
- <!--
- <map:transform src="redirect4login.xsl">
- <map:parameter name="destination" value="{request-param:resource}"/>
- </map:transform>
- -->
<map:serialize/>
</map:match>
@@ -147,7 +135,7 @@
<map:act type="auth-logout">
<map:parameter name="handler" value="slidehandler"/>
- <map:generate src="logout.xml"/>
+ <map:generate src="screens/logout.xml"/>
<map:transform
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
<map:parameter name="contextPath" value="{request:contextPath}"/>
</map:transform>
@@ -161,8 +149,6 @@
<map:act type="auth-protect">
<map:parameter name="handler" value="slidehandler"/>
- <!-- ============= Source content ================== -->
-
<map:match pattern="*.do">
<map:call function="public_{1}">
<map:parameter name="caller" value="{../ID}" />
@@ -170,9 +156,11 @@
</map:call>
</map:match>
+ <!-- ============= Source content ================== -->
+
<map:match pattern="content/**">
<map:generate src="cocoon:/description/{../ID}/{1}"/>
- <map:transform src="description2html4content.xsl">
+ <map:transform src="styles/description2html4content.xsl">
<map:parameter name="path" value="{1}" />
<map:parameter name="namespace" value="{global:namespace}" />
<map:parameter name="principal" value="{../ID}"/>
@@ -187,7 +175,7 @@
<!-- ============= Source properties =============== -->
<map:match pattern="properties/**">
<map:generate src="cocoon:/description/{../ID}/{1}"/>
- <map:transform src="description2html4properties.xsl"/>
+ <map:transform src="styles/description2html4properties.xsl"/>
<map:transform
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
<map:parameter name="contextPath" value="{request:contextPath}"/>
</map:transform>
@@ -202,9 +190,7 @@
<map:part src="cocoon:/principallist"/>
</map:aggregate>
- <map:transform src="description2html4permissions.xsl">
- <map:parameter name="contextPath" value="{request:contextPath}"/>
- </map:transform>
+ <map:transform src="styles/description2html4permissions.xsl"/>
<map:transform
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
<map:parameter name="contextPath" value="{request:contextPath}"/>
</map:transform>
@@ -214,8 +200,8 @@
<!-- ============= Source locks ==================== -->
<map:match pattern="locks/**">
<map:generate src="cocoon:/description/{../ID}/{1}"/>
- <map:transform src="description2html4locks.xsl">
- <map:parameter name="contextPath" value="{request:contextPath}"/>
+ <map:transform src="styles/description2html4locks.xsl">
+ <map:parameter name="path" value="{1}" />
</map:transform>
<map:transform
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
<map:parameter name="contextPath" value="{request:contextPath}"/>
@@ -223,19 +209,13 @@
<map:serialize type="html"/>
</map:match>
- <!-- ============= Source direct ================== -->
-
- <map:match pattern="view/**">
- <map:read src="slide://{../[EMAIL PROTECTED]:namespace}/{1}"/>
- </map:match>
-
<!-- ============= Repository users =============== -->
<map:match pattern="users/**">
<map:generate type="principallist">
<map:parameter name="principalprovider" value="slide"/>
<map:parameter name="principalcaller" value="{../ID}"/>
</map:generate>
- <map:transform src="principal2html4users.xsl">
+ <map:transform src="styles/principal2html4users.xsl">
<map:parameter name="contextPath" value="{request:contextPath}"/>
</map:transform>
<map:transform
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
1.2 +53 -6 cocoon-2.1/src/blocks/slide/samples/flow.js
Index: flow.js
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/flow.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- flow.js 8 Dec 2003 18:06:43 -0000 1.1
+++ flow.js 10 Dec 2003 17:20:25 -0000 1.2
@@ -1,10 +1,13 @@
importPackage(Packages.org.apache.cocoon.components.slide);
importPackage(Packages.org.apache.cocoon.components.source.helpers);
+importPackage(Packages.org.apache.excalibur.source);
var repository =
cocoon.getComponent("org.apache.cocoon.components.repository.SourceRepository");
var provider = cocoon.getComponent(PrincipalProvider.ROLE +
"Selector").select("slide");
-var resolver =
cocoon.getComponent("org.apache.excalibur.source.SourceResolver");
+var resolver = cocoon.getComponent(SourceResolver.ROLE);
+
+// ---------------------------------------------- utility functions
function getBaseURI() {
var namespace = cocoon.parameters["namespace"];
@@ -13,13 +16,27 @@
}
function getParentPath() {
- var parentPath = cocoon.request.getParameter("parentPath");
+ var parentPath = cocoon.request.getParameter("parentPath");
if (!parentPath.lastIndexOf('/') != parentPath.length-1) {
parentPath = parentPath + "/";
}
return parentPath;
}
+function getResourcePath() {
+ return cocoon.request.getParameter("resourcePath");
+
+}
+
+// ---------------------------------------------- authentication
+
+function authenticate() {
+ var userid = cocoon.request.getParameter("userid");
+ var password = cocoon.request.getParameter("password");
+ // TODO: if (password = correct) ..
+ cocoon.sendPage("authentication",{id:userid,role:"root"});
+}
+
// ---------------------------------------------- file management
// make a new collection
@@ -29,8 +46,6 @@
var collectionName = cocoon.request.getParameter("collectionName");
var location = baseUri + parentPath + collectionName;
var status = repository.makeCollection(location);
-
-// cocoon.log.info("make collection " + location + ": " + status);
cocoon.redirectTo("content" + parentPath);
}
@@ -62,7 +77,7 @@
function public_addproperty() {
var baseUri = getBaseURI();
- var resourcePath = cocoon.request.getParameter("resourcePath");
+ var resourcePath = getResourcePath();
var location = baseUri + resourcePath;
var source = null;
try {
@@ -84,7 +99,7 @@
function public_removeproperty() {
var baseUri = getBaseURI();
- var resourcePath = cocoon.request.getParameter("resourcePath");
+ var resourcePath = getResourcePath();
var location = baseUri + resourcePath;
var source = null;
try {
@@ -98,6 +113,38 @@
resolver.release(source);
}
}
+ cocoon.redirectTo("properties" + resourcePath);
+}
+
+// ---------------------------------------------- lock management
+
+function public_removelock() {
+ var baseUri = getBaseURI();
+ var resourcePath = getResourcePath();
+ var subject = cocoon.request.getParameter("subject");
+ var location = baseUri + resourcePath;
+
+ cocoon.log.info("removing lock " + subject + " from source " + location);
+
+ // TODO: remove lock
+
+ cocoon.redirectTo("locks" + resourcePath);
+}
+
+function public_addlock() {
+ var baseUri = getBaseURI();
+ var resourcePath = getResourcePath();
+ var subject = cocoon.request.getParameter("subject");
+ var type = cocoon.request.getParameter("type");
+ var inheritable = cocoon.request.getParameter("inheritable");
+ var exclusive = cocoon.request.getParameter("exclusive");
+ var location = baseUri + resourcePath;
+
+ cocoon.log.info("adding lock " + subject + " to source " + location);
+
+ // TODO: add lock
+
+ cocoon.redirectTo("locks" + resourcePath);
}
// ---------------------------------------------- user management
1.1
cocoon-2.1/src/blocks/slide/samples/styles/description2html4locks.xsl
Index: description2html4locks.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:collection="http://apache.org/cocoon/collection/1.0"
xmlns:dav="DAV:"
version="1.0">
<xsl:output indent="yes"/>
<xsl:param name="path" />
<xsl:template match="/">
<document>
<header>
<title>Jakarta Slide example</title>
<tab title="users" href="../users/"/>
<tab title="content" href="../content/{$path}"/>
<tab title="properties" href="../properties/{$path}"/>
<tab title="permissions" href="../permissions/{$path}"/>
<tab title="locks" href="../locks/{$path}"/>
<tab title="logout" href="../logout.html"/>
</header>
<body>
<row>
<xsl:apply-templates
select="collection:resource|collection:collection"/>
</row>
</body>
</document>
</xsl:template>
<xsl:template match="collection:resource|collection:collection">
<column title="Navigation">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<br/>
</td>
</tr>
<xsl:for-each select="collection:resource|collection:collection">
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<a href="../locks/{$path}/[EMAIL PROTECTED]">
<xsl:value-of select="@name"/>
</a>
</font>
</td>
</tr>
</xsl:for-each>
</table>
</column>
<column title="Locks">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<tr>
<td align="left">
<b>Subject</b>
</td>
<td align="left">
<b>Type</b>
</td>
<td align="left">
<b>Expiration</b>
</td>
<td align="left">
<b>Inheritable</b>
</td>
<td align="left">
<b>Exclusive</b>
</td>
<td align="right"/>
</tr>
<xsl:for-each select="collection:locks/collection:lock">
<tr bgcolor="#eeeeee">
<td align="left">
<xsl:value-of select="@subject"/>
</td>
<td align="left">
<xsl:value-of select="@type"/>
</td>
<td align="left">
<xsl:value-of select="@expiration"/>
</td>
<td align="left">
<xsl:value-of select="@inheritable"/>
</td>
<td align="left">
<xsl:value-of select="@exclusive"/>
</td>
<td align="right">
<form action="../removelock.do" method="post">
<input type="hidden" name="resourcePath" value="/{$path}"/>
<input type="hidden" name="subject" value="[EMAIL
PROTECTED]"/>
<input type="submit" name="doRemoveLock" value="Delete"/>
</form>
</td>
</tr>
</xsl:for-each>
<tr>
<form action="../addlock.do" method="post">
<input type="hidden" name="resourcePath" value="/{$path}"/>
<td align="left">
<input name="subject" type="text" size="20" maxlength="40"/>
</td>
<td align="left">
<input name="type" type="text" size="15" maxlength="40"/>
</td>
<td align="left">
<input name="expiration" type="text" size="15"
maxlength="40"/>
</td>
<td align="left">
<select name="inheritable">
<option>true</option>
<option>false</option>
</select>
</td>
<td align="left">
<select name="exclusive">
<option>true</option>
<option>false</option>
</select>
</td>
<td align="right">
<input type="submit" name="doAddLock" value="Add/Modify"/>
</td>
</form>
</tr>
</font>
</table>
</column>
</xsl:template>
</xsl:stylesheet>
1.1
cocoon-2.1/src/blocks/slide/samples/styles/description2html4permissions.xsl
Index: description2html4permissions.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:collection="http://apache.org/cocoon/collection/1.0"
xmlns:dav="DAV:"
xmlns:pl="http://apache.org/cocoon/principal/1.0"
version="1.0">
<xsl:output indent="yes"/>
<xsl:param name="path" />
<xsl:template match="/">
<document>
<header>
<title>Jakarta Slide example</title>
<tab title="users" href="../users/"/>
<tab title="content" href="../content/{$path}"/>
<tab title="properties" href="../properties/{$path}"/>
<tab title="permissions" href="../permissions/{$path}"/>
<tab title="locks" href="../locks/{$path}"/>
<tab title="logout" href="../logout.html"/>
</header>
<body>
<row>
<xsl:apply-templates
select="/document/collection:collection|/document/collection:resource"/>
</row>
</body>
</document>
</xsl:template>
<xsl:template match="collection:collection|collection:resource">
<column title="Navigation">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<br/>
</td>
</tr>
<xsl:for-each select="collection:collection|collection:resource">
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<a href="../permissions/{$path}">
<xsl:value-of select="@name"/>
</a>
</font>
</td>
</tr>
</xsl:for-each>
</table>
</column>
<column title="User permissions">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<tr>
<td align="left">
<b>Principal</b>
</td>
<td align="left">
<b>Privilege</b>
</td>
<td align="left">
<b>Inheritable</b>
</td>
<td align="left">
<b>Deny</b>
</td>
<td align="right"/>
</tr>
<xsl:for-each select="collection:permissions/collection:[EMAIL
PROTECTED]">
<tr>
<td align="left">
<xsl:value-of select="@principal"/>
</td>
<td align="left">
<xsl:value-of select="@privilege"/>
</td>
<td align="left">
<xsl:value-of select="@inheritable"/>
</td>
<td align="left">
<xsl:value-of select="@negative"/>
</td>
<td align="right">
<form action="removeUserPermission" method="post">
<input type="hidden" name="resourcePath" value="{$path}"/>
<input type="hidden" name="principal" value="[EMAIL
PROTECTED]"/>
<input type="hidden" name="privilege" value="[EMAIL
PROTECTED]"/>
<input type="hidden" name="inheritable" value="[EMAIL
PROTECTED]"/>
<input type="hidden" name="negative" value="[EMAIL
PROTECTED]"/>
<input type="submit" name="doRemovePrincipalPermission"
value="Delete"/>
</form>
</td>
</tr>
</xsl:for-each>
<tr>
<form action="addUserPermission" method="post">
<input type="hidden" name="cocoon-source-uri" value="[EMAIL
PROTECTED]"/>
<td align="left">
<select name="principal">
<option>ALL</option>
<option>SELF</option>
<option>GUEST</option>
<xsl:for-each select="/document/pl:list/pl:principal">
<option>
<xsl:value-of select="@pl:name"/>
</option>
</xsl:for-each>
</select>
</td>
<td align="left">
<select name="privilege">
<option>all</option>
<option>read</option>
<option>write</option>
<option>read-acl</option>
<option>write-acl</option>
<option>read-source</option>
<option>create-source</option>
<option>remove-source</option>
<option>lock-source</option>
<option>read-locks</option>
<option>read-property</option>
<option>create-property</option>
<option>modify-property</option>
<option>remove-property</option>
<option>read-content</option>
<option>create-content</option>
<option>modify-content</option>
<option>remove-content</option>
<option>grant-permission</option>
<option>revoke-permission</option>
</select>
</td>
<td align="left">
<select name="inheritable">
<option>true</option>
<option>false</option>
</select>
</td>
<td align="left">
<select name="negative">
<option>true</option>
<option>false</option>
</select>
</td>
<td align="right">
<input type="submit" name="doAddPrincipalPermission"
value="Add/Modify"/>
</td>
</form>
</tr>
</font>
</table>
</column>
<column title="Group permissions">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<tr>
<td align="left">
<b>Group</b>
</td>
<td align="left">
<b>Privilege</b>
</td>
<td align="left">
<b>Inheritable</b>
</td>
<td align="left">
<b>Deny</b>
</td>
<td align="right"/>
</tr>
<xsl:for-each select="collection:permissions/collection:[EMAIL
PROTECTED]">
<tr>
<td align="left">
<xsl:value-of select="@group"/>
</td>
<td align="left">
<xsl:value-of select="@privilege"/>
</td>
<td align="left">
<xsl:value-of select="@inheritable"/>
</td>
<td align="left">
<xsl:value-of select="@negative"/>
</td>
<td align="right">
<form action="removeGroupPermission" method="post">
<input type="hidden" name="resourcePath" value="{$path}"/>
<input type="hidden" name="group" value="[EMAIL PROTECTED]"/>
<input type="hidden" name="privilege" value="[EMAIL
PROTECTED]"/>
<input type="hidden" name="inheritable" value="[EMAIL
PROTECTED]"/>
<input type="hidden" name="negative" value="[EMAIL
PROTECTED]"/>
<input type="submit" name="doRemovePrincipalGroupPermission"
value="Delete"/>
</form>
</td>
</tr>
</xsl:for-each>
<tr>
<form action="addUserPermission" method="post">
<input type="hidden" name="resourcePath" value="{$path}"/>
<td align="left">
<select name="group">
<xsl:for-each select="/document/pl:list/pl:group">
<option>
<xsl:value-of select="@pl:name"/>
</option>
</xsl:for-each>
</select>
</td>
<td align="left">
<select name="privilege">
<option>all</option>
<option>read</option>
<option>write</option>
<option>read-acl</option>
<option>write-acl</option>
<option>read-source</option>
<option>create-source</option>
<option>remove-source</option>
<option>lock-source</option>
<option>read-locks</option>
<option>read-property</option>
<option>create-property</option>
<option>modify-property</option>
<option>remove-property</option>
<option>read-content</option>
<option>create-content</option>
<option>modify-content</option>
<option>remove-content</option>
<option>grant-permission</option>
<option>revoke-permission</option>
</select>
</td>
<td align="left">
<select name="inheritable">
<option>true</option>
<option>false</option>
</select>
</td>
<td align="left">
<select name="negative">
<option>true</option>
<option>false</option>
</select>
</td>
<td align="right">
<input type="submit" name="doAddPrincipalPermission"
value="Add/Modify"/>
</td>
</form>
</tr>
</table>
</column>
</xsl:template>
</xsl:stylesheet>
1.1
cocoon-2.1/src/blocks/slide/samples/styles/description2html4content.xsl
Index: description2html4content.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:collection="http://apache.org/cocoon/collection/1.0"
xmlns:dav="DAV:"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="1.0">
<xsl:output indent="yes"/>
<xsl:param name="path" />
<xsl:param name="namespace">cocoon</xsl:param>
<xsl:param name="principal">guest</xsl:param>
<xsl:template match="/">
<document>
<header>
<title>Jakarta Slide example</title>
<tab title="users" href="../users/"/>
<tab title="content" href="../content/{$path}"/>
<tab title="properties" href="../properties/{$path}"/>
<tab title="permissions" href="../permissions/{$path}"/>
<tab title="locks" href="../locks/{$path}"/>
<tab title="logout" href="../logout.html"/>
</header>
<body>
<row>
<xsl:apply-templates
select="collection:collection|collection:resource"/>
</row>
</body>
</document>
</xsl:template>
<xsl:template match="collection:collection|collection:resource">
<column title="Navigation">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<br/>
</td>
</tr>
<xsl:for-each select="collection:collection|collection:resource">
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<a href="[EMAIL PROTECTED]">
<xsl:value-of select="@name"/>
</a>
</font>
</td>
</tr>
</xsl:for-each>
</table>
</column>
<column title="Content">
<xsl:choose>
<xsl:when test="local-name() = 'collection'">
<table width="100%" cellspacing="0" cellpadding="5" align="center">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<tr>
<td align="left">
<b>Filename</b>
</td>
<td align="left">
<b>Type</b>
</td>
<td align="left">
<b>Size</b>
</td>
<td align="left">
<b>Last Modified</b>
</td>
<td align="right"/>
</tr>
<xsl:for-each
select="collection:collection|collection:resource">
<tr>
<td align="left">  
<a href="[EMAIL PROTECTED]"><xsl:value-of
select="@name"/></a>
</td>
<td align="left">
<xsl:value-of select="@mime-type"/>
</td>
<td align="left">
<xsl:value-of select="@contentlength"/>
</td>
<td align="left">
<xsl:value-of select="@date"/>
</td>
<td align="right">
<form action="../delete.do" method="post">
<input type="hidden" name="parentPath" value="/{$path}"
/>
<input type="hidden" name="resourceName" value="[EMAIL
PROTECTED]"/>
<input type="submit" name="doDeleteSource"
value="Delete"/>
</form>
</td>
</tr>
</xsl:for-each>
<tr>
<form action="../upload.do" method="post"
enctype="multipart/form-data">
<input type="hidden" name="parentPath" value="/{$path}"/>
<td align="left"><input type="text" name="resourceName"
size="15" maxlength="40"/></td>
<td align="left" colspan="3">
File:
<input type="file" name="uploadFile" size="15"
maxlength="40"/>
</td>
<td align="right">
<input type="submit" name="doUploadSource" value="Upload
File"/>
</td>
</form>
</tr>
<tr>
<form action="../mkcol.do" method="post">
<input type="hidden" name="parentPath" value="/{$path}"/>
<td align="left" colspan="4">
<input type="text" name="collectionName" size="15"
maxlength="40"/>
</td>
<td align="right">
<input type="submit" name="doCreateCollection"
value="Create collection"/>
</td>
</form>
</tr>
</font>
</table>
</xsl:when>
<xsl:when test="@mime-type='image/gif'">
<img src="../view/{$path}"/>
</xsl:when>
<xsl:when test="@mime-type='image/jpeg'">
<img src="../view/{$path}"/>
</xsl:when>
<xsl:when test="@mime-type='text/plain'">
<pre>
<xi:include href="slide://[EMAIL PROTECTED]/{$path}"
parse="text"/>
</pre>
</xsl:when>
<xsl:when test="@mime-type='text/xml'">
<pre>
<xi:include href="slide://[EMAIL PROTECTED]/{$path}"
parse="text"/>
</pre>
</xsl:when>
<xsl:otherwise>
<h3>Could not display content.</h3>
</xsl:otherwise>
</xsl:choose>
</column>
</xsl:template>
</xsl:stylesheet>
1.1
cocoon-2.1/src/blocks/slide/samples/styles/description2html4properties.xsl
Index: description2html4properties.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:collection="http://apache.org/cocoon/collection/1.0"
xmlns:dav="DAV:"
version="1.0">
<xsl:output indent="yes"/>
<xsl:param name="path" />
<xsl:param name="namespace">cocoon</xsl:param>
<xsl:param name="principal">guest</xsl:param>
<xsl:template match="/">
<document>
<header>
<title>Jakarta Slide example</title>
<tab title="users" href="../users/"/>
<tab title="content" href="../content/{$path}"/>
<tab title="properties" href="../properties/{$path}"/>
<tab title="permissions" href="../permissions/{$path}"/>
<tab title="locks" href="../locks/{$path}"/>
<tab title="logout" href="../logout.html"/>
</header>
<body>
<row>
<xsl:apply-templates
select="collection:collection|collection:resource"/>
</row>
</body>
</document>
</xsl:template>
<xsl:template match="collection:collection|collection:resource">
<column title="Navigation">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<br/>
</td>
</tr>
<xsl:for-each select="collection:collection|collection:resource">
<tr>
<td width="100%" bgcolor="#ffffff" align="left">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<a href="../properties/{$path}/[EMAIL PROTECTED]">
<xsl:value-of select="@name"/>
</a>
</font>
</td>
</tr>
</xsl:for-each>
</table>
</column>
<column title="Properties">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<tr>
<td align="left">
<b>Namespace</b>
</td>
<td align="left">
<b>Name</b>
</td>
<td align="left">
<b>Value</b>
</td>
<td align="right"/>
</tr>
<xsl:for-each select="collection:properties/child::node()">
<tr>
<td align="left">
<xsl:value-of select="namespace-uri(.)"/>
</td>
<td align="left">
<xsl:value-of select="local-name(.)"/>
</td>
<td align="left">
<xsl:value-of select="."/>
</td>
<td align="right">
<xsl:if test="namespace-uri()!='DAV:'">
<form action="../removeproperty.do" method="post">
<input type="hidden" name="resourcePath"
value="/{$path}"/>
<input type="hidden" name="namespace"
value="{namespace-uri()}"/>
<input type="hidden" name="name" value="{local-name()}"/>
<input type="submit" name="doDeleteProperty"
value="Delete"/>
</form>
</xsl:if>
</td>
</tr>
</xsl:for-each>
<tr>
<form action="../addproperty.do" method="post">
<input type="hidden" name="resourcePath" value="/{$path}"/>
<td align="left">
<input name="namespace" type="text" size="15" maxlength="40"/>
</td>
<td align="left">
<input name="name" type="text" size="15" maxlength="40"/>
</td>
<td align="left">
<input name="value" type="text" size="15" maxlength="40"/>
</td>
<td align="right">
<input type="submit" name="doAddProperty" value="Add/Modify"/>
</td>
</form>
</tr>
</font>
</table>
</column>
</xsl:template>
</xsl:stylesheet>
1.1
cocoon-2.1/src/blocks/slide/samples/styles/principal2html4users.xsl
Index: principal2html4users.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pl="http://apache.org/cocoon/principal/1.0" version="1.0">
<xsl:output indent="yes"/>
<xsl:template match="/">
<document>
<header>
<title>Jakarta Slide example</title>
<tab title="users" href="../users/"/>
<tab title="content" href="../content/"/>
<tab title="properties" href="../properties/"/>
<tab title="permissions" href="../permissions/"/>
<tab title="locks" href="../locks/"/>
<tab title="logout" href="../logout.html"/>
</header>
<body>
<row>
<xsl:apply-templates select="pl:list"/>
</row>
</body>
</document>
</xsl:template>
<xsl:template match="pl:list">
<column title="Users">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<tr>
<td align="left">
<b>User</b>
</td>
<td align="left"/>
<td align="left">
<b>Role</b>
</td>
<td align="left">
<b>Groups</b>
</td>
<td align="left"/>
<td align="right"/>
</tr>
<xsl:for-each select="pl:principal">
<tr>
<form action="../removeuser.do" method="post">
<input type="hidden" name="username" value="[EMAIL
PROTECTED]"/>
<td align="left">
<xsl:value-of select="@name"/>
</td>
<td align="left">
<input type="submit" name="doRemovePrincipal" value="Delete
user"/>
</td>
</form>
<td align="left">
<xsl:value-of select="@role"/>
</td>
<form action="../removemember.do" method="post">
<input type="hidden" name="username" value="[EMAIL
PROTECTED]"/>
<td align="left">
<xsl:variable name="name" select="@name"/>
<select name="groupname" size="{count(../pl:group/pl:[EMAIL
PROTECTED])}">
<xsl:for-each select="../pl:group/pl:[EMAIL PROTECTED]">
<option>
<xsl:value-of select="../@name"/>
</option>
</xsl:for-each>
</select>
</td>
<td align="left">
<input type="submit" name="doRemovePrincipalGroupMember"
value="Remove group"/>
</td>
</form>
</tr>
<tr>
<td align="left"/>
<td align="left"/>
<td align="left"/>
<form action="../addmember.do" method="post">
<input type="hidden" name="username" value="[EMAIL
PROTECTED]"/>
<td align="left">
<xsl:variable name="name" select="@name"/>
<select name="groupname" size="1">
<xsl:for-each select="../pl:group">
<option>
<xsl:value-of select="@name"/>
</option>
</xsl:for-each>
</select>
</td>
<td align="left">
<input type="submit" name="doAddPrincipalGroupMember"
value="Add group"/>
</td>
</form>
</tr>
</xsl:for-each>
<tr>
<form action="../adduser.do" method="post">
<td align="left">
<input name="username" type="text" size="10" maxlength="40"/>
</td>
<td align="left"/>
<td align="left">
<input name="role" type="text" size="10" maxlength="40"/>
</td>
<td align="left">Password:</td>
<td align="left">
<input name="password" type="text" size="10" maxlength="40"/>
</td>
<td align="right">
<input type="submit" name="doAddPrincipal" value="Add user"/>
</td>
</form>
</tr>
</font>
</table>
</column>
<column title="Groups">
<table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"
width="100%" align="center">
<font size="+0" face="arial,helvetica,sanserif" color="#000000">
<tr>
<td align="left">
<b>Group</b>
</td>
<td align="right"/>
</tr>
<xsl:for-each select="pl:group">
<tr>
<form action="../removegroup.do" method="post">
<input type="hidden" name="groupname" value="[EMAIL
PROTECTED]"/>
<td align="left">
<xsl:value-of select="@name"/>
</td>
<td align="right">
<input type="submit" name="doRemovePrincipalGroup"
value="Delete group"/>
</td>
</form>
</tr>
</xsl:for-each>
<tr>
<form action="../addgroup.do" method="post">
<td align="left">
<input name="groupname" type="text" size="15" maxlength="40"/>
</td>
<td align="right">
<input type="submit" name="doAddPrincipalGroup" value="Add
group"/>
</td>
</form>
</tr>
</font>
</table>
</column>
</xsl:template>
</xsl:stylesheet>
1.1
cocoon-2.1/src/blocks/slide/samples/screens/login-failed.xml
Index: login-failed.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>Jakarta Slide example</title>
</header>
<body>
<row>
<column title="Back">
<a href="../">Back</a> - to Cocoon examples main page
</column>
<column title="Login failed">
<table border="0" cellspacing="0" cellpadding="2">
<form action="login" method="post">
<input type="hidden" name="resource" value="content/"/>
<tr>
<td>Username</td>
<td>
<input name="userid" type="text" size="15" maxlength="40"/>
</td>
</tr>
<tr>
<td>Password</td>
<td>
<input name="password" type="password" size="15"
maxlength="40"/>
</td>
</tr>
<tr>
<td/>
<td>
<input type="submit" name="cocoon-login" value="Login"/>
</td>
</tr>
<tr>
<td/>
<td>Login failed!</td>
</tr>
<tr>
<td/>
<td>Try root,root or john,john</td>
</tr>
</form>
</table>
</column>
</row>
</body>
</document>
1.1 cocoon-2.1/src/blocks/slide/samples/screens/logout.xml
Index: logout.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>Jakarta Slide example</title>
<tab title="login" href="login.html"/>
</header>
<body>
<row>
<column title="Back">
<a href="../">Back</a> - to Cocoon examples main page
</column>
<column title="Logout">
<p>Good bye.</p>
</column>
</row>
</body>
</document>
1.1
cocoon-2.1/src/blocks/slide/samples/screens/authentication.jx
Index: authentication.jx
===================================================================
<?xml version="1.0"?>
<authentication>
<ID>${id}</ID>
<role>${role}</role>
</authentication>
1.1 cocoon-2.1/src/blocks/slide/samples/screens/login.xml
Index: login.xml
===================================================================
<?xml version="1.0"?>
<document>
<header>
<title>Jakarta Slide example</title>
</header>
<body>
<row>
<column title="Back">
<a href="../">Back</a> - to Cocoon examples main page
</column>
<column title="Login">
<p class="samplesNote">These Slide examples require Java Transaction
API library to be present. Get jta.jar and place it to the lib folder
before trying these examples.
</p>
<table border="0" cellspacing="0" cellpadding="2">
<form action="login" method="post">
<input type="hidden" name="resource" value="content/"/>
<tr>
<td>Username</td>
<td>
<input name="userid" type="text" size="15" maxlength="40"/>
</td>
</tr>
<tr>
<td>Password</td>
<td>
<input name="password" type="password" size="15"
maxlength="40"/>
</td>
</tr>
<tr>
<td/>
<td>
<input type="submit" name="cocoon-login" value="Login"/>
</td>
</tr>
<tr>
<td/>
<td>Try root,root or john,john</td>
</tr>
</form>
</table>
</column>
</row>
</body>
</document>