portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r989442 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/ components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/ components/jetspeed-page-manager/src/ma...
Date Thu, 26 Aug 2010 04:43:00 GMT
Author: taylor
Date: Thu Aug 26 04:43:00 2010
New Revision: 989442

URL: http://svn.apache.org/viewvc?rev=989442&view=rev
Log:
casting to DatabasePageManager from Spring proxy was failing in BaseElementImpl due to a class
cast exception. This exception *should* never happen, yet it occurred during load testing
on a cluster. This fix required moving around some classes, introducing interfaces, so we
could properly cast through the  Spring interface contract

Added:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyListImpl.java
      - copied, changed from r989352, portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyList.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyList.java
  (with props)
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyManagement.java
  (with props)
Removed:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyList.java
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseFragmentElementImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java?rev=989442&r1=989441&r2=989442&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseElementImpl.java
Thu Aug 26 04:43:00 2010
@@ -32,7 +32,7 @@ import org.apache.jetspeed.om.common.Sec
 import org.apache.jetspeed.om.page.BaseElement;
 import org.apache.jetspeed.om.page.PageSecurity;
 import org.apache.jetspeed.om.page.SecurityConstraintImpl;
-import org.apache.jetspeed.page.impl.DatabasePageManager;
+import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.impl.DatabasePageManagerUtils;
 import org.apache.jetspeed.security.Group;
 import org.apache.jetspeed.security.JSSubject;
@@ -56,7 +56,7 @@ public abstract class BaseElementImpl im
 
     private boolean constraintsEnabled;
     private boolean permissionsEnabled;
-    private DatabasePageManager pageManager;
+    private PageManager pageManager;
     protected static PermissionFactory pf;
     
     public static void setPermissionsFactory(PermissionFactory pf)
@@ -114,7 +114,7 @@ public abstract class BaseElementImpl im
      *
      * @param pageManager page manager that manages this folder instance
      */
-    public void setPageManager(DatabasePageManager pageManager)
+    public void setPageManager(PageManager pageManager)
     {
         this.pageManager = pageManager;
     }
@@ -124,11 +124,11 @@ public abstract class BaseElementImpl im
      * 
      * @return page manager instance
      */
-    public DatabasePageManager getPageManager()
+    public PageManager getPageManager()
     {
         if (pageManager == null)
         {
-            pageManager = (DatabasePageManager)Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.page.PageManager");
+            pageManager = (PageManager)Jetspeed.getComponentManager().getComponent("org.apache.jetspeed.page.PageManager");
         }        
         return pageManager;
     }     

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseFragmentElementImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseFragmentElementImpl.java?rev=989442&r1=989441&r2=989442&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseFragmentElementImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseFragmentElementImpl.java
Thu Aug 26 04:43:00 2010
@@ -25,8 +25,8 @@ import org.apache.jetspeed.om.page.BaseF
 import org.apache.jetspeed.om.page.BaseFragmentValidationListener;
 import org.apache.jetspeed.om.page.FragmentProperty;
 import org.apache.jetspeed.om.page.PageSecurity;
+import org.apache.jetspeed.page.FragmentPropertyList;
 import org.apache.jetspeed.page.PageManager;
-import org.apache.jetspeed.page.impl.DatabasePageManager;
 import org.apache.jetspeed.page.impl.DatabasePageManagerUtils;
 import org.apache.ojb.broker.PersistenceBroker;
 import org.apache.ojb.broker.PersistenceBrokerAware;
@@ -176,7 +176,7 @@ public abstract class BaseFragmentElemen
     /* (non-Javadoc)
      * @see org.apache.jetspeed.om.page.impl.BaseElementImpl#getPageManager()
      */
-    public DatabasePageManager getPageManager()
+    public PageManager getPageManager()
     {
         return ((baseFragmentsElement != null) ? baseFragmentsElement.getPageManager() :
null);
     }    
@@ -779,10 +779,10 @@ public abstract class BaseFragmentElemen
         // if fragment is not newly constructed
         if (getIdentity() != 0)
         {
-            DatabasePageManager pageManager = getPageManager();
+            PageManager pageManager = getPageManager();
             if (pageManager != null)
             {
-                FragmentPropertyList properties = pageManager.getFragmentPropertyList(this,
fragmentProperties);
+                FragmentPropertyList properties = pageManager.getFragmentPropertyManager().getFragmentPropertyList(this,
fragmentProperties);
                 fragmentProperties = null;
                 return properties;
             }
@@ -790,7 +790,7 @@ public abstract class BaseFragmentElemen
         // create transient properties list place holder
         if (fragmentProperties == null)
         {
-            fragmentProperties = new FragmentPropertyList(this);
+            fragmentProperties = new FragmentPropertyListImpl(this);
         }
         return fragmentProperties;
     }
