Examples of ReadOnlyTree


Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree

        checkPermissions(getPath(before), permissions);
    }

    @Override
    public Validator childNodeAdded(String name, NodeState after) throws CommitFailedException {
        ReadOnlyTree child = new ReadOnlyTree(parentAfter, name, after);

        int permissions = getPermissions(child, Permissions.ADD_NODE);
        checkPermissions(child.getPath(), permissions);

        return new PermissionValidator(compiledPermissions, null, child);
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree

        return new PermissionValidator(compiledPermissions, null, child);
    }

    @Override
    public Validator childNodeChanged(String name, NodeState before, NodeState after) throws CommitFailedException {
        ReadOnlyTree childBefore = new ReadOnlyTree(parentBefore, name, before);
        ReadOnlyTree childAfter = new ReadOnlyTree(parentAfter, name, after);

        // TODO

        return new PermissionValidator(compiledPermissions, childBefore, childAfter);
View Full Code Here

Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree

    }

    @Override
    public Validator childNodeDeleted(String name, NodeState before) throws CommitFailedException {
        ReadOnlyTree child = new ReadOnlyTree(parentBefore, name, before);

        int permissions = getPermissions(child, Permissions.REMOVE_NODE);
        checkPermissions(child.getPath(), permissions);

        return new PermissionValidator(compiledPermissions, child, null);
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree

public class NamespaceValidatorProvider implements ValidatorProvider {

    @Override
    public Validator getRootValidator(NodeState before, NodeState after) {
        Validator validator = new NamespaceValidator(
                Namespaces.getNamespaceMap(new ReadOnlyTree(before)));
        return new SubtreeValidator(validator, "jcr:system", "jcr:namespaces");
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree

    //--------------------------------------------------< ValidatorProvider >---
    @Nonnull
    @Override
    public Validator getRootValidator(NodeState before, NodeState after) {
        return new PermissionValidator(acContext.getPermissions(), new ReadOnlyTree(before), new ReadOnlyTree(after));
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree

public class NameValidatorProvider implements ValidatorProvider {

    @Override
    public Validator getRootValidator(NodeState before, NodeState after) {
        return new NameValidator(
                Namespaces.getNamespaceMap(new ReadOnlyTree(after)).keySet());
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree

        }

        AccessControlContext context = new AccessControlContextImpl();
        context.initialize(principals);

        NodeUtil rootBefore = new NodeUtil(new ReadOnlyTree(before));
        NodeUtil rootAfter = new NodeUtil(new ReadOnlyTree(after));
        return new PermissionValidator(context.getPermissions(), rootBefore, rootAfter);
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree

            String msg = "Failed to register custom privilege: Definition uses reserved namespace: " + name;
            throw new CommitFailedException(new RepositoryException(msg));
        }

        // primary node type name must be rep:privilege
        Tree tree = new ReadOnlyTree(null, name, after);
        PropertyState primaryType = tree.getProperty(JcrConstants.JCR_PRIMARYTYPE);
        if (primaryType == null || !NT_REP_PRIVILEGE.equals(primaryType.getValue().getString())) {
            throw new CommitFailedException("Privilege definition must have primary node type set to rep:privilege");
        }

        // additional validation of the definition
View Full Code Here

Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree

            else {
                String ntName = type.getValues().get(0).getString();
                getParentType().checkAddChildNode(name, ntName);
            }

            ReadOnlyTree addedTree = new ReadOnlyTree(parent, name, after);
            EffectiveNodeType addedType = getEffectiveNodeType(addedTree);
            addedType.checkMandatoryItems(addedTree);
            return new TypeValidator(ntm, new ReadOnlyTree(parent, name, after));
        }
        catch (RepositoryException e) {
            throw new CommitFailedException(
                    "Cannot add node '" + name + "' at " + parent.getPath(), e);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.core.ReadOnlyTree

        }
    }

    @Override
    public Validator childNodeChanged(String name, NodeState before, NodeState after) throws CommitFailedException {
        return new TypeValidator(ntm, new ReadOnlyTree(parent, name, after));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.