Package org.apache.jackrabbit.oak.plugins.nodetype

Examples of org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate


    }

    @Test
    public void singleNodeTypeMiss() {
        NodeState node = createNodeOfType(NT_BASE);
        TypePredicate p = new TypePredicate(node, new String[] {NT_FILE});
        assertFalse(p.apply(node));
    }
View Full Code Here


    }

    @Test
    public void multipleNodeTypesMatch() {
        NodeState node = createNodeOfType(NT_FILE);
        TypePredicate p = new TypePredicate(node,
                new String[] { NT_FOLDER, NT_RESOURCE, NT_FILE });
        assertTrue(p.apply(node));
    }
View Full Code Here

    }

    @Test
    public void multipleNodeTypesMiss() {
        NodeState node = createNodeOfType(NT_FILE);
        TypePredicate p = new TypePredicate(node,
                new String[] { NT_FOLDER, NT_RESOURCE, JCR_CONTENT });
        assertFalse(p.apply(node));
    }
View Full Code Here

    private final String name;

    private String identifier;

    public IdentifierTracker(NodeState root) {
        this.referenceable = new TypePredicate(root, MIX_REFERENCEABLE);
        this.parent = null;
        this.name = null;

        String uuid = root.getString(JCR_UUID);
        if (uuid != null && referenceable.apply(root)) {
View Full Code Here

        NodeBuilder rootAfter = after.builder();

        permissionRoot = getPermissionRoot(rootAfter);
        bitsProvider = new PrivilegeBitsProvider(new ImmutableRoot(after));

        isACL = new TypePredicate(after, NT_REP_ACL);
        isACE = new TypePredicate(after, NT_REP_ACE);
        isGrantACE = new TypePredicate(after, NT_REP_GRANT_ACE);

        Diff diff = new Diff("");
        after.compareAgainstBaseState(before, diff);
        apply();
        return rootAfter.getNodeState();
View Full Code Here

        this.parentPermission = permissionProvider.getTreePermission(parentBefore, TreePermission.EMPTY);

        this.permissionProvider = permissionProvider;
        this.provider = provider;

        this.isReferenceable = new TypePredicate(rootAfter.getNodeState(), MIX_REFERENCEABLE);
        this.isCreated = new TypePredicate(rootAfter.getNodeState(), MIX_CREATED);

        permission = Permissions.getPermission(PermissionUtil.getPath(parentBefore, parentAfter), Permissions.NO_PERMISSION);
    }
View Full Code Here

            this.ntNames = ntNames;
        }

        @Override
        public EventFilter createFilter(NodeState before, NodeState after, String basePath) {
            TypePredicate predicate = new TypePredicate(
                    after.exists() ? after : before, ntNames);
            return new UniversalFilter(
                    getChildNode(before, basePath),
                    getChildNode(after, basePath),
                    selector, predicate);
View Full Code Here

        this.parent = null;
        this.name = null;
        this.path = path;
        this.loader = new BundleLoader(source);
        this.workspaceName = workspaceName;
        this.isReferenceable = new TypePredicate(root, MIX_REFERENCEABLE);
        this.isOrderable = TypePredicate.isOrderable(root);
        this.isVersionable = new TypePredicate(root, MIX_VERSIONABLE);
        this.isVersionHistory = new TypePredicate(root, NT_VERSIONHISTORY);
        this.isFrozenNode = new TypePredicate(root, NT_FROZENNODE);
        this.uriToPrefix = uriToPrefix;
        this.versionablePaths = versionablePaths;
        this.useBinaryReferences = useBinaryReferences;
        try {
            NodePropBundle bundle = loader.loadBundle(id);
View Full Code Here

    @Override
    public Editor getRootEditor(
            NodeState before, NodeState after,
            NodeBuilder builder, CommitInfo info) {
        TypePredicate isACE = new TypePredicate(after, NT_REP_ACE);
        return new RestrictionEditor(builder, isACE);
    }
View Full Code Here

        this.parent = null;
        this.name = null;
        this.path = path;
        this.loader = new BundleLoader(source);
        this.workspaceName = workspaceName;
        this.isReferenceable = new TypePredicate(root, MIX_REFERENCEABLE);
        this.isOrderable = TypePredicate.isOrderable(root);
        this.isVersionable = new TypePredicate(root, MIX_VERSIONABLE);
        this.isVersionHistory = new TypePredicate(root, NT_VERSIONHISTORY);
        this.isFrozenNode = new TypePredicate(root, NT_FROZENNODE);
        this.uriToPrefix = uriToPrefix;
        this.versionablePaths = versionablePaths;
        this.useBinaryReferences = useBinaryReferences;
        try {
            NodePropBundle bundle = loader.loadBundle(id);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.nodetype.TypePredicate

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.