cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r153796 - in cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal: coplets/basket/BasketManagerImpl.java profile/impl/GroupBasedProfileManager.java
Date Mon, 14 Feb 2005 15:11:15 GMT
Author: cziegeler
Date: Mon Feb 14 07:11:14 2005
New Revision: 153796

URL: http://svn.apache.org/viewcvs?view=rev&rev=153796
Log:
Fix bug in GroupBasedProfileManager; make basket independent from used authentication method

Modified:
    cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketManagerImpl.java
    cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketManagerImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketManagerImpl.java?view=diff&r1=153795&r2=153796
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketManagerImpl.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/BasketManagerImpl.java
Mon Feb 14 07:11:14 2005
@@ -71,8 +71,6 @@
 import org.apache.cocoon.servlet.multipart.Part;
 import org.apache.cocoon.servlet.multipart.PartOnDisk;
 import org.apache.cocoon.util.ClassUtils;
-import org.apache.cocoon.webapps.authentication.AuthenticationManager;
-import org.apache.cocoon.webapps.authentication.user.RequestState;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 
@@ -485,7 +483,7 @@
             this.saveContentStore(BRIEFCASE_KEY, store);
         } else if ( store instanceof Folder ) {
             this.saveContentStore(FOLDER_KEY, store);
-    }
+        }
     }
 
     /** 
@@ -544,9 +542,9 @@
                     store = new Briefcase(user);
                 } else {
                     store = new Folder(user);
+                }
             }
         }
-        }
         return store;
     }
     
@@ -689,19 +687,18 @@
      * Get the current user
      */
     protected String getUser() {
-            AuthenticationManager authManager = null;
-            try {
-                authManager = (AuthenticationManager)this.manager.lookup(AuthenticationManager.ROLE);
-                RequestState rs = authManager.getState();
-            return rs.getHandler().getUserId();
-            } catch (ServiceException ignore) {
-                // ignore this
+        PortalService service = null;
+        try {
+            service = (PortalService)this.manager.lookup(PortalService.ROLE);
+            return service.getComponentManager().getProfileManager().getUser().getUserName();
+        } catch (ServiceException ignore) {
+            // ignore this
         } finally {
-            this.manager.release(authManager);
-            }
+            this.manager.release(service);
+        }
         return null;
         
-        }
+    }
     
     /* (non-Javadoc)
      * @see org.apache.cocoon.portal.coplets.basket.BasketManager#getBasketActions()

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java?view=diff&r1=153795&r2=153796
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
Mon Feb 14 07:11:14 2005
@@ -403,7 +403,7 @@
             
             // first "load" the global data
             profile.setCopletBaseDatas( this.getGlobalBaseDatas(loader, info, service) );
-            profile.setCopletDatas( this.getGlobalDatas(loader, info, service) );
+            profile.setCopletDatas( this.getGlobalDatas(loader, info, service, profile) );
             
             // now load the user/group specific data
             if ( !this.getCopletInstanceDatas(loader, profile, info, service, CATEGORY_USER)
) {
@@ -464,7 +464,8 @@
     
     protected Map getGlobalDatas(final ProfileLS     loader,
                                  final UserInfo      info,
-                                 final PortalService service) 
+                                 final PortalService service,
+                                 final UserProfile   profile) 
     throws Exception {
         synchronized ( this ) {
             final Map key = this.buildKey(CATEGORY_GLOBAL, 
@@ -474,6 +475,8 @@
             final Map parameters = new HashMap();
             parameters.put(ProfileLS.PARAMETER_PROFILETYPE, 
                            ProfileLS.PROFILETYPE_COPLETDATA);
+            parameters.put(ProfileLS.PARAMETER_OBJECTMAP,
+                           profile.getCopletBaseDatas());
             
             if ( this.copletDatas.validity != null
                  && this.copletDatas.validity.isValid() == SourceValidity.VALID)
{
@@ -515,7 +518,7 @@
         Map parameters = new HashMap();
         parameters.put(ProfileLS.PARAMETER_PROFILETYPE, 
                        ProfileLS.PROFILETYPE_COPLETINSTANCEDATA);        
-        parameters.put(ProfileLS.PARAMETER_OBJECTMAP, 
+        parameters.put(ProfileLS.PARAMETER_OBJECTMAP,
                        profile.getCopletDatas());
 
         try {



Mime
View raw message