|
|
|
@ -967,6 +967,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
checkBeforeSave(); |
|
|
|
|
export(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
@ -985,7 +986,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
|
|
|
|
|
return isNewCreateTpl; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected boolean export() throws Exception { |
|
|
|
|
protected void checkBeforeSave() throws Exception { |
|
|
|
|
// 保存前校验下未解锁
|
|
|
|
|
if (WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(getEditingFILE().getPath())) { |
|
|
|
|
throw new UnLockedException(); |
|
|
|
@ -994,6 +995,9 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
|
|
|
|
|
if (getEditingFILE().exists() && !WorkContext.getCurrent().get(LockInfoOperator.class).isConsistentLock(getEditingFILE().getPath())) { |
|
|
|
|
throw new InconsistentLockException(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected boolean export() throws Exception { |
|
|
|
|
return this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(getEditingFILE())); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -1634,6 +1638,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
|
|
|
|
|
if (editingFILE == null || editingFILE instanceof MemFILE) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
checkBeforeSave(); |
|
|
|
|
export(); |
|
|
|
|
this.editingFILE = editingFILE; |
|
|
|
|
return true; |
|
|
|
|