Package javax.jcr

Examples of javax.jcr.Node.canAddMixin()


               if (usersNode.canAddMixin(mixin))
               {
                  usersNode.addMixin(mixin);
               }

               if (groupsNode.canAddMixin(mixin))
               {
                  groupsNode.addMixin(mixin);
               }
            }
View Full Code Here


            catch (PathNotFoundException e)
            {
               if (nodeType == null || nodeType.length() == 0)
                  nodeType = NT_UNSTRUCTURED;
               node = node.addNode(token, nodeType);
               if (node.canAddMixin("exo:privilegeable"))
                  node.addMixin("exo:privilegeable");
               if (permissions != null && !permissions.isEmpty())
                  ((ExtendedNode)node).setPermissions(permissions);
               if (mixinTypes.size() > 0)
               {
View Full Code Here

                  ((ExtendedNode)node).setPermissions(permissions);
               if (mixinTypes.size() > 0)
               {
                  for (String mixin : mixinTypes)
                  {
                     if (node.canAddMixin(mixin))
                        node.addMixin(mixin);
                  }
               }
            }
         }
View Full Code Here

         {
            Node node = (Node)session.getItem(path);

            if (!node.isNodeType("mix:lockable"))
            {
               if (node.canAddMixin("mix:lockable"))
               {
                  node.addMixin("mix:lockable");
                  session.save();
               }
            }
View Full Code Here

      content.setProperty("jcr:lastModified", Calendar.getInstance());
      content.setProperty("jcr:data", inputStream);

      for (String mixinName : mixins)
      {
         if (content.canAddMixin(mixinName))
         {
            content.addMixin(mixinName);
         }
      }
      node.getSession().save();
View Full Code Here

        Query query = superuser.getWorkspace().getQueryManager().createQuery(statement, Query.XPATH);
        // create a node that is versionable
        Node versionable = testRootNode.addNode(nodeName1, testNodeType);
        // or try to make it versionable if it is not
        if (!versionable.isNodeType(mixVersionable)) {
            if (versionable.canAddMixin(mixVersionable)) {
                versionable.addMixin(mixVersionable);
            } else {
                fail("Node " + nodeName1 + " is not versionable and does not allow to add mix:versionable");
            }
        }
View Full Code Here

        }
        // create a node that is lockable
        Node lockable = testRootNode.addNode(nodeName1, testNodeType);
        // or try to make it lockable if it is not
        if (!lockable.isNodeType(mixLockable)) {
            if (lockable.canAddMixin(mixLockable)) {
                lockable.addMixin(mixLockable);
            } else {
                fail("Node " + nodeName1 + " is not lockable and does not allow to add mix:lockable");
            }
        }
View Full Code Here

        } catch (PathNotFoundException pnfe) {
            // ok
        }
        // a referenceable node
        Node n1 = testRootNode.addNode(name);
        if (n1.canAddMixin(mixReferenceable)) {
            n1.addMixin(mixReferenceable);
            // make sure jcr:uuid is available
            testRootNode.save();
            return n1;
        }
View Full Code Here

        } catch (PathNotFoundException pnfe) {
            // ok
        }
        // a referenceable node
        Node n1 = testRootNode.addNode(name);
        if (n1.canAddMixin(mixReferenceable)) {
            n1.addMixin(mixReferenceable);
            // make sure jcr:uuid is available
            lockingSession.save();
            return n1;
        }
View Full Code Here

        // create a node that is lockable and versionable
        Node node = testRootNode.addNode(nodeName1, testNodeType);
        node.addMixin(mixLockable);
        // try to make it versionable if it is not
        if (!node.isNodeType(mixVersionable)) {
            if (node.canAddMixin(mixVersionable)) {
                node.addMixin(mixVersionable);
            } else {
                throw new NotExecutableException("Node " + nodeName1 + " is " +
                        "not versionable and does not allow to add " +
                        "mix:versionable");
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.