cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r326465 - in /cocoon: blocks/portal/trunk/ blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/ blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/ blocks/portal/trunk/java/org/apache/cocoon/portal/util/ blocks/portal/trunk...
Date Wed, 19 Oct 2005 08:25:31 GMT
Author: cziegeler
Date: Wed Oct 19 01:25:07 2005
New Revision: 326465

URL: http://svn.apache.org/viewcvs?rev=326465&view=rev
Log:
Remove AbstractUserProfileManager and AuthenticationProfileManager.

Removed:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/AbstractUserProfileManager.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/AuthenticationProfileManager.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/DeltaApplicable.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/DeltaApplicableReferencesAdjustable.java
Modified:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/CopletDataManager.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/SessionMapWrapper.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portlet/ManagedCocoonPortlet.java
    cocoon/blocks/portal/trunk/status.xml
    cocoon/trunk/status.xml

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java?rev=326465&r1=326464&r2=326465&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java Wed Oct
19 01:25:07 2005
@@ -23,7 +23,6 @@
 import java.util.StringTokenizer;
 
 import org.apache.cocoon.portal.factory.impl.SimpleAbstractProducible;
-import org.apache.cocoon.portal.util.DeltaApplicable;
 import org.apache.commons.lang.StringUtils;
 
 /**
@@ -34,8 +33,7 @@
  * @version $Id$
  */
 public class CopletData 
