cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r495905 - in /cocoon/trunk/blocks/cocoon-portal: cocoon-portal-auth-impl/src/main/java/org/apache/cocoon/auth/portal/ cocoon-portal-sample/src/main/resources/COB-INF/config/avalon/ cocoon-portal-sample/src/main/resources/COB-INF/config/spring/
Date Sat, 13 Jan 2007 14:55:07 GMT
Author: cziegeler
Date: Sat Jan 13 06:55:06 2007
New Revision: 495905

URL: http://svn.apache.org/viewvc?view=rev&rev=495905
Log:
Start conversion of auth block to spring

Added:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/auth-cauth.xml
  (with props)
Removed:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/avalon/auth-cauth.xconf
Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-auth-impl/src/main/java/org/apache/cocoon/auth/portal/StandardPortalApplication.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/avalon/cocoon-portal-sample.xconf

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-auth-impl/src/main/java/org/apache/cocoon/auth/portal/StandardPortalApplication.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-auth-impl/src/main/java/org/apache/cocoon/auth/portal/StandardPortalApplication.java?view=diff&rev=495905&r1=495904&r2=495905
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-auth-impl/src/main/java/org/apache/cocoon/auth/portal/StandardPortalApplication.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-auth-impl/src/main/java/org/apache/cocoon/auth/portal/StandardPortalApplication.java
Sat Jan 13 06:55:06 2007
@@ -25,10 +25,6 @@
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.event.user.UserEventUtil;
 import org.apache.cocoon.portal.om.PortalUser;
@@ -49,43 +45,17 @@
     public static final String PORTAL_USER = PortalUser.class.getName();
 
     /** The configuration. */
-    protected Map portalConfig;
+    protected Map portalConfig = Collections.EMPTY_MAP;
 
     /** The portal service. */
     protected PortalService portalService;
 
-    /**
-     * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration)
-     */
-    public void configure(final Configuration conf) throws ConfigurationException {
-        super.configure(conf);
-        final Configuration config = conf.getChild("profiles");
-        final Configuration[] children = config.getChildren();
-        this.portalConfig = new HashMap();
-        if ( children != null ) {
-            for(int i=0; i < children.length; i++) {
-                this.portalConfig.put(children[i].getName(), children[i].getAttribute("uri"));
-            }
-        }
+    public void setPortalService(PortalService s) {
+        this.portalService = s;
     }
 
-    /**
-     * @see org.apache.cocoon.auth.StandardApplication#dispose()
-     */
-    public void dispose() {
-        if ( this.manager != null ) {
-            this.manager.release(this.portalService);
-            this.portalService = null;
-        }
-        super.dispose();
-    }
-
-    /**
-     * @see org.apache.cocoon.auth.StandardApplication#service(org.apache.avalon.framework.service.ServiceManager)
-     */
-    public void service(ServiceManager aManager) throws ServiceException {
-        super.service(aManager);
-        this.portalService = (PortalService)this.manager.lookup(PortalService.ROLE);
+    public void setPortalConfig(Map config) {
+        this.portalConfig = config;
     }
 
     /**

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/avalon/cocoon-portal-sample.xconf
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/avalon/cocoon-portal-sample.xconf?view=diff&rev=495905&r1=495904&r2=495905
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/avalon/cocoon-portal-sample.xconf
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/avalon/cocoon-portal-sample.xconf
Sat Jan 13 06:55:06 2007
@@ -31,9 +31,6 @@
       | components properly. However, the best way is to start your
       | portal project from scratch!
       +-->
-  <!-- Load Sitemap components provided by CAuth. -->
-  <include src="resource://org/apache/cocoon/auth/sitemap-addons.xconf"/>
-
   <!-- Include portal roles -->
   <include src="resource://org/apache/cocoon/portal/portal.roles"/>
 
@@ -43,9 +40,6 @@
   <!-- If you don't need WSRP support, you can remove the following include -->
   <include src="resource://org/apache/cocoon/portal/wsrp/portal-wsrp.roles"/>
 
-  <!-- We use CAuth for authentication. If you don't use CAuth remove this line: -->
-  <include src="auth-cauth.xconf"/>
-  
   <!-- We use Castor for persisting/mapping the profiles to XML: -->
   <include src="resource://org/apache/cocoon/portal/persistence/castor/portal-castor.roles"/>
 

Added: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/auth-cauth.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/auth-cauth.xml?view=auto&rev=495905
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/auth-cauth.xml
(added)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/auth-cauth.xml
Sat Jan 13 06:55:06 2007
@@ -0,0 +1,48 @@
+<?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 the configuration for using CAuth for authentication.
+    |
+    | @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 security handler uses OJB and the hsqldb for the authentication: 
+  <bean name="org.apache.cocoon.auth.SecurityHandler/portal"
+        class="org.apache.cocoon.portal.security.DBSecurityHandler"
+        scope="singleton"/>
+  -->
+
+  <!-- If you want to use a pipeline for the authentication use this configuration: -->
+  <bean name="org.apache.cocoon.auth.SecurityHandler/portal"
+        class="org.apache.cocoon.auth.impl.PipelineSecurityHandler"
+        scope="singleton">
+    <property name="authenticationResource" value="cocoon:raw:/sunrise-authuser"/>
+  </bean>
+  
+  <bean name="org.apache.cocoon.auth.Application/portal"
+        class="org.apache.cocoon.auth.portal.StandardPortalApplication"
+        scope="singleton">
+    <property name="securityHandler" ref="org.apache.cocoon.auth.SecurityHandler/portal"/>
+  </bean>
+
+</beans>
\ No newline at end of file

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

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



Mime
View raw message