Examples of QPath


Examples of org.exoplatform.services.jcr.datamodel.QPath

    */
   public static TransientNodeData createNodeData(NodeData parent, InternalQName name, InternalQName primaryTypeName,
      int index)
   {
      TransientNodeData nodeData = null;
      QPath path = QPath.makeChildPath(parent.getQPath(), name, index);
      nodeData =
         new TransientNodeData(path, IdGenerator.generate(), -1, primaryTypeName, new InternalQName[0], 0, parent
            .getIdentifier(), parent.getACL());
      return nodeData;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.QPath

    */
   public static TransientNodeData createNodeData(NodeData parent, InternalQName name, InternalQName primaryTypeName,
      int index, int orderNumber)
   {
      TransientNodeData nodeData = null;
      QPath path = QPath.makeChildPath(parent.getQPath(), name, index);
      nodeData =
         new TransientNodeData(path, IdGenerator.generate(), -1, primaryTypeName, new InternalQName[0], orderNumber,
            parent.getIdentifier(), parent.getACL());
      return nodeData;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.QPath

    */
   public static TransientNodeData createNodeData(NodeData parent, InternalQName name, InternalQName primaryTypeName,
      String identifier)
   {
      TransientNodeData nodeData = null;
      QPath path = QPath.makeChildPath(parent.getQPath(), name);
      nodeData =
         new TransientNodeData(path, identifier, -1, primaryTypeName, new InternalQName[0], 0, parent.getIdentifier(),
            parent.getACL());
      return nodeData;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.QPath

    */
   public static TransientNodeData createNodeData(NodeData parent, InternalQName name, InternalQName primaryTypeName,
      String identifier, AccessControlList acl)
   {
      TransientNodeData nodeData = null;
      QPath path = QPath.makeChildPath(parent.getQPath(), name);
      nodeData =
         new TransientNodeData(path, identifier, -1, primaryTypeName, new InternalQName[0], 0, parent.getIdentifier(),
            acl);
      return nodeData;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.QPath

      // Set mixin property and locally
      updateMixin(newMixin);

      // Remove mixin nt definition node/properties from this node
      QPath ancestorToSave = nodeData().getQPath();

      for (PropertyDefinitionData pd : ntmanager.getAllPropertyDefinitions(removedName))
      {
         ItemData p = dataManager.getItemData(nodeData(), new QPathEntry(pd.getName(), 1), ItemType.PROPERTY);
         if (p != null && !p.isNode())
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.QPath

            throw new InvalidItemStateException("Session has pending changes ");

         if (((VersionImpl)version).getInternalName().equals(Constants.JCR_ROOTVERSION))
            throw new VersionException("It is illegal to call restore() on jcr:rootVersion");

         QPath destPath = locationFactory.parseRelPath(relPath).getInternalPath();
         NodeImpl destParent =
            (NodeImpl)dataManager.getItem(nodeData(), destPath.makeParentPath().getEntries(), false, ItemType.NODE);
        
         if (destParent == null)
            throw new PathNotFoundException("Parent not found for " + relPath);

         if (!destParent.isNode())
            throw new ConstraintViolationException("Parent item is not a node. Rel path " + relPath);

         NodeImpl destNode =
            (NodeImpl)dataManager.getItem(destParent.nodeData(),
               new QPathEntry(destPath.getName(), destPath.getIndex()), false, ItemType.NODE);

         if (destNode != null)
         {
            // Dest node exists

            if (!destNode.isNode())
               throw new ConstraintViolationException("Item at relPath is not a node " + destNode.getPath());

            if (!destNode.isNodeType(Constants.MIX_VERSIONABLE))
               throw new UnsupportedRepositoryOperationException("Node at relPath is not versionable "
                  + destNode.getPath());

            if (!destNode.versionHistory(false).isVersionBelongToThis(version))
               throw new VersionException("Bad version " + version.getPath());

            // Check locking
            if (!destNode.parent().checkLocking())
               throw new LockException("Node " + destNode.getPath() + " is locked ");
         }
         else
         {
            // Dest node not found
            if (!destParent.checkedOut())
               throw new VersionException("Parent of a node at relPath is versionable and checked-in "
                  + destParent.getPath());
         }

         ((VersionImpl)version).restore(session, destParent.nodeData(), destPath.getName(), removeExisting);
      }
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.QPath

         // change same name index
         if (sdata.getQPath().getName().getAsString().equals(srcPath.getName().getAsString())
            && sdata.getQPath().getIndex() != sameNameIndex)
         {
            // update with new index
            QPath siblingPath =
               QPath.makeChildPath(newData.getQPath().makeParentPath(), newData.getQPath().getName(), sameNameIndex);

            newData =
               new TransientNodeData(siblingPath, newData.getIdentifier(), newData.getPersistedVersion(),
                  newData.getPrimaryTypeName(), newData.getMixinTypeNames(), j, newData.getParentIdentifier(),
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.QPath

      String identifier = IdGenerator.generate();

      int orderNum = parentNode.getNextChildOrderNum();
      int index = parentNode.getNextChildIndex(name, primaryTypeName, parentNode.nodeData(), nodeDef);

      QPath path = QPath.makeChildPath(parentNode.getInternalPath(), name, index);

      AccessControlList acl = parentNode.getACL();

      // create new nodedata, [PN] fix of use index as persisted version
      NodeData nodeData =
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.QPath

    */
   protected NodeData getCorrespondingNodeData(SessionImpl corrSession) throws ItemNotFoundException,
      AccessDeniedException, RepositoryException
   {

      final QPath myPath = nodeData().getQPath();
      final SessionDataManager corrDataManager = corrSession.getTransientNodesManager();

      if (this.isNodeType(Constants.MIX_REFERENCEABLE))
      {
         NodeData corrNode = (NodeData)corrDataManager.getItemData(getUUID());
         if (corrNode != null)
         {
            return corrNode;
         }
      }
      else
      {
         NodeData ancestor = (NodeData)dataManager.getItemData(Constants.ROOT_UUID);
         for (int i = 1; i < myPath.getDepth(); i++)
         {
            ancestor = (NodeData)dataManager.getItemData(ancestor, myPath.getEntries()[i], ItemType.NODE);
            if (corrSession.getWorkspace().getNodeTypesHolder()
               .isNodeType(Constants.MIX_REFERENCEABLE, ancestor.getPrimaryTypeName(), ancestor.getMixinTypeNames()))
            {
               NodeData corrAncestor = (NodeData)corrDataManager.getItemData(ancestor.getIdentifier());
               if (corrAncestor == null)
                  throw new ItemNotFoundException("No corresponding path for ancestor "
                     + ancestor.getQPath().getAsString() + " in " + corrSession.getWorkspace().getName());

               NodeData corrNode =
                  (NodeData)corrDataManager.getItemData(corrAncestor, myPath.getRelPath(myPath.getDepth() - i),
                     ItemType.NODE);
               if (corrNode != null)
                  return corrNode;
            }
         }
View Full Code Here

Examples of org.exoplatform.services.jcr.datamodel.QPath

         throw new UnsupportedRepositoryOperationException("Node does not support child ordering "
            + getPrimaryNodeType().getName());

      JCRPath sourcePath = locationFactory.createJCRPath(getLocation(), srcName);
      JCRPath destenationPath = destName != null ? locationFactory.createJCRPath(getLocation(), destName) : null;
      QPath srcPath = sourcePath.getInternalPath();
      QPath destPath = destenationPath != null ? destenationPath.getInternalPath() : null;

      doOrderBefore(srcPath, destPath);
   }
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.