@@ -1080,10 +1080,10 @@ public abstract class BaseFragmentElemen
     {
         // notify page manager of fragment insert so that fragment
         // properties can be inserted as part of the insert operation
-        DatabasePageManager pageManager = getPageManager();
+        PageManager pageManager = getPageManager();
         if (pageManager != null)
         {
-            pageManager.updateFragmentPropertyList(this, PageManager.ALL_PROPERTY_SCOPE,
fragmentProperties);
+            pageManager.getFragmentPropertyManager().updateFragmentPropertyList(this, PageManager.ALL_PROPERTY_SCOPE,
fragmentProperties);
             fragmentProperties = null;
         }
     }
@@ -1102,10 +1102,10 @@ public abstract class BaseFragmentElemen
     {
         // notify page manager of fragment update so that fragment
         // properties can be updated as part of the update operation
-        DatabasePageManager pageManager = getPageManager();
+        PageManager pageManager = getPageManager();
         if (pageManager != null)
         {
-            pageManager.updateFragmentPropertyList(this, PageManager.ALL_PROPERTY_SCOPE,
fragmentProperties);
+            pageManager.getFragmentPropertyManager().updateFragmentPropertyList(this, PageManager.ALL_PROPERTY_SCOPE,
fragmentProperties);
             fragmentProperties = null;
         }
     }
@@ -1117,10 +1117,10 @@ public abstract class BaseFragmentElemen
     {
         // notify page manager of fragment delete so that fragment
         // properties can be removed as part of the remove operation
-        DatabasePageManager pageManager = getPageManager();
+        PageManager pageManager = getPageManager();
         if (pageManager != null)
         {
-            pageManager.removeFragmentPropertyList(this, fragmentProperties);
+            pageManager.getFragmentPropertyManager().removeFragmentPropertyList(this, fragmentProperties);
             fragmentProperties = null;
         }
     }

Copied: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyListImpl.java
(from r989352, portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyList.java)
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyListImpl.java?p2=portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyListImpl.java&p1=portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyList.java&r1=989352&r2=989442&rev=989442&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyList.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyListImpl.java
Thu Aug 26 04:43:00 2010
@@ -21,7 +21,9 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.jetspeed.om.page.BaseFragmentElement;
 import org.apache.jetspeed.om.page.FragmentProperty;
+import org.apache.jetspeed.page.FragmentPropertyList;
 
 /**
  * FragmentPropertyList
@@ -29,14 +31,14 @@ import org.apache.jetspeed.om.page.Fragm
  * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
  * @version $Id$
  */
