|
|
|
@ -68,9 +68,21 @@ public final class WebPreviewUtils {
|
|
|
|
|
* |
|
|
|
|
* 如果保存失败,不执行下面的WebPreview |
|
|
|
|
*/ |
|
|
|
|
if (!jt.isSaved() && !jt.saveTemplate2Env()) { |
|
|
|
|
if (!jt.isSaved()) { |
|
|
|
|
CallbackSaveWorker worker = jt.save2Env(); |
|
|
|
|
worker.addSuccessCallback(new Runnable() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
browserTemplate(jt, baseRoute, map, actionType); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
worker.start(jt.getTarget().getTemplateID()); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
browserTemplate(jt, baseRoute, map, actionType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void browserTemplate(JTemplate<?, ?> jt, String baseRoute, Map<String, Object> map, String actionType) { |
|
|
|
|
FILE currentTemplate = jt.getEditingFILE(); |
|
|
|
|
// carl:是否是保存在运行环境下的模板,不是就不能被预览
|
|
|
|
|
if (currentTemplate instanceof FileNodeFILE) { |
|
|
|
@ -106,11 +118,14 @@ public final class WebPreviewUtils {
|
|
|
|
|
WARNING_MESSAGE); |
|
|
|
|
|
|
|
|
|
if (OK_OPTION == selVal) { |
|
|
|
|
if (!jt.saveAsTemplate2Env()) { |
|
|
|
|
return; |
|
|
|
|
CallbackSaveWorker worker = jt.saveAs2Env(); |
|
|
|
|
worker.addSuccessCallback(new Runnable() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
browseUrl(jt.getEditingFILE(), baseRoute, map, actionType, jt); |
|
|
|
|
} |
|
|
|
|
currentTemplate = jt.getEditingFILE(); |
|
|
|
|
browseUrl(currentTemplate, baseRoute, map, actionType, jt); |
|
|
|
|
}); |
|
|
|
|
worker.start(jt.getTarget().getTemplateID()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|