cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r125614 - in cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal: pluto/om profile profile/impl
Date Wed, 19 Jan 2005 11:22:10 GMT
Author: cziegeler
Date: Wed Jan 19 03:22:07 2005
New Revision: 125614

URL: http://svn.apache.org/viewcvs?view=rev&rev=125614
Log:
Correct profile saving
Modified:
   cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java
   cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/ProfileManager.java
   cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java
   cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java?view=diff&rev=125614&p1=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java&r1=125613&p2=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java&r2=125614
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/pluto/om/PortletEntityImpl.java
Wed Jan 19 03:22:07 2005
@@ -131,7 +131,7 @@
      * @see org.apache.pluto.om.entity.PortletEntityCtrl#store()
      */
     public void store() throws IOException {
-        coplet.getProfileManager().saveUserCopletInstance(null);
+        coplet.getProfileManager().saveUserCopletInstanceDatas(null);
     }
 
 }

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/ProfileManager.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/ProfileManager.java?view=diff&rev=125614&p1=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/ProfileManager.java&r1=125613&p2=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/ProfileManager.java&r2=125614
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/ProfileManager.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/ProfileManager.java
Wed Jan 19 03:22:07 2005
@@ -89,7 +89,10 @@
     void unregister(Layout layout);
 
     /**
-     * Save the profile
+     * Save the profile. Usually this just calls {@link #saveUserCopletInstanceDatas(String)}
+     * and {@link #saveUserLayout(String)}, but implementations are free to
+     * implement this method in a different way.
+     * @param layoutKey
      */
     void saveUserProfiles(String layoutKey);
 
@@ -100,10 +103,10 @@
     void saveUserLayout(String layoutKey);
 
     /**
-     * Save the coplet instance
+     * Save the coplet instance data
      * @param layoutKey
      */
-    void saveUserCopletInstance(String layoutKey);
+    void saveUserCopletInstanceDatas(String layoutKey);
 
     /**
      * Get all instances

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java?view=diff&rev=125614&p1=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java&r1=125613&p2=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java&r2=125614
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AbstractProfileManager.java
Wed Jan 19 03:22:07 2005
@@ -62,14 +62,14 @@
      * @see org.apache.cocoon.portal.profile.ProfileManager#saveUserProfiles(String)
      */
     public void saveUserProfiles(String layoutKey) {
-        saveUserCopletInstance(layoutKey);
-        saveUserLayout(layoutKey);
+        this.saveUserCopletInstanceDatas(layoutKey);
+        this.saveUserLayout(layoutKey);
     }
 
     /* (non-Javadoc)
-     * @see org.apache.cocoon.portal.profile.ProfileManager#saveUserCopletInstance(String)
+     * @see org.apache.cocoon.portal.profile.ProfileManager#saveUserCopletInstanceDatas(java.lang.String)
      */
-    public void saveUserCopletInstance(String layoutKey) {
+    public void saveUserCopletInstanceDatas(String layoutKey) {
         // override in subclass
     }
 

Modified: cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java?view=diff&rev=125614&p1=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java&r1=125613&p2=cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java&r2=125614
==============================================================================
--- cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
(original)
+++ cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
Wed Jan 19 03:22:07 2005
@@ -148,7 +148,10 @@
         return layout;
     }
 
-    public void saveUserCopletInstance(String layoutKey) {
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.portal.profile.ProfileManager#saveUserCopletInstanceDatas(java.lang.String)
+     */
+    public void saveUserCopletInstanceDatas(String layoutKey) {
         ProfileLS adapter = null;
         PortalService service = null;
         try {
@@ -158,28 +161,24 @@
                 layoutKey = service.getDefaultLayoutKey();
             }
 
-            RequestState state = this.getRequestState();
-            UserHandler handler = state.getHandler();
+            final RequestState state = this.getRequestState();
+            final UserHandler handler = state.getHandler();
 
-            HashMap parameters = new HashMap();
+            final HashMap parameters = new HashMap();
             parameters.put("type", "user");
-            parameters.put("config",
-                state.getApplicationConfiguration().getConfiguration("portal").getChild("profiles"));
+            parameters.put("config", state.getApplicationConfiguration().getConfiguration("portal").getChild("profiles"));
             parameters.put("handler", handler);
             parameters.put("profiletype", "copletinstancedata");
 
-            Map key = this.buildKey(service, parameters, layoutKey, false);
+            final Map key = this.buildKey(service, parameters, layoutKey, false);
 
-            // save coplet instance data
-            CopletInstanceDataManager profileManager = ((CopletInstanceDataManager) service.getAttribute("CopletInstanceData:"
+
+            final  CopletInstanceDataManager profileManager = ((CopletInstanceDataManager)
service.getAttribute("CopletInstanceData:" +
                 layoutKey));
             adapter.saveProfile(key, parameters, profileManager);
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             // TODO
             throw new CascadingRuntimeException("Exception during save profile", e);
-        }
-        finally {
+        } finally {
             this.manager.release(adapter);
             this.manager.release(service);
         }
@@ -198,25 +197,17 @@
                 layoutKey = service.getDefaultLayoutKey();
             }
 
-            RequestState state = this.getRequestState();
-            UserHandler handler = state.getHandler();
+            final RequestState state = this.getRequestState();
+            final UserHandler handler = state.getHandler();
 
-            HashMap parameters = new HashMap();
+            final HashMap parameters = new HashMap();
             parameters.put("type", "user");
             parameters.put("config", state.getApplicationConfiguration().getConfiguration("portal").getChild("profiles"));
             parameters.put("handler", handler);
-            parameters.put("profiletype", "copletinstancedata");
-
-            Map key = this.buildKey(service, parameters, layoutKey, false);
-    
-            // save coplet instance data
-            CopletInstanceDataManager profileManager = ((CopletInstanceDataManager)service.getAttribute("CopletInstanceData:"
+ layoutKey));
-            adapter.saveProfile(key, parameters, profileManager);
-
-            // save layout data
             parameters.put("profiletype", "layout");
-            key = this.buildKey(service, parameters, layoutKey, false);
-            Layout layout = (Layout)service.getAttribute("Layout:" + layoutKey);
+
+            final Map key = this.buildKey(service, parameters, layoutKey, false);
+            final Layout layout = (Layout)service.getAttribute("Layout:" + layoutKey);
             adapter.saveProfile(key, parameters, layout);
             
         } catch (Exception e) {

Mime
View raw message