Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.NodeImpl.addMixin()


        // add node
        node = parent.addNode(nodeName, nodeTypeName, uuid);
        // add mixins
        if (mixinNames != null) {
            for (int i = 0; i < mixinNames.length; i++) {
                node.addMixin(mixinNames[i]);
            }
        }
        return node;
    }
View Full Code Here


     * @throws Exception
     */
    public void testImportACLOnly() throws Exception {
        try {
            NodeImpl target = (NodeImpl) testRootNode.addNode(nodeName1);
            target.addMixin("rep:AccessControllable");

            InputStream in = new ByteArrayInputStream(XML_POLICY_TREE_3.getBytes("UTF-8"));
            SessionImporter importer = new SessionImporter(target, sImpl,
                    ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW, new PseudoConfig());
            ImportHandler ih = new ImportHandler(importer, sImpl);
View Full Code Here

     * @throws Exception
     */
    public void testImportACLRemoveACE() throws Exception {
        try {
            NodeImpl target = (NodeImpl) testRootNode.addNode(nodeName1);
            target.addMixin("rep:AccessControllable");

            InputStream in = new ByteArrayInputStream(XML_POLICY_TREE_3.getBytes("UTF-8"));
            SessionImporter importer = new SessionImporter(target, sImpl,
                    ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW, new PseudoConfig());
            ImportHandler ih = new ImportHandler(importer, sImpl);
View Full Code Here

     * @throws Exception
     */
    public void testImportACLUnknown() throws Exception {
        try {
            NodeImpl target = (NodeImpl) testRootNode.addNode(nodeName1);
            target.addMixin("rep:AccessControllable");

            InputStream in = new ByteArrayInputStream(XML_POLICY_TREE_4.getBytes("UTF-8"));
            SessionImporter importer = new SessionImporter(target, sImpl,
                    ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW, new PseudoConfig());
            ImportHandler ih = new ImportHandler(importer, sImpl);
View Full Code Here

            // and set the policies the protected item import only is called if
            // the node to be imported is defined to be protected. however, if
            // the root node doesn't have the mixin assigned the defining node
            // type of the imported policy nodes will be rep:root (unstructured)
            // and the items will not be detected as being protected.
            target.addMixin("rep:RepoAccessControllable");           
            InputStream in = new ByteArrayInputStream(XML_REPO_POLICY_TREE.getBytes("UTF-8"));

            SessionImporter importer = new SessionImporter(target, sImpl, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW, new PseudoConfig());
            ImportHandler ih = new ImportHandler(importer, sImpl);
            new ParsingContentHandler(ih).parse(in);
View Full Code Here

     *
     * @throws Exception
     */
    public void testImportRepoACLAtTestNode() throws Exception {
        NodeImpl target = (NodeImpl) testRootNode.addNode("test");
        target.addMixin("rep:RepoAccessControllable");

        AccessControlManager acMgr = sImpl.getAccessControlManager();
        try {
            InputStream in = new ByteArrayInputStream(XML_REPO_POLICY_TREE.getBytes("UTF-8"));

View Full Code Here

        // add node
        node = parent.addNode(nodeName, nodeTypeName, id);
        // add mixins
        if (mixinNames != null) {
            for (Name mixinName : mixinNames) {
                node.addMixin(mixinName);
            }
        }
        return node;
    }
View Full Code Here

     * @throws RepositoryException if an error occurs
     */
    private NodeImpl createAclNode(String nodePath) throws RepositoryException {
        NodeImpl protectedNode = getNode(nodePath);
        if (!protectedNode.isNodeType(NT_REP_ACCESS_CONTROLLABLE)) {
            protectedNode.addMixin(NT_REP_ACCESS_CONTROLLABLE);
        }
        return addNode(protectedNode, N_POLICY, NT_REP_ACL);
    }

    /**
 
View Full Code Here

            PathNotFoundException, AccessDeniedException, LockException,
            VersionException, RepositoryException {

        NodeImpl n = (NodeImpl) session.getNode(absPath);
        if (!n.isNodeType(REP_RETENTION_MANAGEABLE)) {
            n.addMixin(REP_RETENTION_MANAGEABLE);
        }

        HoldImpl hold = new HoldImpl(session.getQName(name), isDeep, n.getNodeId(), session);
        Value[] vls;
        if (n.hasProperty(REP_HOLD)) {
View Full Code Here

        if (!(retentionPolicy instanceof RetentionPolicyImpl)) {
            throw new RepositoryException("Invalid retention policy.");
        }
        Value retentionReference = session.getValueFactory().createValue(retentionPolicy.getName(), PropertyType.NAME);
        if (!n.isNodeType(REP_RETENTION_MANAGEABLE)) {
            n.addMixin(REP_RETENTION_MANAGEABLE);
        }
        setProperty(n, REP_RETENTION_POLICY, retentionReference);
    }

    /**
 
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.