portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r330631 - /portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
Date Thu, 03 Nov 2005 21:02:55 GMT
Author: rwatler
Date: Thu Nov  3 13:02:53 2005
New Revision: 330631

URL: http://svn.apache.org/viewcvs?rev=330631&view=rev
Log:
materialize and unwrap proxies

Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java?rev=330631&r1=330630&r2=330631&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
Thu Nov  3 13:02:53 2005
@@ -55,6 +55,7 @@
 import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
 import org.apache.jetspeed.page.document.impl.NodeAttributes;
 import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.core.proxy.ProxyHelper;
 import org.apache.ojb.broker.query.Criteria;
 import org.apache.ojb.broker.query.QueryByCriteria;
 import org.apache.ojb.broker.query.QueryFactory;
@@ -327,6 +328,9 @@
     {
         try
         {
+            // dereference page in case proxy is supplied
+            page = (Page)ProxyHelper.getRealObject(page);
+
             // look up and set parent folder if necessary
             if (page.getParent() == null)
             {
@@ -377,11 +381,14 @@
     {
         try
         {
+            // dereference page in case proxy is supplied
+            page = (Page)ProxyHelper.getRealObject(page);
+
             // look up and update parent folder if necessary
             if (page.getParent() != null)
             {
                 // update parent folder with removed page; deletes page
-                FolderImpl parent = (FolderImpl)page.getParent();
+                FolderImpl parent = (FolderImpl)ProxyHelper.getRealObject(page.getParent());
                 parent.removePage((PageImpl)page);
                 getPersistenceBrokerTemplate().store(parent);
             }
@@ -407,6 +414,9 @@
     {
         try
         {
+            // dereference folder in case proxy is supplied
+            folder = (Folder)ProxyHelper.getRealObject(folder);
+
             // look up and set parent folder if necessary
             if ((folder.getParent() == null) && !folder.isRootFolder())
             {
@@ -457,11 +467,14 @@
     {
         try
         {
+            // dereference folder in case proxy is supplied
+            folder = (Folder)ProxyHelper.getRealObject(folder);
+
             // look up and update parent folder if necessary
             if (folder.getParent() != null)
             {
                 // update parent folder with removed folder; deep deletes folder
-                FolderImpl parent = (FolderImpl)folder.getParent();
+                FolderImpl parent = (FolderImpl)ProxyHelper.getRealObject(folder.getParent());
                 parent.removeFolder((FolderImpl)folder);
                 getPersistenceBrokerTemplate().store(parent);
             }



---------------------------------------------------------------------
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