Merge remote-tracking branch 'origin/feature/REQ-3540' into feature/REQ-3540
This commit is contained in:
commit
f7eb497741
@ -125,7 +125,7 @@ public class IndexManager {
|
||||
}
|
||||
|
||||
private void ensureChildNameNotUsed(NodeCreate create, IndexNodeType nodeType, boolean withLock) {
|
||||
if (indexSupport.isChildrenNameDuplicatable(create))
|
||||
if (indexSupport.childrenNameDuplicatable(create))
|
||||
return;
|
||||
if (withLock)
|
||||
indexSupport.lockParentAndReleaseOnCommit(create);
|
||||
@ -138,7 +138,7 @@ public class IndexManager {
|
||||
if (indexNode.getName().equals(newName))
|
||||
return;
|
||||
docLogDao.log("indexNode:rename", code, "newName", newName);
|
||||
if (!indexSupport.isChildrenNameDuplicatable(indexNode)) {
|
||||
if (!indexSupport.childrenNameDuplicatable(indexNode)) {
|
||||
indexSupport.lockParentAndReleaseOnCommit(indexNode);
|
||||
indexSupport.ensureChildNameNotUsed(indexNode, indexNode.getNodeType(), newName);
|
||||
}
|
||||
@ -228,7 +228,7 @@ public class IndexManager {
|
||||
indexNodeDao.connectNodes(TreeUtils.collectValues(connectRoot));
|
||||
IndexNode rootNode = connectRoot.getChildren().get(0).tryGetValue();
|
||||
// resolve the name issue
|
||||
if (!indexSupport.isChildrenNameDuplicatable(rootNode))
|
||||
if (!indexSupport.childrenNameDuplicatable(rootNode))
|
||||
indexSupport.incrNameIfDuplicate(rootNode);
|
||||
// get the coped root with full props
|
||||
return indexNodeDao.findOrNull(rootNode.getCode());
|
||||
|
||||
@ -96,7 +96,7 @@ public class IndexSupport {
|
||||
BizAssertions.assertTrue(
|
||||
indexNodeDao.validChildrenCount(parent.getCode()) < docProps.getIndexNodeMaxChildrenSize(),
|
||||
"创建失败, 子节点数量不能超过 {}", docProps.getIndexNodeMaxChildrenSize());
|
||||
if (!parent.isRoot() && isLimitChildrenCount(child))
|
||||
if (!parent.isRoot() && limitChildrenCount(child))
|
||||
BizAssertions.assertTrue(parent.path().depth() < docProps.getIndexNodeMaxDepth(), //
|
||||
"节点深度超过限制{}, 无法再创建新节点", docProps.getIndexNodeMaxDepth());
|
||||
}
|
||||
@ -164,7 +164,7 @@ public class IndexSupport {
|
||||
.list();
|
||||
}
|
||||
|
||||
boolean isChildrenNameDuplicatable(IndexNodeParentScope parentScope) {
|
||||
boolean childrenNameDuplicatable(IndexNodeParentScope parentScope) {
|
||||
IndexNodeScope nodeScope = parentScope.nodeScope();
|
||||
switch (nodeScope.context()) {
|
||||
case FILE_TEMPLATE:
|
||||
@ -175,7 +175,7 @@ public class IndexSupport {
|
||||
}
|
||||
}
|
||||
|
||||
boolean isLimitChildrenCount(IndexNodeParentScope parentScope) {
|
||||
boolean limitChildrenCount(IndexNodeParentScope parentScope) {
|
||||
IndexNodeScope nodeScope = parentScope.nodeScope();
|
||||
switch (nodeScope.context()) {
|
||||
case FILE_TEMPLATE:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user