cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r496360 - in /cocoon/trunk/blocks/cocoon-auth: ./ cocoon-auth-sample/ cocoon-auth-sample/src/ cocoon-auth-sample/src/main/ cocoon-auth-sample/src/main/resources/ cocoon-auth-sample/src/main/resources/COB-INF/ cocoon-auth-sample/src/main/res...
Date Mon, 15 Jan 2007 15:03:25 GMT
Author: cziegeler
Date: Mon Jan 15 07:03:24 2007
New Revision: 496360

URL: http://svn.apache.org/viewvc?view=rev&rev=496360
Log:
Start adding a simple sample

Added:
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/   (with props)
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/pom.xml   (with props)
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/login.xml
  (with props)
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/protected.xml
  (with props)
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/sitemap.xmap
  (with props)
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/stylesheets/
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/stylesheets/simple-page2html.xsl
  (with props)
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/META-INF/
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/META-INF/cocoon/
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/META-INF/cocoon/spring/
    cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/META-INF/cocoon/spring/auth-cauth.xml
  (with props)
Modified:
    cocoon/trunk/blocks/cocoon-auth/pom.xml

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jan 15 07:03:24 2007
@@ -0,0 +1,8 @@
+target
+.classpath
+.project
+.wtpmodules
+.deployables
+*.ipr
+*.iml
+.settings

