Package org.exoplatform.services.jcr.core.nodetype

Examples of org.exoplatform.services.jcr.core.nodetype.NodeDefinitionData


      NodeImpl parent = (NodeImpl)parentItem;
      InternalQName name = itemPath.getName().getInternalName();

      // find node type
      NodeDefinitionData nodeDef =
         session.getWorkspace().getNodeTypesHolder()
            .getChildNodeDefinition(name, nodeData().getPrimaryTypeName(), nodeData().getMixinTypeNames());

      if (nodeDef == null)
         throw new ConstraintViolationException("Can not define node type for " + name.getAsString());
      InternalQName primaryTypeName = nodeDef.getName();

      if (nodeDef.getName().equals(name) || primaryTypeName.equals(Constants.JCR_ANY_NAME))

         primaryTypeName = nodeDef.getDefaultPrimaryType();
      // try to make new node
      return doAddNode(parent, name, primaryTypeName);

   }
View Full Code Here


            if (nodeDefinition == null)
            {
               NodeType required =
                  nodeTypeManager.getNodeType(locationFactory.createJCRName(Constants.NT_BASE).getAsString());
               InternalQName requiredName = sysLocFactory.parseJCRName(required.getName()).getInternalName();
               NodeDefinitionData ntData =
                  new NodeDefinitionData(null, null, true, true, OnParentVersionAction.ABORT, false,
                     new InternalQName[]{requiredName}, null, true);
               this.nodeDefinition =
                  new NodeDefinitionImpl(ntData, nodeTypesHolder, nodeTypeManager, sysLocFactory,
                     session.getValueFactory(), session.getTransientNodesManager());
            }
View Full Code Here

   {
      if (this.isRoot())
      {
         // root - no parent
         this.definition =
            new NodeDefinitionData(null, null, true, true, OnParentVersionAction.ABORT, true,
               new InternalQName[]{Constants.NT_BASE}, null, false);
         return;
      }

      if (parent == null)
View Full Code Here

            + " to " + getPath() + " node type " + sysLocFactory.createJCRName(primaryTypeName).getAsString()
            + " is not allowed as child's node type for parent node type ");

      }
      // Check if node is not protected
      NodeDefinitionData childNodeDefinition =
         session.getWorkspace().getNodeTypesHolder()
            .getChildNodeDefinition(name, nodeData().getPrimaryTypeName(), nodeData().getMixinTypeNames());
      if (childNodeDefinition == null)
         throw new ConstraintViolationException("Can't find child node definition for "
            + sysLocFactory.createJCRName(name).getAsString() + " in " + getPath());

      if (childNodeDefinition.isProtected())
         throw new ConstraintViolationException("Can't add protected node "
            + sysLocFactory.createJCRName(name).getAsString() + " to " + getPath());

      // Check if versionable ancestor is not checked-in
      if (!checkedOut())
View Full Code Here

   private int getNextChildIndex(InternalQName nameToAdd, NodeData parentNode) throws RepositoryException,
      ItemExistsException
   {

      NodeDefinitionData def =
         session.getWorkspace().getNodeTypesHolder()
            .getChildNodeDefinition(nameToAdd, parentNode.getPrimaryTypeName(), parentNode.getMixinTypeNames());

      boolean allowSns = def.isAllowsSameNameSiblings();

      int ind = 1;

      NodeData sibling = (NodeData)dataManager.getItemData(parentNode, new QPathEntry(nameToAdd, ind), ItemType.NODE);
      while (sibling != null)
View Full Code Here

      }

      InternalQName qname = node.getQPath().getName();

      NodeData parent = (NodeData)dataManager.getItemData(node.getParentIdentifier());
      NodeDefinitionData ndef =
         ntManager.getChildNodeDefinition(qname, parent.getPrimaryTypeName(), parent.getMixinTypeNames());
      if (ndef == null)
      {
         throw new ConstraintViolationException("Definition not found for " + qname.getAsString());
      }
      int action = ndef.getOnParentVersion();

      if (log.isDebugEnabled())
         log.debug("Entering node " + node.getQPath().getAsString() + ", "
            + OnParentVersionAction.nameFromValue(action));
View Full Code Here

      NodeImpl parent = (NodeImpl)parentItem;
      InternalQName name = itemPath.getName().getInternalName();

      // find node type
      NodeDefinitionData nodeDef =
         session.getWorkspace().getNodeTypesHolder()
            .getChildNodeDefinition(name, nodeData().getPrimaryTypeName(), nodeData().getMixinTypeNames());

      if (nodeDef == null)
         throw new ConstraintViolationException("Can not define node type for " + name.getAsString());
      InternalQName primaryTypeName = nodeDef.getName();

      if (nodeDef.getName().equals(name) || primaryTypeName.equals(Constants.JCR_ANY_NAME))

         primaryTypeName = nodeDef.getDefaultPrimaryType();
      // try to make new node
      return doAddNode(parent, name, primaryTypeName, nodeDef);

   }
View Full Code Here

            if (nodeDefinition == null)
            {
               NodeType required =
                  nodeTypeManager.getNodeType(locationFactory.createJCRName(Constants.NT_BASE).getAsString());
               InternalQName requiredName = sysLocFactory.parseJCRName(required.getName()).getInternalName();
               NodeDefinitionData ntData =
                  new NodeDefinitionData(null, null, true, true, OnParentVersionAction.ABORT, false,
                     new InternalQName[]{requiredName}, null, true);
               this.nodeDefinition =
                  new NodeDefinitionImpl(ntData, nodeTypesHolder, nodeTypeManager, sysLocFactory,
                     session.getValueFactory(), session.getTransientNodesManager());
            }
View Full Code Here

   {
      if (this.isRoot())
      {
         // root - no parent
         this.definition =
            new NodeDefinitionData(null, null, true, true, OnParentVersionAction.ABORT, true,
               new InternalQName[]{Constants.NT_BASE}, null, false);
         return;
      }

      if (parent == null)
View Full Code Here

            + " to " + getPath() + " node type " + sysLocFactory.createJCRName(primaryTypeName).getAsString()
            + " is not allowed as child's node type for parent node type ");

      }
      // Check if node is not protected
      NodeDefinitionData childNodeDefinition =
         session
            .getWorkspace()
            .getNodeTypesHolder()
            .getChildNodeDefinition(name, primaryTypeName, nodeData().getPrimaryTypeName(),
               nodeData().getMixinTypeNames());

      if (childNodeDefinition == null)
         throw new ConstraintViolationException("Can't find child node definition for "
            + sysLocFactory.createJCRName(name).getAsString() + " in " + getPath());

      if (childNodeDefinition.isProtected())
         throw new ConstraintViolationException("Can't add protected node "
            + sysLocFactory.createJCRName(name).getAsString() + " to " + getPath());

      // Check if versionable ancestor is not checked-in
      if (!checkedOut())
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.core.nodetype.NodeDefinitionData

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.