Package org.apache.jackrabbit.oak.core

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


    public boolean include(int eventType, String path, @Nullable NodeState associatedParentNode) {
        return include(eventType)
                && include(path)
                && (associatedParentNode == null
                    || includeByType(new ReadOnlyTree(associatedParentNode)));
    }
View Full Code Here


    private boolean isVersionable() {
        if (isVersionable == null) {
            // this is not 100% correct, because t.getPath() will
            // not return the correct path for node after, but is
            // sufficient to check if it is versionable
            Tree t = new ReadOnlyTree(after);
            isVersionable = vMgr.isVersionable(t);
        }
        return isVersionable;
    }
View Full Code Here

        NodeState typesNode = root;
        for (String name : PathUtils.elements(NODE_TYPES_PATH)) {
            typesNode = typesNode.getChildNode(name);
        }

        final Tree typesTree = new ReadOnlyTree(typesNode);
        return new ReadOnlyNodeTypeManager() {
            @Override
            protected Tree getTypes() {
                return typesTree;
            }
View Full Code Here

public class NameValidatorProvider extends ValidatorProvider {

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

                Collections.<String>emptyList(), Type.REFERENCES);
    }

    private void resetToDefaultValue(NodeBuilder dest, PropertyState p)
            throws RepositoryException {
        ReadOnlyTree tree = new ReadOnlyTree(dest.getNodeState());
        PropertyDefinition def = ntMgr.getDefinition(tree, p, true);
        Value[] values = def.getDefaultValues();
        if (values != null) {
            if (p.isArray()) {
                p = PropertyStates.createProperty(p.getName(), values);
View Full Code Here

                throw new CommitFailedException(CommitFailedException.VERSION,
                        VersionExceptionCode.OPV_ABORT_ITEM_PRESENT.ordinal(),
                        "Checkin aborted due to OPV abort in " + name);
            }
            if (opv == OnParentVersionAction.VERSION) {
                if (ntMgr.isNodeType(new ReadOnlyTree(child.getNodeState()), MIX_VERSIONABLE)) {
                    // create frozen versionable child
                    versionedChild(child, dest.child(name));
                } else if (isReferenceable(child)) {
                    createFrozen(child, dest.child(name));
                } else {
View Full Code Here

            throws RepositoryException {
        if (!node.hasProperty(JCR_UUID)) {
            // quick check without looking at type hierarchy
            return false;
        }
        ReadOnlyTree tree = new ReadOnlyTree(node.getNodeState());
        return ntMgr.isNodeType(tree, MIX_REFERENCEABLE);
    }
View Full Code Here

        return ntMgr.isNodeType(tree, MIX_REFERENCEABLE);
    }

    private int getOPV(NodeBuilder parent, NodeBuilder child, String childName)
            throws RepositoryException {
        ReadOnlyTree parentTree = new ReadOnlyTree(parent.getNodeState());
        ReadOnlyTree childTree = new ReadOnlyTree(
                parentTree, childName, child.getNodeState());
        return ntMgr.getDefinition(parentTree, childTree).getOnParentVersion();
    }
View Full Code Here

            throws RepositoryException {
        if (property.getName().charAt(0) == ':') {
            // FIXME: handle child order properly
            return OnParentVersionAction.COPY;
        } else {
            return ntMgr.getDefinition(new ReadOnlyTree(node.getNodeState()),
                    property, false).getOnParentVersion();
        }
    }
View Full Code Here

public class NamespaceValidatorProvider extends ValidatorProvider {

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

TOP

Related Classes of org.apache.jackrabbit.oak.core.ReadOnlyTree

Copyright © 2018 www.massapicom. 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.