-extends SimpleAbstractProducible
-implements DeltaApplicable {
+extends SimpleAbstractProducible {
 
     protected String title;
 
@@ -47,11 +45,6 @@
 
     protected transient List allowedRolesList;
 
-	/**
-	 * Signals whether a delta has been applied.
-	 */
-	private boolean deltaApplied = false;
-
     /**
      * Constructor
      */
@@ -106,61 +99,6 @@
     public Map getAttributes() {
     	return this.attributes;
     }
-
-	/**
-	 * Applies the specified delta.
-	 * @throws ClassCastException If the object is not of the expected type.
-	 */
-	public boolean applyDelta(Object object) {
-		CopletData data = (CopletData)object;
-
-		this.deltaApplied = true;
-
-		String title = data.getTitle();
-		if (title != null) {
-            this.setTitle(title);
-		}
-
-		CopletBaseData copletBaseData = data.getCopletBaseData();
-		if (copletBaseData != null)	{
-			this.setCopletBaseData(copletBaseData);
-		}
-
-		Iterator iterator = data.getAttributes().entrySet().iterator();
-		Object attribute, delta;
-		String key;
-		Map.Entry entry;
-		while (iterator.hasNext()) {
-			entry = (Map.Entry)iterator.next();
-			key = (String)entry.getKey();
-			delta = entry.getValue();
-
-			attribute = this.getAttribute(key);
-			if (attribute == null) {
-				// add new attribute
-				this.setAttribute(key, delta);
-			} else if (attribute instanceof DeltaApplicable) {
-				// apply delta
-				boolean success = ((DeltaApplicable)attribute).applyDelta(delta);
-				if (!success) {
-					// replace attribute
-					this.setAttribute(key, delta);
-				}
-			} else {
-				// replace attribute
-				this.setAttribute(key, delta);
-			}
-		}
-
-		return true;
-	}
-
-	/**
-	 * Checks if a delta has been applied.
-	 */
-	public boolean deltaApplied() {
-		return this.deltaApplied;
-	}
 
     /**
      * @return Returns the allowed roles.

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/CopletDataManager.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/CopletDataManager.java?rev=326465&r1=326464&r2=326465&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/CopletDataManager.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/CopletDataManager.java
Wed Oct 19 01:25:07 2005
@@ -16,19 +16,16 @@
 package org.apache.cocoon.portal.profile.impl;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.cocoon.portal.coplet.CopletData;
-import org.apache.cocoon.portal.util.DeltaApplicableReferencesAdjustable;
 
 /**
  * Holds instances of CopletData.
  *
  * @version $Id$
  */
-public class CopletDataManager 
-implements DeltaApplicableReferencesAdjustable {
+public class CopletDataManager {
 
 	/**
 	 * The coplet data instances.
@@ -36,11 +33,6 @@
 	private Map copletData = new HashMap();
 
 	/**
-	 * Signals whether a delta has been applied.
-	 */
-	private boolean deltaApplied = false;
-
-	/**
 	 * Gets all coplet data.
 	 */
 	public Map getCopletData() {
@@ -59,57 +51,5 @@
 	 */
 	public void putCopletData(CopletData data) {
 		this.copletData.put(data.getId(), data);
-	}
-
-	/**
-	 * Applies the specified delta.
-	 * @throws ClassCastException If the object is not of the expected type.
-	 */
-	public boolean applyDelta(Object object) {
-		CopletDataManager manager = (CopletDataManager)object;
-
-		this.deltaApplied = true;
-
-		Iterator iterator = manager.getCopletData().values().iterator();
-		CopletData data, delta;
-		while (iterator.hasNext()) {
-			delta = (CopletData)iterator.next();
-			data = this.getCopletData(delta.getId());
-			if (data == null) {
-				this.putCopletData(delta);
-			} else {
-				data.applyDelta(delta); 
-			}
-		}
-
-		return true;
-	}
-
-	/**
-	 * Checks if a delta has been applied.
-	 */
-	public boolean deltaApplied() {
-		return this.deltaApplied;
-	}
-
-	/**
-	 * Updates the references to contained DeltaApplicable objects  
-	 * if no delta has been applied to them.
-	 * @throws ClassCastException If the object is not of the expected type.
-	 */
-	public void adjustReferences(Object object) {
-		CopletDataManager manager = (CopletDataManager)object;
-
-		Iterator iterator = this.copletData.values().iterator();
-		CopletData data, other;
-		while (iterator.hasNext()) {
-			data = (CopletData)iterator.next();
-			if (!data.deltaApplied()) {
-				other = manager.getCopletData(data.getId());
-				if (other != null) {
-					this.putCopletData(other);
-				}
-			}
-		}
 	}
 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/SessionMapWrapper.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/SessionMapWrapper.java?rev=326465&r1=326464&r2=326465&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/SessionMapWrapper.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/util/SessionMapWrapper.java Wed
Oct 19 01:25:07 2005
@@ -17,6 +17,7 @@
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
@@ -46,13 +47,16 @@
     /**
      * Get the real map for the current user.
      */
-    protected Map getRealMap() {
+    protected Map getRealMap(boolean create) {
         final Request req = ContextHelper.getRequest(this.context);
-        final Session session = req.getSession(false);
+        final Session session = req.getSession(create);
         if ( session != null ) {
-            final Map map = (Map)session.getAttribute(this.attrName);
+            Map map = (Map)session.getAttribute(this.attrName);
             if ( map != null ) {
                 return map;
+            } else if ( create ) {
+                map = new HashMap();
+                session.setAttribute(this.attrName, map);
             }
         }
         return Collections.EMPTY_MAP;
@@ -62,83 +66,83 @@
      * @see java.util.Map#clear()
      */
     public void clear() {
-        this.getRealMap().clear();
+        this.getRealMap(false).clear();
     }
 
     /**
      * @see java.util.Map#containsKey(java.lang.Object)
      */
     public boolean containsKey(Object key) {
-        return this.getRealMap().containsKey(key);
+        return this.getRealMap(false).containsKey(key);
     }
 
     /**
      * @see java.util.Map#containsValue(java.lang.Object)
      */
     public boolean containsValue(Object value) {
-        return this.getRealMap().containsValue(value);
+        return this.getRealMap(false).containsValue(value);
     }
 
     /**
      * @see java.util.Map#entrySet()
      */
     public Set entrySet() {
-        return this.getRealMap().entrySet();
+        return this.getRealMap(false).entrySet();
     }
 
     /**
      * @see java.util.Map#get(java.lang.Object)
      */
     public Object get(Object key) {
-        return this.getRealMap().get(key);
+        return this.getRealMap(false).get(key);
     }
 
     /**
      * @see java.util.Map#isEmpty()
      */
     public boolean isEmpty() {
-        return this.getRealMap().isEmpty();
+        return this.getRealMap(false).isEmpty();
     }
 
     /**
      * @see java.util.Map#keySet()
      */
     public Set keySet() {
-        return this.getRealMap().keySet();
+        return this.getRealMap(false).keySet();
     }
 
     /**
      * @see java.util.Map#put(java.lang.Object, java.lang.Object)
      */
     public Object put(Object key, Object value) {
-        return this.getRealMap().put(key, value);
+        return this.getRealMap(true).put(key, value);
     }
 
     /**
      * @see java.util.Map#putAll(java.util.Map)
      */
     public void putAll(Map t) {
-        this.getRealMap().putAll(t);
+        this.getRealMap(true).putAll(t);
     }
 
     /**
      * @see java.util.Map#remove(java.lang.Object)
      */
     public Object remove(Object key) {
-        return this.getRealMap().remove(key);
+        return this.getRealMap(false).remove(key);
     }
 
     /**
      * @see java.util.Map#size()
      */
     public int size() {
-        return this.getRealMap().size();
+        return this.getRealMap(false).size();
     }
 
     /**
      * @see java.util.Map#values()
      */
     public Collection values() {
-        return this.getRealMap().values();
+        return this.getRealMap(false).values();
     }
 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java?rev=326465&r1=326464&r2=326465&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java Wed Oct 19
01:25:07 2005
@@ -22,7 +22,6 @@
 import java.io.OutputStream;
 import java.io.PrintStream;
 import java.net.MalformedURLException;
-import java.net.SocketException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portlet/ManagedCocoonPortlet.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portlet/ManagedCocoonPortlet.java?rev=326465&r1=326464&r2=326465&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portlet/ManagedCocoonPortlet.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portlet/ManagedCocoonPortlet.java Wed
Oct 19 01:25:07 2005
@@ -60,9 +60,7 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.OutputStream;
 import java.io.PrintStream;
-import java.net.SocketException;
 import java.net.URL;
 import java.util.HashMap;
 

Modified: cocoon/blocks/portal/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/status.xml?rev=326465&r1=326464&r2=326465&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/status.xml (original)
+++ cocoon/blocks/portal/trunk/status.xml Wed Oct 19 01:25:07 2005
@@ -66,6 +66,9 @@
  <changes>
   <release version="@version@" date="@date@">
     <action dev="CZ">
+      Remove AbstractUserProfileManager and AuthenticationProfileManager.
+    </action>
+    <action dev="CZ">
       Add coplet size to coplet instance data. The size can be minimized,
       normal or full-screen. This removed the need for a special full screen
       handling.

Modified: cocoon/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/status.xml?rev=326465&r1=326464&r2=326465&view=diff
==============================================================================
--- cocoon/trunk/status.xml (original)
+++ cocoon/trunk/status.xml Wed Oct 19 01:25:07 2005
@@ -551,6 +551,9 @@
    </action>
   </release>
   <release version="2.1.8" date="TBD">
+    <action dev="CZ" type="update">
+      Portal block: Deprecate AbstractUserProfileManager and AuthenticationProfileManager.
+    </action>
     <action dev="CZ" type="fix" fixes-bug="33152" due-to="Philippe Gassmann" due-to-email="phil@anyware-tech.com">
       Portal block: Add title to basket item in the portal sample.
     </action>



Mime
View raw message