private boolean allowsSNS( NodeCache cache ) { Name primaryType = getPrimaryType(cache); Set<Name> mixinTypes = getMixinTypes(cache); RepositoryEnvironment repositoryEnvironment = workspace(cache).repositoryEnvironment(); if ( repositoryEnvironment == null) { return true; } NodeTypes nodeTypes = repositoryEnvironment.nodeTypes(); return nodeTypes == null || nodeTypes.allowsNameSiblings(primaryType, mixinTypes); }
private boolean allowsSNS( NodeCache cache ) { Name primaryType = getPrimaryType(cache); Set<Name> mixinTypes = getMixinTypes(cache); RepositoryEnvironment repositoryEnvironment = workspace(cache).repositoryEnvironment(); if ( repositoryEnvironment == null) { return true; } NodeTypes nodeTypes = repositoryEnvironment.nodeTypes(); return nodeTypes == null || nodeTypes.allowsNameSiblings(primaryType, mixinTypes); }
if (modifiedNode.isNew() || nodeTypeCapabilities.allowsNameSiblings(primaryType, mixinTypes)) return;
if (modifiedNode.isNew() || nodeTypeCapabilities.allowsNameSiblings(primaryType, mixinTypes)) return;
public ChildReferences getChildReferences( WorkspaceCache cache, Document document ) { Name primaryType = getPrimaryType(document); Set<Name> mixinTypes = getMixinTypes(document); NodeTypes nodeTypes = getNodeTypes(cache); boolean isUnorderedCollection = nodeTypes != null && nodeTypes.isUnorderedCollection(primaryType, mixinTypes); if (isUnorderedCollection) { return new BucketedChildReferences(document, this); } boolean hasChildren = document.containsField(CHILDREN); boolean hasFederatedSegments = document.containsField(FEDERATED_SEGMENTS); if (!hasChildren && !hasFederatedSegments) { return ImmutableChildReferences.EMPTY_CHILD_REFERENCES; } boolean allowsSNS = nodeTypes == null || nodeTypes.allowsNameSiblings(primaryType, mixinTypes); ChildReferences internalChildRefs = hasChildren ? ImmutableChildReferences.create(this, document, CHILDREN, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; ChildReferences externalChildRefs = hasFederatedSegments ? ImmutableChildReferences.create(this, document, FEDERATED_SEGMENTS, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; // Now look at the 'childrenInfo' document for info about the next block of children ... ChildReferencesInfo info = getChildReferencesInfo(document); if (!hasChildren) { return ImmutableChildReferences.create(externalChildRefs, info, cache, allowsSNS); } else if (!hasFederatedSegments) { return ImmutableChildReferences.create(internalChildRefs, info, cache, allowsSNS); } else { return ImmutableChildReferences.create(internalChildRefs, info, externalChildRefs, cache, allowsSNS); } }
public ChildReferences getChildReferences( WorkspaceCache cache, Document document ) { Name primaryType = getPrimaryType(document); Set<Name> mixinTypes = getMixinTypes(document); NodeTypes nodeTypes = getNodeTypes(cache); boolean isUnorderedCollection = nodeTypes != null && nodeTypes.isUnorderedCollection(primaryType, mixinTypes); if (isUnorderedCollection) { return new BucketedChildReferences(document, this); } boolean hasChildren = document.containsField(CHILDREN); boolean hasFederatedSegments = document.containsField(FEDERATED_SEGMENTS); if (!hasChildren && !hasFederatedSegments) { return ImmutableChildReferences.EMPTY_CHILD_REFERENCES; } boolean allowsSNS = nodeTypes == null || nodeTypes.allowsNameSiblings(primaryType, mixinTypes); ChildReferences internalChildRefs = hasChildren ? ImmutableChildReferences.create(this, document, CHILDREN, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; ChildReferences externalChildRefs = hasFederatedSegments ? ImmutableChildReferences.create(this, document, FEDERATED_SEGMENTS, allowsSNS) : ImmutableChildReferences.EMPTY_CHILD_REFERENCES; // Now look at the 'childrenInfo' document for info about the next block of children ... ChildReferencesInfo info = getChildReferencesInfo(document); if (!hasChildren) { return ImmutableChildReferences.create(externalChildRefs, info, cache, allowsSNS); } else if (!hasFederatedSegments) { return ImmutableChildReferences.create(internalChildRefs, info, cache, allowsSNS); } else { return ImmutableChildReferences.create(internalChildRefs, info, externalChildRefs, cache, allowsSNS); } }
Name parentPrimaryType = mutableParent.getPrimaryType(this); Set<Name> parentMixinTypes = mutableParent.getMixinTypes(this); boolean parentAllowsSNS = nodeTypes != null && nodeTypes.allowsNameSiblings(parentPrimaryType, parentMixinTypes); if (!parentAllowsSNS) {
Name parentPrimaryType = mutableParent.getPrimaryType(this); Set<Name> parentMixinTypes = mutableParent.getMixinTypes(this); boolean parentAllowsSNS = nodeTypes != null && nodeTypes.allowsNameSiblings(parentPrimaryType, parentMixinTypes); if (!parentAllowsSNS) {