portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r785911 - /portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageSerializerImpl.java
Date Thu, 18 Jun 2009 05:17:05 GMT
Author: rwatler
Date: Thu Jun 18 05:17:04 2009
New Revision: 785911

URL: http://svn.apache.org/viewvc?rev=785911&view=rev
Log:
JS2-1034: correct page serialization exception on empty DBPM schema

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageSerializerImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageSerializerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageSerializerImpl.java?rev=785911&r1=785910&r2=785911&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageSerializerImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/PageSerializerImpl.java
Thu Jun 18 05:17:04 2009
@@ -20,6 +20,7 @@
 
 import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.om.folder.FolderNotFoundException;
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.om.page.PageSecurity;
@@ -166,36 +167,51 @@
      */
     private Result execute(PageManager src, PageManager dest, Context context, boolean importing)
throws JetspeedException
     {
-        context.logger.info("Starting " + (context.all ? "complete" : "") + " " + (importing?"import":"export")
+ " of folder: " + context.folder
-                + " (overwriting folders: " + context.overwriteFolders + ", pages: " + context.overwritePages
+ ")");
-        processFolder(src.getFolder(context.folder), dest, context);
-
-        if (context.all)
-        {
-            // create the root page security
-            PageSecurity sourcePageSecurity = null;
-            try
-            {
-                sourcePageSecurity = src.getPageSecurity();
-            }
-            catch (DocumentNotFoundException e)
-            {
-                // skip over it, not found
-            }
+        Folder folder = null;
+        try
+        {
+            folder = src.getFolder(context.folder);
+        }
+        catch (FolderNotFoundException fnfe)
+        {
+        }
+        if (folder != null)
+        {
+            context.logger.info("Starting " + (context.all ? "complete" : "") + " " + (importing?"import":"export")
+ " of folder: " + context.folder
+                                + " (overwriting folders: " + context.overwriteFolders +
", pages: " + context.overwritePages + ")");
+            processFolder(folder, dest, context);
 
-            if (sourcePageSecurity != null)
-            {
-                context.logger.info((importing?"Importing":"Exporting")+" page security");
-                PageSecurity rootSecurity = dest.copyPageSecurity(sourcePageSecurity);
-                dest.updatePageSecurity(rootSecurity);
-            }
-            else
+            if (context.all)
             {
-                context.logger.info("Skipping page security: not found");
+                // create the root page security
+                PageSecurity sourcePageSecurity = null;
+                try
+                {
+                    sourcePageSecurity = src.getPageSecurity();
+                }
+                catch (DocumentNotFoundException e)
+                {
+                    // skip over it, not found
+                }
+
+                if (sourcePageSecurity != null)
+                {
+                    context.logger.info((importing?"Importing":"Exporting")+" page security");
+                    PageSecurity rootSecurity = dest.copyPageSecurity(sourcePageSecurity);
+                    dest.updatePageSecurity(rootSecurity);
+                }
+                else
+                {
+                    context.logger.info("Skipping page security: not found");
+                }
             }
+            context.logger.info((importing?"Import":"Export")+" finished: processed " + context.folderCount
+ " folder(s), " + context.pageCount
+                                + " page(s), " + context.linkCount + " link(s).");
+        }
+        else
+        {
+            context.logger.info((importing?"Import":"Export")+" skipped: "+context.folder+"
not found.");
         }
-        context.logger.info((importing?"Import":"Export")+" finished: processed " + context.folderCount
+ " folder(s), " + context.pageCount
-                + " page(s), " + context.linkCount + " link(s).");
         context.logger = null;
         return context;
     }



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