1 31 32 package org.opencms.workplace.tools.database; 33 34 import org.opencms.file.CmsObject; 35 import org.opencms.main.CmsException; 36 import org.opencms.main.OpenCms; 37 import org.opencms.report.A_CmsReportThread; 38 import org.opencms.report.I_CmsReport; 39 40 import java.io.IOException ; 41 42 import javax.servlet.ServletException ; 43 44 53 public class CmsStaticExportThread extends A_CmsReportThread { 54 55 private Throwable m_error; 56 57 62 public CmsStaticExportThread(CmsObject cms) { 63 64 super(cms, Messages.get().getBundle().key(Messages.GUI_STATEXP_THREAD_NAME_0)); 65 initHtmlReport(cms.getRequestContext().getLocale()); 66 start(); 67 } 68 69 72 public Throwable getError() { 73 74 return m_error; 75 } 76 77 80 public String getReportUpdate() { 81 82 return getReport().getReportUpdate(); 83 } 84 85 88 public void run() { 89 90 getReport().println( 91 org.opencms.staticexport.Messages.get().container( 92 org.opencms.staticexport.Messages.RPT_STATICEXPORT_BEGIN_0), 93 I_CmsReport.FORMAT_HEADLINE); 94 try { 95 OpenCms.getStaticExportManager().exportFullStaticRender(true, getReport()); 96 } catch (CmsException e) { 97 getReport().println(e); 98 } catch (IOException e) { 99 getReport().println(e); 100 } catch (ServletException e) { 101 getReport().println(e); 102 } 103 104 getReport().print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_STAT_0)); 106 getReport().println( 107 org.opencms.report.Messages.get().container( 108 org.opencms.report.Messages.RPT_STAT_DURATION_1, 109 getReport().formatRuntime())); 110 getReport().println( 111 org.opencms.staticexport.Messages.get().container(org.opencms.staticexport.Messages.RPT_STATICEXPORT_END_0), 112 I_CmsReport.FORMAT_HEADLINE); 113 } 114 } | Popular Tags |