|
|
|
@ -239,11 +239,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
|
|
|
|
|
String reportPath = reportletsTree.getSelectedTemplatePath(); |
|
|
|
|
final String selectedFilePath = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, reportPath); |
|
|
|
|
String lock = node.getLock(); |
|
|
|
|
boolean showLockInfo = LockInfoUtils.isCompatibleOperator() |
|
|
|
|
|| LockInfoUtils.unableGetLockInfo() |
|
|
|
|
|| WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(selectedFilePath) |
|
|
|
|
? (lock != null && !lock.equals(node.getUserID())) |
|
|
|
|
: WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath); |
|
|
|
|
boolean showLockInfo = needShowLockInfo(lock, selectedFilePath, node); |
|
|
|
|
if (showLockInfo) { |
|
|
|
|
UserInfo userInfo = WorkContext.getCurrent().get(LockInfoOperator.class).getUserInfo(selectedFilePath); |
|
|
|
|
node.setLock(UUID.randomUUID().toString()); |
|
|
|
@ -257,6 +253,17 @@ public class TemplateTreePane extends JPanel implements FileOperations {
|
|
|
|
|
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(selectedFilePath, false))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 是否需要展示锁定信息 |
|
|
|
|
*/ |
|
|
|
|
public static boolean needShowLockInfo(String lock, String selectedFilePath, FileNode node) { |
|
|
|
|
return LockInfoUtils.isCompatibleOperator() |
|
|
|
|
|| LockInfoUtils.unableGetLockInfo() |
|
|
|
|
|| WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(selectedFilePath) |
|
|
|
|
? (lock != null && !lock.equals(node.getUserID())) |
|
|
|
|
: WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void checkDevelopForBiddenTemplate(String selectedFilePath) { |
|
|
|
|
JTemplate<?, ?> template = getOpenedTemplate(selectedFilePath); |
|
|
|
|
if (template != null && template.isForbidden()) { |
|
|
|
|