-public class FragmentPropertyList extends AbstractList
+public class FragmentPropertyListImpl extends AbstractList implements FragmentPropertyList
 {
     private BaseFragmentElementImpl fragment;
 
     private List properties;
     private List removedProperties;
 
-    public FragmentPropertyList(BaseFragmentElementImpl fragment)
+    public FragmentPropertyListImpl(BaseFragmentElementImpl fragment)
     {
         super();
         this.properties = new ArrayList();
@@ -46,6 +48,9 @@ public class FragmentPropertyList extend
     /* (non-Javadoc)
      * @see java.util.List#add(int,java.lang.Object)
      */
+    /* (non-Javadoc)
+	 * @see org.apache.jetspeed.om.page.impl.FragmentPropertyList#add(int, java.lang.Object)
+	 */
     public synchronized void add(int index, Object element)
     {
         // implement for modifiable AbstractList:
@@ -55,7 +60,7 @@ public class FragmentPropertyList extend
             throw new IllegalArgumentException("Property name and value must be set.");
         }
         // find existing matching property
-        FragmentPropertyImpl addMatch = getMatchingProperty(add);
+        FragmentProperty addMatch = getMatchingProperty(add);
         if (addMatch != null)
         {
             // modify existing property
@@ -73,6 +78,9 @@ public class FragmentPropertyList extend
     /* (non-Javadoc)
      * @see java.util.List#get(int)
      */
+    /* (non-Javadoc)
+	 * @see org.apache.jetspeed.om.page.impl.FragmentPropertyList#get(int)
+	 */
     public synchronized Object get(int index)
     {
         // implement for modifiable AbstractList
@@ -82,6 +90,9 @@ public class FragmentPropertyList extend
     /* (non-Javadoc)
      * @see java.util.List#remove(int)
      */
+    /* (non-Javadoc)
+	 * @see org.apache.jetspeed.om.page.impl.FragmentPropertyList#remove(int)
+	 */
     public synchronized Object remove(int index)
     {
         // implement for modifiable AbstractList:
@@ -93,6 +104,9 @@ public class FragmentPropertyList extend
     /* (non-Javadoc)
      * @see java.util.List#set(int,java.lang.Object)
      */
+    /* (non-Javadoc)
+	 * @see org.apache.jetspeed.om.page.impl.FragmentPropertyList#set(int, java.lang.Object)
+	 */
     public synchronized Object set(int index, Object element)
     {
         // implement for modifiable AbstractList:
@@ -102,7 +116,7 @@ public class FragmentPropertyList extend
             throw new IllegalArgumentException("Property name and value must be set.");
         }
         // find existing matching property
-        FragmentPropertyImpl setMatch = getMatchingProperty(set);
+        FragmentProperty setMatch = getMatchingProperty(set);
         if (setMatch != null)
         {
             // modify existing property
@@ -127,49 +141,43 @@ public class FragmentPropertyList extend
     /* (non-Javadoc)
      * @see java.util.List#size()
      */
+    /* (non-Javadoc)
+	 * @see org.apache.jetspeed.om.page.impl.FragmentPropertyList#size()
+	 */
     public synchronized int size()
     {
         // implement for modifiable AbstractList
         return properties.size();
     }
     
-    /**
-     * Get fragment property list owner.
-     * 
-     * @return fragment owner
-     */
-    public BaseFragmentElementImpl getFragmentImpl()
+    /* (non-Javadoc)
+	 * @see org.apache.jetspeed.om.page.impl.FragmentPropertyList#getFragmentImpl()
+	 */
+    public BaseFragmentElement getFragmentElement()
     {
         return fragment;
     }
     
-    /**
-     * Get underlying fragment properties list.
-     * 
-     * @return fragment property list
-     */
+    /* (non-Javadoc)
+	 * @see org.apache.jetspeed.om.page.impl.FragmentPropertyList#getProperties()
+	 */
     public List getProperties()
     {
         return properties;
     }
     
-    /**
-     * Get underlying removed fragment properties list.
-     * 
-     * @return removed fragment property list
-     */
+    /* (non-Javadoc)
+	 * @see org.apache.jetspeed.om.page.impl.FragmentPropertyList#getRemovedProperties()
+	 */
     public List getRemovedProperties()
     {
         return removedProperties;
     }
     
-    /**
-     * Find matching property.
-     * 
-     * @param match match property
-     * @return matching property
-     */
-    public synchronized FragmentPropertyImpl getMatchingProperty(FragmentProperty match)
+    /* (non-Javadoc)
+	 * @see org.apache.jetspeed.om.page.impl.FragmentPropertyList#getMatchingProperty(org.apache.jetspeed.om.page.FragmentProperty)
+	 */
+    public synchronized FragmentProperty getMatchingProperty(FragmentProperty match)
     {
         Iterator matchIter = properties.iterator();
         while (matchIter.hasNext())
@@ -183,9 +191,9 @@ public class FragmentPropertyList extend
         return null;
     }
     
-    /**
-     * Clear all transient properties.
-     */
+    /* (non-Javadoc)
+	 * @see org.apache.jetspeed.om.page.impl.FragmentPropertyList#clearProperties()
+	 */
     public synchronized void clearProperties()
     {
         properties.clear();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java?rev=989442&r1=989441&r2=989442&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/AbstractPageManager.java
Thu Aug 26 04:43:00 2010
@@ -1878,4 +1878,8 @@ public abstract class AbstractPageManage
         PageManagerUtils.createUserHomePagesFromRoles(this, subject);
     }
 
+    public FragmentPropertyManagement getFragmentPropertyManager()
+    {
+    	return null; 
+    }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java?rev=989442&r1=989441&r2=989442&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
Thu Aug 26 04:43:00 2010
@@ -69,7 +69,7 @@ import org.apache.jetspeed.om.page.impl.
 import org.apache.jetspeed.om.page.impl.FragmentImpl;
 import org.apache.jetspeed.om.page.impl.FragmentPreferenceImpl;
 import org.apache.jetspeed.om.page.impl.FragmentPropertyImpl;
-import org.apache.jetspeed.om.page.impl.FragmentPropertyList;
+import org.apache.jetspeed.om.page.impl.FragmentPropertyListImpl;
 import org.apache.jetspeed.om.page.impl.FragmentReferenceImpl;
 import org.apache.jetspeed.om.page.impl.FragmentSecurityConstraintImpl;
 import org.apache.jetspeed.om.page.impl.LinkImpl;
@@ -91,6 +91,8 @@ import org.apache.jetspeed.om.preference
 import org.apache.jetspeed.page.DelegatingPageManager;
 import org.apache.jetspeed.page.FolderNotRemovedException;
 import org.apache.jetspeed.page.FolderNotUpdatedException;
+import org.apache.jetspeed.page.FragmentPropertyList;
+import org.apache.jetspeed.page.FragmentPropertyManagement;
 import org.apache.jetspeed.page.LinkNotRemovedException;
 import org.apache.jetspeed.page.LinkNotUpdatedException;
 import org.apache.jetspeed.page.PageManager;
@@ -117,7 +119,6 @@ import org.apache.ojb.broker.core.proxy.
 import org.apache.ojb.broker.query.Criteria;
 import org.apache.ojb.broker.query.QueryByCriteria;
 import org.apache.ojb.broker.query.QueryFactory;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -128,7 +129,7 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
  * @version $Id: $
  */
-public class DatabasePageManager extends InitablePersistenceBrokerDaoSupport implements PageManager
+public class DatabasePageManager extends InitablePersistenceBrokerDaoSupport implements PageManager,
FragmentPropertyManagement
 {
     private static Logger log = LoggerFactory.getLogger(DatabasePageManager.class);
     
@@ -2784,7 +2785,7 @@ public class DatabasePageManager extends
             
             // assemble fragment property list instance, (use transient
             // list or create new fragment property list)
-            list = new FragmentPropertyList(baseFragmentElementImpl);
+            list = new FragmentPropertyListImpl(baseFragmentElementImpl);
             list.getProperties().addAll(globalFragmentPropertyList);
             if (subject != null)
             {
@@ -3240,4 +3241,31 @@ public class DatabasePageManager extends
     {
         // do not clear thread local cache: cache across transactions
     }
+
+	public FragmentPropertyManagement getFragmentPropertyManager() 
+	{
+		return this;
+	}
+
+	public FragmentPropertyList getFragmentPropertyList(
+			BaseFragmentElement baseFragmentElement,
+			FragmentPropertyList transientList) 
+	{
+		return getFragmentPropertyList((BaseFragmentElementImpl)baseFragmentElement, transientList);
+	}
+
+	public void removeFragmentPropertyList(
+			BaseFragmentElement baseFragmentElement,
+			FragmentPropertyList transientList) 
+	{
+		removeFragmentPropertyList((BaseFragmentElementImpl)baseFragmentElement, transientList);
+	}
+
+	public void updateFragmentPropertyList(
+			BaseFragmentElement baseFragmentElement, String scope,
+			FragmentPropertyList transientList) 
+	{
+		updateFragmentPropertyList((BaseFragmentElementImpl)baseFragmentElement, scope, transientList);
+	}
+        
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java?rev=989442&r1=989441&r2=989442&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java
Thu Aug 26 04:43:00 2010
@@ -493,30 +493,27 @@ public class DatabasePageManagerCache im
      */
     private static void clearPrincipalPropertiesCache(int fragmentId)
     {
-        synchronized (DatabasePageManagerCache.class)
+        // scan principal fragment property cache
+        List principalKeys = principalPropertiesCache.getKeys();
+        Iterator principalKeysIter = principalKeys.iterator();
+        while (principalKeysIter.hasNext())
         {
-            // scan principal fragment property cache
-            List principalKeys = principalPropertiesCache.getKeys();
-            Iterator principalKeysIter = principalKeys.iterator();
-            while (principalKeysIter.hasNext())
-            {
-                String principalKey = (String)principalKeysIter.next();
-                CacheElement propertiesElement = principalPropertiesCache.get(principalKey);
-                if (propertiesElement != null)
+            String principalKey = (String)principalKeysIter.next();
+            CacheElement propertiesElement = principalPropertiesCache.get(principalKey);
+            if (propertiesElement != null)
+            {
+                // scan cached principal fragment property list
+                DatabasePageManagerCachedFragmentPropertyList cachedPrincipalFragmentPropertyList
= (DatabasePageManagerCachedFragmentPropertyList)propertiesElement.getContent();
+                Iterator fragmentPropertyIter = cachedPrincipalFragmentPropertyList.iterator();
+                while (fragmentPropertyIter.hasNext())
                 {
-                    // scan cached principal fragment property list
-                    DatabasePageManagerCachedFragmentPropertyList cachedPrincipalFragmentPropertyList
= (DatabasePageManagerCachedFragmentPropertyList)propertiesElement.getContent();
-                    Iterator fragmentPropertyIter = cachedPrincipalFragmentPropertyList.iterator();
-                    while (fragmentPropertyIter.hasNext())
+                    FragmentPropertyImpl fragmentProperty = (FragmentPropertyImpl)fragmentPropertyIter.next();
+                    if (((BaseFragmentElementImpl)fragmentProperty.getFragment()).getIdentity()
== fragmentId)
                     {
-                        FragmentPropertyImpl fragmentProperty = (FragmentPropertyImpl)fragmentPropertyIter.next();
-                        if (((BaseFragmentElementImpl)fragmentProperty.getFragment()).getIdentity()
== fragmentId)
-                        {
-                            // remove cached principal fragment property list
-                            DatabasePageManagerCache.principalPropertiesCache.removeQuiet(principalKey);
-                            DatabasePageManagerCache.principalPropertiesPathCache.removeQuiet(principalKey);
                           
-                            break;
-                        }
+                        // remove cached principal fragment property list
+                        DatabasePageManagerCache.principalPropertiesCache.removeQuiet(principalKey);
+                        DatabasePageManagerCache.principalPropertiesPathCache.removeQuiet(principalKey);
                           
+                        break;
                     }
                 }
             }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java?rev=989442&r1=989441&r2=989442&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/psml/CastorXmlPageManager.java
Thu Aug 26 04:43:00 2010
@@ -38,9 +38,7 @@ import org.apache.jetspeed.om.folder.psm
 import org.apache.jetspeed.om.folder.psml.MenuSeparatorDefinitionImpl;
 import org.apache.jetspeed.om.page.BaseFragmentElement;
 import org.apache.jetspeed.om.page.DynamicPage;
-import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.FragmentDefinition;
-import org.apache.jetspeed.om.page.FragmentProperty;
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
@@ -64,6 +62,8 @@ import org.apache.jetspeed.om.page.psml.
 import org.apache.jetspeed.om.page.psml.SecurityConstraintsImpl;
 import org.apache.jetspeed.page.AbstractPageManager;
 import org.apache.jetspeed.page.FolderNotUpdatedException;
+import org.apache.jetspeed.page.FragmentPropertyList;
+import org.apache.jetspeed.page.FragmentPropertyManagement;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.PageManagerSecurityUtils;
 import org.apache.jetspeed.page.PageNotFoundException;
@@ -79,7 +79,6 @@ import org.apache.jetspeed.page.document
 import org.apache.jetspeed.page.document.NodeSet;
 import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
 import org.apache.jetspeed.page.document.psml.NodeSetImpl;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -91,7 +90,7 @@ import org.slf4j.LoggerFactory;
  * @author <a href="mailto:weaver@apache.org">Scott T Weaver </a>
  * @version $Id$
  */
-public class CastorXmlPageManager extends AbstractPageManager implements PageManager, FileCacheEventListener
+public class CastorXmlPageManager extends AbstractPageManager implements PageManager, FileCacheEventListener,
FragmentPropertyManagement
 {
     private final static Logger log = LoggerFactory.getLogger(CastorXmlPageManager.class);
 
@@ -1280,11 +1279,48 @@ public class CastorXmlPageManager extend
         // this page manager
     }
 
+	public FragmentPropertyManagement getFragmentPropertyManager() 
+	{
+		return this;
+	}
+
+	public FragmentPropertyList getFragmentPropertyList(
+			BaseFragmentElement baseFragmentElement,
+			FragmentPropertyList transientList) 
+	{
+		return null;
+	}
+
+	public void removeFragmentPropertyList(
+			BaseFragmentElement baseFragmentElement,
+			FragmentPropertyList transientList) 
+	{
+	}
+
+	public void updateFragmentPropertyList(
+			BaseFragmentElement baseFragmentElement, String scope,
+			FragmentPropertyList transientList) 
+	{
+	}
+
     public int addPages(Page[] pages)
     throws NodeException
-    {
-        this.updatePage(pages[0]);
-        this.updatePage(pages[1]);
-        throw new NodeException("Its gonna blow captain!");
-    }    
+    {   
+        if (pages.length > 0 && pages[0].getPath().equals("/tx__test1.psml"))
+        {
+            // for tx testing
+            log.debug("Adding first page");
+            this.updatePage(pages[0]);
+            log.debug("Adding second page");
+            this.updatePage(pages[1]);
+            log.debug("About to throw ex");
+            throw new NodeException("Its gonna blow captain!");
+        }
+        for (int ix = 0; ix < pages.length; ix++)
+        {
+            this.updatePage(pages[ix]);
+        }
+        return pages.length;
+    }
+    
 }

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyList.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyList.java?rev=989442&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyList.java
(added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyList.java
Thu Aug 26 04:43:00 2010
@@ -0,0 +1,86 @@
+/*
+ * 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.
+ */
+package org.apache.jetspeed.page;
+
+import java.util.List;
+
+import org.apache.jetspeed.om.page.BaseFragmentElement;
+import org.apache.jetspeed.om.page.FragmentProperty;
+
+public interface FragmentPropertyList extends List
+{
+	/* (non-Javadoc)
+	 * @see java.util.List#add(int,java.lang.Object)
+	 */
+	public abstract void add(int index, Object element);
+
+	/* (non-Javadoc)
+	 * @see java.util.List#get(int)
+	 */
+	public abstract Object get(int index);
+
+	/* (non-Javadoc)
+	 * @see java.util.List#remove(int)
+	 */
+	public abstract Object remove(int index);
+
+	/* (non-Javadoc)
+	 * @see java.util.List#set(int,java.lang.Object)
+	 */
+	public abstract Object set(int index, Object element);
+
+	/* (non-Javadoc)
+	 * @see java.util.List#size()
+	 */
+	public abstract int size();
+
+	/**
+	 * Get fragment property list owner.
+	 * 
+	 * @return fragment owner
+	 */
+	public abstract BaseFragmentElement getFragmentElement();
+
+	/**
+	 * Get underlying fragment properties list.
+	 * 
+	 * @return fragment property list
+	 */
+	public abstract List getProperties();
+
+	/**
+	 * Get underlying removed fragment properties list.
+	 * 
+	 * @return removed fragment property list
+	 */
+	public abstract List getRemovedProperties();
+
+	/**
+	 * Find matching property.
+	 * 
+	 * @param match match property
+	 * @return matching property
+	 */
+	public abstract FragmentProperty getMatchingProperty(
+			FragmentProperty match);
+
+	/**
+	 * Clear all transient properties.
+	 */
+	public abstract void clearProperties();
+
+}
\ No newline at end of file

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyList.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyList.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyManagement.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyManagement.java?rev=989442&view=auto
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyManagement.java
(added)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyManagement.java
Thu Aug 26 04:43:00 2010
@@ -0,0 +1,16 @@
+package org.apache.jetspeed.page;
+
+import org.apache.jetspeed.om.page.BaseFragmentElement;
+
+/**
+ * Supplemental and optional service supported by Page Managers. Fragment Property lists
can be manipulated with this interface
+ * 
+ * @author dtaylor
+ *
+ */
+public interface FragmentPropertyManagement 
+{
+	 void updateFragmentPropertyList(BaseFragmentElement baseFragmentElement, String scope,
FragmentPropertyList transientList);
+	 void removeFragmentPropertyList(BaseFragmentElement baseFragmentElement, FragmentPropertyList
transientList);
+	 FragmentPropertyList getFragmentPropertyList(BaseFragmentElement baseFragmentElement, FragmentPropertyList
transientList);
+}

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyManagement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/FragmentPropertyManagement.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java?rev=989442&r1=989441&r2=989442&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
Thu Aug 26 04:43:00 2010
@@ -1165,4 +1165,11 @@ public interface PageManager 
      * Cleanup request level cache for current thread.
      */
     public void cleanupRequestCache();
+    
+    /**
+     * Supplemental and optional service supported by Page Managers. 
+     * Fragment Property lists can be manipulated with this interface 
+     */
+    public FragmentPropertyManagement getFragmentPropertyManager();
+    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message