|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.fr.nx.app.designer.utils; |
|
|
|
|
|
|
|
|
|
import com.fr.base.extension.FileExtension; |
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
import com.fr.file.FILE; |
|
|
|
|
import com.fr.file.FileNodeFILE; |
|
|
|
@ -34,16 +35,18 @@ public class CptCompileUtil {
|
|
|
|
|
} |
|
|
|
|
FILE file = jtemplate.getEditingFILE(); |
|
|
|
|
String path = file.getPath(); |
|
|
|
|
WorkBook workbook = (WorkBook) jtemplate.getTarget(); |
|
|
|
|
Object target = jtemplate.getTarget(); |
|
|
|
|
/* |
|
|
|
|
* 如果是cpt并且引擎设置正确,执行预编译,如果是cptx文件也执行预编译。在JStreamWork中,保存和另存为流程都进行了重新编译。 |
|
|
|
|
* 但是由于之前的DefaultTemplateResource.saveTemplate的原因导致JStreamWork::saveFile()不能执行--cptx的保存不能进行预编译, |
|
|
|
|
* 应该是流程的误改动,这里改回来,保存时仍然执行预编译。 |
|
|
|
|
* 预编译本不应该受引擎模式的影响,但是cpt文件在设置为新引擎后是需要进行编译的 |
|
|
|
|
* */ |
|
|
|
|
if (!CptAndCptxCompatibilityUtil.isEngineXEnable(workbook, path)){ |
|
|
|
|
|
|
|
|
|
if (!CptAndCptxCompatibilityUtil.isEngineXEnable(target, path)){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
WorkBook workbook = (WorkBook) jtemplate.getTarget(); |
|
|
|
|
TransformResultInfo resultInfo = compile0(workbook, file); |
|
|
|
|
unSupportLog(resultInfo); |
|
|
|
|
|
|
|
|
@ -143,4 +146,8 @@ public class CptCompileUtil {
|
|
|
|
|
FineLoggerFactory.getLogger().error(transformResultInfo.getTransformLog()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static boolean isUnSupportFileType(String path){ |
|
|
|
|
return FileExtension.CPT.matchExtension(path) || FileExtension.CPTX.matchExtension(path); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|