static export programmly,静态导出手工编码

静态导出的手工编码:

 

cmso.lockResource(file.getRootPath());
					cmso.writeFile(file);
					cmso.unlockResource(file.getRootPath());
					cmso.publishResource(file.getRootPath());
					
					/*
					 * reStaticExport this resource automatic
					 */
					CmsObject cmsExportObject = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserExport());
					CmsStaticExportManager manager = OpenCms.getStaticExportManager();
					CmsStaticExportData exportData = manager.getExportData(file.getRootPath(), cmsExportObject);
					int status = manager.export(null, null, cmsExportObject, exportData);
		            if (status == HttpServletResponse.SC_OK) {
		            	return "";
		            }else{
		            	return ""+status;
		            }
 

你可能感兴趣的:(static)