portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r703965 - /portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
Date Mon, 13 Oct 2008 08:34:13 GMT
Author: vkumar
Date: Mon Oct 13 01:34:13 2008
New Revision: 703965

URL: http://svn.apache.org/viewvc?rev=703965&view=rev
Log:
Fixing JIRA Issue https://issues.apache.org/jira/browse/JS2-899

Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java?rev=703965&r1=703964&r2=703965&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
Mon Oct 13 01:34:13 2008
@@ -246,16 +246,28 @@
                     }
                     fileType = fileExt(fileName);
                     if (fileType != null && !fileType.equals("")&& fileName
!= null && !fileName.equals("") && destPath != null && !destPath.equals(""))
{
+                        // if "/" is path, then file separator will work, as root.
+                        if(destPath.equals("/")) destPath =""; 
                         Folder folder = castorPageManager.getFolder(request.getUserPrincipal().toString());
                         if(fileType.equalsIgnoreCase("psml")){
                             Page source = folder.getPage(fileName);
-                            Page page = pageManager.copyPage(source, destPath + "/" + fileName);
+                            Page page = null;
+                            if(pageManager.pageExists(destPath + "/" + fileName)){
+                                pageManager.removePage(pageManager.getPage(destPath + "/"
+ fileName));
+                                page = pageManager.copyPage(source, destPath + "/" + fileName);
+                            }
+                            page = pageManager.copyPage(source, destPath + "/" + fileName);
                              
                             pageManager.updatePage(page);
                             success = true;
                         }else if(fileType.equalsIgnoreCase("link")){
                             Link source = folder.getLink(fileName);
-                            Link page = pageManager.copyLink(source, destPath + "/" + fileName);
-                            pageManager.updateLink(page);
+                            Link link;
+                            if(pageManager.linkExists(destPath + "/" + fileName)){
+                                pageManager.removeLink(pageManager.getLink(destPath + "/"
+ fileName));
+                                link = pageManager.copyLink(source, destPath + "/" + fileName);
+                            }
+                            link = pageManager.copyLink(source, destPath + "/" + fileName);
+                            pageManager.updateLink(link);
                             success = true;
                         }else if(fileType.equalsIgnoreCase("zip")){
                             unzipfile(fileName,usrFolder + path,path);



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