Examples of NodeDefinitionData


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

      NodeDefinitionData[] nodeDefs =
         nodeTypeDataManager.getAllChildNodeDefinitions(new InternalQName[]{nodeTypeData.getName()});
      NodeDefinition[] ndefs = new NodeDefinition[nodeDefs.length];
      for (int i = 0; i < nodeDefs.length; i++)
      {
         NodeDefinitionData cnd = nodeDefs[i];
         ndefs[i] =
            new NodeDefinitionImpl(cnd, nodeTypeDataManager, nodeTypeManager, locationFactory, valueFactory,
               dataManager);
      }
View Full Code Here

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

   {
      NodeDefinitionData[] cndefs = nodeTypeData.getDeclaredChildNodeDefinitions();
      NodeDefinition[] ndefs = new NodeDefinition[cndefs.length];
      for (int i = 0; i < cndefs.length; i++)
      {
         NodeDefinitionData cnd = cndefs[i];
         ndefs[i] =
            new NodeDefinitionImpl(cnd, nodeTypeDataManager, nodeTypeManager, locationFactory, valueFactory,
               dataManager);
      }
View Full Code Here

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();

         if (primaryTypeName == null)
         {
            throw new ConstraintViolationException("Can not define node type for " + name.getAsString()
               + ". No default primary type defined for child nodes in \""
View Full Code Here

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

            }
         }
         // check node definition
         for (int i = 0; i < nodeTypeData.getDeclaredChildNodeDefinitions().length; i++)
         {
            NodeDefinitionData childnodeDefinitionData = nodeTypeData.getDeclaredChildNodeDefinitions()[i];
            for (int j = 0; j < childnodeDefinitionData.getRequiredPrimaryTypes().length; j++)
            {
               InternalQName requiredPrimaryTypeName = childnodeDefinitionData.getRequiredPrimaryTypes()[j];
               if (hierarchy.getNodeType(requiredPrimaryTypeName) == null
                  && !resolvedDependecies.contains(requiredPrimaryTypeName))
               {
                  unresolvedDependecies.add(requiredPrimaryTypeName);
               }
            }
            if (childnodeDefinitionData.getDefaultPrimaryType() != null)
            {
               if (hierarchy.getNodeType(childnodeDefinitionData.getDefaultPrimaryType()) == null
                  && !resolvedDependecies.contains(childnodeDefinitionData.getDefaultPrimaryType()))
               {
                  unresolvedDependecies.add(childnodeDefinitionData.getDefaultPrimaryType());
               }
            }
         }
      }
      if (unresolvedDependecies.size() > 0)
View Full Code Here

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

            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

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

   {
      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

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

            + " 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());
      }
View Full Code Here

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

   public NodeDefinitionData getChildNodeDefinition(InternalQName nodeName, InternalQName nodeType,
      InternalQName parentNodeType, InternalQName[] parentMixinTypes) throws RepositoryException
   {
      NodeDefinitionData[] defs = getAllChildNodeDefinitions(getNodeTypeNames(parentNodeType, parentMixinTypes));

      NodeDefinitionData residualDef = null;
      NodeDefinitionData firstResidualDef = null;

      outer : for (NodeDefinitionData nodeDef : defs)
      {
         if (nodeDef.getName().equals(nodeName))
         {
View Full Code Here

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

      if (parent == null)
      {
         return;
      }

      NodeDefinitionData def =
         nodeTypeManager.getChildNodeDefinition(nodeName, parent.getPrimaryTypeName(), parent.getMixinTypeNames());

      if (!def.isResidualSet())
      {
         throw new SQLException("Node is required by its parent.");
      }
   }
View Full Code Here

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

      throws PathNotFoundException, IllegalPathException, RepositoryException
   {

      int newIndex = 1;

      NodeDefinitionData nodedef =
         nodeTypeDataManager.getChildNodeDefinition(name, parentData.getPrimaryTypeName(), parentData
            .getMixinTypeNames());

      ItemData sameNameNode = null;
      try
      {
         sameNameNode = dataConsumer.getItemData(parentData, new QPathEntry(name, 0), ItemType.NODE, false);
      }
      catch (PathNotFoundException e)
      {
         // Ok no same name node;
         return newIndex;
      }

      List<ItemState> transientAddChilds = getItemStatesList(parentData, name, ItemState.ADDED, skipIdentifier);
      List<ItemState> transientDeletedChilds =
         getItemStatesList(parentData, new QPathEntry(name, 0), ItemState.DELETED, null);

      if (!nodedef.isAllowsSameNameSiblings() && ((sameNameNode != null) || (transientAddChilds.size() > 0)))
      {
         if ((sameNameNode != null) && (transientDeletedChilds.size() < 1))
         {
            throw new ItemExistsException("The node  already exists in " + sameNameNode.getQPath().getAsString()
               + " and same name sibling is not allowed ");
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.