portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r768332 - /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/profiler/impl/RefreshUserHomepageValveImpl.java
Date Fri, 24 Apr 2009 15:28:17 GMT
Author: woonsan
Date: Fri Apr 24 15:28:15 2009
New Revision: 768332

URL: http://svn.apache.org/viewvc?rev=768332&view=rev
Log:
JS2-818: Checks if the folder already exists and if it already exists the valve can merge
the folder.

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/profiler/impl/RefreshUserHomepageValveImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/profiler/impl/RefreshUserHomepageValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/profiler/impl/RefreshUserHomepageValveImpl.java?rev=768332&r1=768331&r2=768332&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/profiler/impl/RefreshUserHomepageValveImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/profiler/impl/RefreshUserHomepageValveImpl.java
Fri Apr 24 15:28:15 2009
@@ -148,21 +148,35 @@
                 String userName = user.getName();
                 String userFolder = Folder.USER_FOLDER + userName;
                 
-                if (removeBeforeCopy)
+                boolean found = true;
+                Folder destFolder = null;
+                
+                try
                 {
-                    try
-                    {
-                        this.pageManager.removeFolder(this.pageManager.getFolder(userFolder));
-                    }
-                    catch (FolderNotFoundException e)
+                    destFolder = this.pageManager.getFolder(userFolder);
+                    
+                    if (removeBeforeCopy)
                     {
+                        this.pageManager.removeFolder(destFolder);
+                        found = false;
                     }
                 }
-                
-                this.pageManager.deepCopyFolder(source, userFolder, userName);
+                catch (FolderNotFoundException e)
+                {
+                    found = false;
+                }
+
+                if (!found)
+                {
+                    this.pageManager.deepCopyFolder(source, userFolder, userName);
+                }
+                else
+                {
+                    this.pageManager.deepMergeFolder(source, userFolder, userName);
+                }
                 
                 // The user folder will have titles named after the user name.
-                Folder destFolder = this.pageManager.getFolder(userFolder);
+                destFolder = this.pageManager.getFolder(userFolder);
                 destFolder.setTitle(userName);
                 destFolder.setShortTitle(userName);   
                 this.pageManager.updateFolder(destFolder);
@@ -176,6 +190,7 @@
             finally
             {
                 secAtttr.setStringValue("false");
+                userManager.updateUser(user);
             }
         }
         



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