Package org.exoplatform.services.jcr.datamodel

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


                     ItemData oldItemData = cacheValue.getItem();
                     if (oldItemData.getQPath().isDescendantOf(state.getOldPath()))
                     {
                        int relativeDegree = oldItemData.getQPath().getDepth() - state.getOldPath().getDepth();
                        QPath newQPath =
                           QPath.makeChildPath(state.getData().getQPath(),
                              oldItemData.getQPath().getRelPath(relativeDegree));

                        if (oldItemData.isNode())
                        {
View Full Code Here


         if (degree < 0)
         {
            throw new ItemNotFoundException("Can't get ancestor with ancestor's degree < 0.");
         }

         final QPath myPath = getData().getQPath();
         int n = myPath.getDepth() - degree;
         if (n == 0)
         {
            return this;
         }
         else if (n < 0)
         {
            throw new ItemNotFoundException("Can't get ancestor with ancestor's degree > depth of this item.");
         }
         else
         {
            final QPath ancestorPath = myPath.makeAncestorPath(n);
            return dataManager.getItem(ancestorPath, true);
         }
      }
      catch (PathNotFoundException e)
      {
View Full Code Here

      if (!parentNode.checkLocking())
      {
         throw new LockException("Node " + parentNode.getPath() + " is locked ");
      }

      QPath qpath = QPath.makeChildPath(parentNode.getInternalPath(), propertyName);

      int state;

      String identifier;
      int version;
View Full Code Here

      if (isNode())
      {
         // validate
         // 1. referenceable nodes - if a node is deleted and then added,
         // referential integrity is unchanged ('move' usecase)
         QPath path = getInternalPath();
         List<ItemState> changes = dataManager.getChangesLog().getDescendantsChanges(path);

         List<NodeData> refNodes = new ArrayList<NodeData>();

         for (int i = 0, length = changes.size(); i < length; i++)
View Full Code Here

            {
               pvd = ((PathValue)value).getInternalData();
            }
            else
            {
               QPath pathValue = locationFactory.parseJCRPath(value.getString()).getInternalPath();
               pvd = new TransientValueData(pathValue);
            }
            return pvd;
         case PropertyType.NAME :
            InternalQName nameValue = locationFactory.parseJCRName(value.getString()).getInternalName();
View Full Code Here

         final int li = path.length - 1;
         System.arraycopy(path, 0, siblingPath, 0, li);

         siblingPath[li] = new QPathEntry(path[li], path[li].getIndex() - 1);

         if (addedNodes.contains(new QPath(siblingPath)))
         {
            // current changes log has the older same-name sibling
            return;
         }
         else
View Full Code Here

   public ItemData getItemData(NodeData parentData, QPathEntry name, ItemType itemType, boolean createNullItemData)
      throws RepositoryException
   {
      if (parentData != null)
      {
         final QPath ipath = QPath.makeChildPath(parentData.getQPath(), name);
         if (isSystemDescendant(ipath) && !this.equals(versionDataManager))
         {
            return versionDataManager.getItemData(parentData, name, itemType, createNullItemData);
         }
      }
View Full Code Here

   {
      for (int i = items.size() - 1; i >= 0; i--)
      {
         ItemState item = items.get(i);

         QPath qPath = item.getData().getQPath();
         if (qPath.isDescendantOf(rootPath) || item.getAncestorToSave().isDescendantOf(rootPath)
            || item.getAncestorToSave().equals(rootPath) || qPath.equals(rootPath))
         {
            items.remove(i);
            index.remove(item.getData().getIdentifier());
            index.remove(item.getData().getQPath());
            index.remove(new ParentIDQPathBasedKey(item));
View Full Code Here

            NodeData child = srcChilds.get(i);
            if (!child.getIdentifier().equals(node.getIdentifier()))
            {
               if ((child.getQPath().getName()).getAsString().equals((node.getQPath().getName()).getAsString()))
               {
                  QPath siblingPath = QPath.makeChildPath(srcParent.getQPath(), child.getQPath().getName(), srcIndex);
                  TransientNodeData sibling =
                     new TransientNodeData(siblingPath, child.getIdentifier(), child.getPersistedVersion() + 1, child
                        .getPrimaryTypeName(), child.getMixinTypeNames(), child.getOrderNumber(), child
                        .getParentIdentifier(), child.getACL());
                  addStates.add(new ItemState(sibling, ItemState.UPDATED, true, ancestorToSave, false, true));
                  srcIndex++;
               }
               // find index on destination in case when destination the same as source
               if (srcChilds == destChilds && (child.getQPath().getName().equals(destNodeName))) // NOSONAR
               {
                  destIndex++;
               }
            }
         }
      }
      else
      {
         qname = node.getQPath().getName();
         destIndex = node.getQPath().getIndex();
         destOrderNum = node.getOrderNumber();
      }

      String id = keepIdentifiers ? node.getIdentifier() : IdGenerator.generate();

      QPath qpath = QPath.makeChildPath(destParent.getQPath(), qname, destIndex);

      AccessControlList acl = destParent.getACL();

      boolean isPrivilegeable =
         ntManager.isNodeType(Constants.EXO_PRIVILEGEABLE, node.getPrimaryTypeName(), node.getMixinTypeNames());
View Full Code Here

      TransientPropertyData pd =
         TransientPropertyData.createPropertyData(versionable, Constants.JCR_PREDECESSORS, PropertyType.REFERENCE,
            true, new TransientValueData(new Identifier(baseVersionIdentifier)));

      // update all
      QPath vpath = versionable.getQPath();
      changes.add(new ItemState(versionHistory, ItemState.ADDED, true, vpath, true));
      changes.add(new ItemState(vhPrimaryType, ItemState.ADDED, true, vpath, true));
      changes.add(new ItemState(vhUuid, ItemState.ADDED, true, vpath, true));
      changes.add(new ItemState(vhVersionableUuid, ItemState.ADDED, true, vpath, true));
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.datamodel.QPath

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.