cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1704663 - /cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java
Date Tue, 22 Sep 2015 16:06:32 GMT
Author: dkulp
Date: Tue Sep 22 16:06:29 2015
New Revision: 1704663

URL: http://svn.apache.org/viewvc?rev=1704663&view=rev
Log:
If there is a timeout on a page, continue with the remaining pages.

Modified:
    cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java

Modified: cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java
URL: http://svn.apache.org/viewvc/cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java?rev=1704663&r1=1704662&r2=1704663&view=diff
==============================================================================
--- cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java (original)
+++ cxf/web/src/main/java/org/apache/cxf/cwiki/SiteExporter.java Tue Sep 22 16:06:29 2015
@@ -418,33 +418,39 @@ public class SiteExporter implements Run
                                + "    (" + count + "/" + total + ")");
             loadAttachments(p);
             
-            loadPageContent(p, null, null);
-            
-            VelocityContext ctx = new VelocityContext();
-            ctx.put("autoexport", this);
-            ctx.put("page", p);
-            ctx.put("body", p.getContent());
-            ctx.put("confluenceUri", ROOT);
-            ctx.put("pageManager", pageManager);
-            ctx.put("renderer", renderer);
-            ctx.put("exporter", this);
-            
-            File file = new File(outputDir, p.createFileName());
-            boolean isNew = !file.exists();
-            
-            FileWriter writer = new FileWriter(file);
-            ctx.put("out", writer);
-            template.merge(ctx, writer);
-            writer.close();
-            if (isNew) {
-                //call "svn add"
-                callSvn("add", file.getAbsolutePath());
-                svnCommitMessage.append("Adding: " + file.getName() + "\n");
-            } else {
-                svnCommitMessage.append("Modified: " + file.getName() + "\n");          
     
+            try {
+                loadPageContent(p, null, null);
+                
+                VelocityContext ctx = new VelocityContext();
+                ctx.put("autoexport", this);
+                ctx.put("page", p);
+                ctx.put("body", p.getContent());
+                ctx.put("confluenceUri", ROOT);
+                ctx.put("pageManager", pageManager);
+                ctx.put("renderer", renderer);
+                ctx.put("exporter", this);
+                
+                File file = new File(outputDir, p.createFileName());
+                boolean isNew = !file.exists();
+                
+                FileWriter writer = new FileWriter(file);
+                ctx.put("out", writer);
+                template.merge(ctx, writer);
+                writer.close();
+                if (isNew) {
+                    //call "svn add"
+                    callSvn("add", file.getAbsolutePath());
+                    svnCommitMessage.append("Adding: " + file.getName() + "\n");
+                } else {
+                    svnCommitMessage.append("Modified: " + file.getName() + "\n");      
         
+                }
+                
+                p.setContent(null);
+            } catch (Exception e) {
+                System.out.println("Could not render page " + p.getTitle() + " due to " +
e.getMessage());
+                e.printStackTrace();
             }
-            
-            p.setContent(null);
+
         }
     }
     
@@ -459,36 +465,41 @@ public class SiteExporter implements Run
             System.out.println("(" + spaceKey + ") Rendering Blog Entry " + entry.getTitle()

                                + "    (" + count + "/" + total + ")");
             
-            loadAttachments(entry);
-            String body = renderPage(entry);
-            body = updateContentLinks(entry, body, null, mainDivClass);
-            
-            pageManager.setDirectory(entry.getDirectory());
-            
-            VelocityContext ctx = new VelocityContext();
-            ctx.put("autoexport", this);
-            ctx.put("page", entry);
-            ctx.put("body", body);
-            ctx.put("confluenceUri", ROOT);
-            ctx.put("pageManager", pageManager);
-            ctx.put("renderer", renderer);
-            ctx.put("exporter", this);
-            ctx.put("isBlogEntry", Boolean.TRUE);
-            
-            File file = new File(outputDir, entry.getPath());
-            file.getParentFile().mkdirs();
-            boolean isNew = !file.exists();
-            
-            FileWriter writer = new FileWriter(file);
-            ctx.put("out", writer);
-            template.merge(ctx, writer);
-            writer.close();
-            if (isNew) {
-                //call "svn add"
-                callSvn("add", file.getAbsolutePath());
-                svnCommitMessage.append("Adding: " + file.getName() + "\n");
-            } else {
-                svnCommitMessage.append("Modified: " + file.getName() + "\n");          
     
+            try {
+                loadAttachments(entry);
+                String body = renderPage(entry);
+                body = updateContentLinks(entry, body, null, mainDivClass);
+                
+                pageManager.setDirectory(entry.getDirectory());
+                
+                VelocityContext ctx = new VelocityContext();
+                ctx.put("autoexport", this);
+                ctx.put("page", entry);
+                ctx.put("body", body);
+                ctx.put("confluenceUri", ROOT);
+                ctx.put("pageManager", pageManager);
+                ctx.put("renderer", renderer);
+                ctx.put("exporter", this);
+                ctx.put("isBlogEntry", Boolean.TRUE);
+                
+                File file = new File(outputDir, entry.getPath());
+                file.getParentFile().mkdirs();
+                boolean isNew = !file.exists();
+                
+                FileWriter writer = new FileWriter(file);
+                ctx.put("out", writer);
+                template.merge(ctx, writer);
+                writer.close();
+                if (isNew) {
+                    //call "svn add"
+                    callSvn("add", file.getAbsolutePath());
+                    svnCommitMessage.append("Adding: " + file.getName() + "\n");
+                } else {
+                    svnCommitMessage.append("Modified: " + file.getName() + "\n");      
         
+                }
+            } catch (Exception e) {
+                System.out.println("Could not render blog " + entry.getTitle() + " due to
" + e.getMessage());
+                e.printStackTrace();
             }
         }
     }



Mime
View raw message