Added: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/pom.xml?view=auto&rev=496360
==============================================================================
--- cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/pom.xml (added)
+++ cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/pom.xml Mon Jan 15 07:03:24 2007
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<!--+
+    | @version $Id$
+    |
+    +-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.apache.cocoon</groupId>
+    <artifactId>cocoon-auth</artifactId>
+    <version>1-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>cocoon-auth-sample</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>Cocoon Authentication Sample</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-core</artifactId>
+      <version>2.2.0-M3-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-auth-impl</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+</project>

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/login.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/login.xml?view=auto&rev=496360
==============================================================================
--- cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/login.xml
(added)
+++ cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/login.xml
Mon Jan 15 07:03:24 2007
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- @version $Id$ -->
+<page>
+ <title>Login page</title>
+ <content>
+   <linkbar/>
+   <para>
+     This page serves as an example of the authentication framework.
+   </para>
+   <para>Please log in using your name (cocoon will work)</para>
+   <form target="do-login" method="post">
+     <input type="text" name="username"/>
+     <input type="submit">Login</input>
+   </form>
+ </content>
+</page>
+

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/login.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/login.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/protected.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/protected.xml?view=auto&rev=496360
==============================================================================
--- cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/protected.xml
(added)
+++ cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/protected.xml
Mon Jan 15 07:03:24 2007
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- @version $Id$ -->
+<page>
+ <title>Login page</title>
+ <content>
+   <linkbar/>
+   <para>
+     This page serves as an example of the authentication framework.
+   </para>
+   <para>You're are logged in now, and can read this protected document containing
very important
+         and secret information.</para>
+   <para>
+       <source>
+           TODO - Include User information here.
+       </source>
+   </para>
+ </content>
+</page>
+

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/protected.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/docs/protected.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/sitemap.xmap?view=auto&rev=496360
==============================================================================
--- cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/sitemap.xmap
(added)
+++ cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/sitemap.xmap
Mon Jan 15 07:03:24 2007
@@ -0,0 +1,92 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--+
+    | Cocoon Auth block samples sitemap
+    |
+    | @version $Id$
+    +-->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+
+  <!-- =========================== Pipelines ================================= -->
+  <map:pipelines>
+    <map:pipeline>
+      <map:match pattern="">
+        <map:redirect-to uri="login"/>
+      </map:match>
+
+      <!-- ================= -->
+      <!-- Simple login page -->
+      <!-- ================= -->
+      <map:match pattern="login">
+        <!-- if we are already logged in, redirect to the protected document -->
+        <map:act type="cauth-is-logged-in">
+          <map:parameter name="application" value="sample"/> 
+
+          <map:redirect-to uri="protected"/>
+        </map:act> 
+        <map:generate src="docs/login.xml"/>
+        <map:transform src="stylesheets/simple-page2html.xsl"/>
+        <map:transform type="encodeURL"/>
+        <map:serialize/>
+      </map:match>
+
+      <!-- ========================================= -->
+      <!-- Form target which performs auth service   -->
+      <!-- ========================================= -->
+      <map:match pattern="do-login">
+        <!-- try to login -->
+        <map:act type="cauth-login">
+          <map:parameter name="application" value="sample"/>
+          <map:parameter name="name" value="{request-param:username}"/>
+          <map:redirect-to uri="protected"/>
+        </map:act>
+        <!-- something was wrong, try it again -->
+        <map:redirect-to uri="login"/>
+      </map:match>
+
+      <!-- ================ -->
+      <!-- Protected area   -->
+      <!-- ================ -->
+      <map:match pattern="protected">
+        <map:act type="cauth-is-logged-in">
+          <map:parameter name="application" value="sample"/> 
+
+          <map:generate src="docs/protected.xml" type="jx"/>
+          <map:transform src="stylesheets/simple-page2html.xsl"/>
+          <map:transform type="encodeURL"/>
+          <map:serialize/>
+        </map:act>
+        <!-- something was wrong, redirect to login page -->
+        <map:redirect-to uri="login"/>
+      </map:match>
+
+      <!-- ========================================= -->
+      <!-- Logout link which invalidates the session -->
+      <!-- ========================================= -->
+      <map:match pattern="do-logout">
+        <map:act type="cauth-logout">
+          <map:parameter name="application" value="sample"/> 
+
+        </map:act>
+        <map:redirect-to uri="login"/>
+      </map:match>
+    </map:pipeline>
+
+  </map:pipelines>
+</map:sitemap>

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/sitemap.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/sitemap.xmap
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/stylesheets/simple-page2html.xsl
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/stylesheets/simple-page2html.xsl?view=auto&rev=496360
==============================================================================
--- cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/stylesheets/simple-page2html.xsl
(added)
+++ cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/stylesheets/simple-page2html.xsl
Mon Jan 15 07:03:24 2007
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- @version $Id$ -->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:template match="page">
+    <html>
+      <head>
+        <title>
+          <xsl:value-of select="title"/>
+        </title>
+        <META content="0" http-equiv="expires"/>
+        <META content="nocache" http-equiv="pragma"/>
+      </head>
+      <body bgcolor="white" alink="red" link="blue" vlink="blue">
+        <xsl:apply-templates/>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template match="title">
+    <h2 style="color: navy; text-align: center">
+      <xsl:apply-templates/>
+    </h2>
+  </xsl:template>
+
+  <xsl:template match="para">
+    <p align="center">
+      <i><xsl:apply-templates/></i>
+    </p>
+  </xsl:template>
+
+  <xsl:template match="form">
+    <form method="POST" action="{@target}">
+      <xsl:apply-templates/>
+    </form>
+  </xsl:template>
+
+  <xsl:template match="input">
+    <center>
+      <xsl:value-of select="@title"/>
+      <input type="{@type}" name="{@name}" value="{.}"/>
+    </center><br/>
+  </xsl:template>
+
+  <xsl:template match="linkbar">
+    <center>
+      [
+      <a href="login"> login </a>
+      |
+      <a href="protected"> protected </a>
+      |
+      <a href="do-logout"> logout </a>
+      ]
+    </center>
+  </xsl:template>
+
+ <xsl:template match="source">
+  <div style="background: #b9d3ee; border: thin; border-color: black; border-style: solid;
padding-left: 0.8em; 
+              padding-right: 0.8em; padding-top: 0px; padding-bottom: 0px; margin: 0.5ex
0px; clear: both;">
+  <textarea name="context" cols="80" rows="20" readonly="true">
+   <xsl:apply-templates/>
+  </textarea>
+  </div>
+ </xsl:template>
+
+  <xsl:template match="@*|node()" priority="-1" name="copy">
+   <xsl:copy>
+    <xsl:apply-templates select="@*|node()"/>
+   </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>
+<!-- vim: set et ts=2 sw=2: -->

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/stylesheets/simple-page2html.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/COB-INF/stylesheets/simple-page2html.xsl
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/META-INF/cocoon/spring/auth-cauth.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/META-INF/cocoon/spring/auth-cauth.xml?view=auto&rev=496360
==============================================================================
--- cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/META-INF/cocoon/spring/auth-cauth.xml
(added)
+++ cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/META-INF/cocoon/spring/auth-cauth.xml
Mon Jan 15 07:03:24 2007
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!--+
+    | This is a sample configuration for Cocoon Auth
+    |
+    | @version $Id$
+    +-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+
+  <!-- This is a simple security handler: -->
+  <bean name="org.apache.cocoon.auth.SecurityHandler/simple"
+        class="org.apache.cocoon.auth.impl.SimpleSecurityHandler"
+        scope="singleton">
+    <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/>
+    <property name="userProperties">
+      <value>
+        cocoon=cocoon
+        guest=guest
+      </value>
+    </property>
+  </bean>
+
+  <!--  This is the standard application -->
+  <bean name="org.apache.cocoon.auth.Application/sample"
+        class="org.apache.cocoon.auth.impl.StandardApplication"
+        scope="singleton">
+    <property name="securityHandler" ref="org.apache.cocoon.auth.SecurityHandler/simple"/>
+  </bean>
+
+</beans>
\ No newline at end of file

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/META-INF/cocoon/spring/auth-cauth.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-auth/cocoon-auth-sample/src/main/resources/META-INF/cocoon/spring/auth-cauth.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/blocks/cocoon-auth/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-auth/pom.xml?view=diff&rev=496360&r1=496359&r2=496360
==============================================================================
--- cocoon/trunk/blocks/cocoon-auth/pom.xml (original)
+++ cocoon/trunk/blocks/cocoon-auth/pom.xml Mon Jan 15 07:03:24 2007
@@ -36,5 +36,6 @@
   <modules>
     <module>cocoon-auth-api</module>
     <module>cocoon-auth-impl</module>
+    <module>cocoon-auth-sample</module>
   </modules>
 </project>



Mime
View raw message