1 31 32 package org.opencms.scheduler.jobs; 33 34 import org.opencms.file.CmsObject; 35 import org.opencms.main.CmsException; 36 import org.opencms.main.OpenCms; 37 import org.opencms.report.CmsLogReport; 38 import org.opencms.report.I_CmsReport; 39 import org.opencms.scheduler.I_CmsScheduledJob; 40 import org.opencms.staticexport.Messages; 41 42 import java.io.IOException ; 43 import java.util.Map ; 44 45 import javax.servlet.ServletException ; 46 47 58 public class CmsStaticExportJob implements I_CmsScheduledJob { 59 60 63 public String launch(CmsObject cms, Map parameters) throws Exception { 64 65 I_CmsReport report = null; 66 67 try { 68 report = new CmsLogReport(cms.getRequestContext().getLocale(), CmsStaticExportJob.class); 69 OpenCms.getStaticExportManager().exportFullStaticRender(true, report); 70 } catch (CmsException e) { 71 report.println(e); 72 } catch (IOException e) { 73 report.println(e); 74 } catch (ServletException e) { 75 report.println(e); 76 } finally { 77 report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_STAT_0)); 79 report.println(org.opencms.report.Messages.get().container( 80 org.opencms.report.Messages.RPT_STAT_DURATION_1, 81 report.formatRuntime())); 82 report.println(Messages.get().container(Messages.RPT_STATICEXPORT_END_0), I_CmsReport.FORMAT_HEADLINE); 83 } 84 85 return null; 86 } 87 } | Popular Tags |