Examples of ItemState


Examples of org.exoplatform.services.jcr.dataflow.ItemState

      NodeData vhnode = (NodeData)getItemData(vhID);

      if (vhnode == null)
      {
         ItemState vhState = changesLog.getItemState(vhID);
         if (vhState != null && vhState.isDeleted())
         {
            // [PN] TODO check why we here if VH already isn't exists.
            // usecase: child version remove when child versionable node is located
            // as child
            // of its containing history versionable node.
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.ItemState

               nextSibling.getPrimaryTypeName(), nextSibling.getMixinTypeNames(), nextSibling.getOrderNumber(),
               nextSibling.getParentIdentifier(), nextSibling.getACL());

         reindexedId = reindexed.getIdentifier();

         ItemState reindexedState = ItemState.createUpdatedState(reindexed);
         changes.add(reindexedState);

         // reload pooled implies... it's actual for session and workspace scope
         // operations
         // TODO this operation must respect all sub-tree of reindexed node
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.ItemState

      for (Iterator<ItemImpl> removedIter = invalidated.iterator(); removedIter.hasNext();)
      {
         ItemImpl removed = removedIter.next();

         QPath removedPath = removed.getLocation().getInternalPath();
         ItemState rstate = changes.getItemState(removedPath);

         if (rstate == null)
         {
            exceptions +=
               "Can't find removed item " + removed.getLocation().getAsString(false) + " in changes for rollback.\n";
            continue;
         }

         if (rstate.getState() == ItemState.RENAMED)
         {
            // find DELETED
            rstate = changes.findItemState(rstate.getData().getIdentifier(), false, new int[]{ItemState.DELETED});
            if (rstate == null)
            {
               exceptions +=
                  "Can't find removed item (of move operation) " + removed.getLocation().getAsString(false)
                     + " in changes for rollback.\n";
               continue;
            }
         }

         NodeData parent = (NodeData)transactionableManager.getItemData(rstate.getData().getParentIdentifier());
         if (parent != null)
         {
            ItemData persisted =
               transactionableManager.getItemData(parent, rstate.getData().getQPath().getEntries()[rstate.getData()
                  .getQPath().getEntries().length - 1], ItemType.getItemType(rstate.getData()));

            if (persisted != null)
            {
               // reload item data
               removed.loadData(persisted);
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.ItemState

      {
         List<ItemState> states = new ArrayList<ItemState>(changesLog.getSize());
         PlainChangesLog changes = logIterator.nextLog();
         for (ItemState change : changes.getAllStates())
         {
            states.add(new ItemState(copyItemData(change.getData()), change.getState(), change.isEventFire(), change
               .getAncestorToSave(), change.isInternallyCreated(), change.isPersisted()));
         }

         newLog.addLog(new PlainChangesLogImpl(states, changes.getSessionId(), changes.getEventType()));
      }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.ItemState

   public ItemData getItemData(NodeData parentData, QPathEntry name, ItemType itemType) throws RepositoryException
   {
      ItemData data = null;
      if (txStarted())
      {
         ItemState state = transactionLog.getItemState(parentData, name, itemType);
         if (state != null)
         {
            data = state.getData();
         }
      }
      if (data != null)
      {
         return data;
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.ItemState

   public ItemData getItemData(String identifier) throws RepositoryException
   {
      ItemData data = null;
      if (txStarted())
      {
         ItemState state = transactionLog.getItemState(identifier);
         if (state != null)
         {
            data = state.getData();
         }
      }
      if (data != null)
      {
         return data;
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.ItemState

   public SessionChangesLog(List<ItemState> items, String sessionId)
   {
      super(items, sessionId);
      for (int i = 0, length = items.size(); i < length; i++)
      {
         ItemState change = items.get(i);
         addItem(change);
      }    
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.ItemState

   public PlainChangesLog addAll(List<ItemState> changes)
   {
      super.addAll(changes);
      for (int i = 0, length = changes.size(); i < length; i++)
      {
         ItemState change = changes.get(i);
         addItem(change);
      }
      return this;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.ItemState

    */
   public void remove(QPath rootPath)
   {
      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));
            index.remove(new IDStateBasedKey(item.getData().getIdentifier(), item.getState()));
            childNodesInfo.remove(item.getData().getIdentifier());
            lastChildNodeStates.remove(item.getData().getIdentifier());
            lastChildPropertyStates.remove(item.getData().getIdentifier());

            if (item.isNode() && item.isPersisted())
            {
               int childInfo[] = childNodesInfo.get(item.getData().getParentIdentifier());
               if (childInfo != null)
               {
                  if (item.isDeleted())
                  {
                     ++childInfo[CHILD_NODES_COUNT_INDEX];
                  }
                  else if (item.isAdded())
                  {
                     --childInfo[CHILD_NODES_COUNT_INDEX];
                  }

                  childNodesInfo.put(item.getData().getParentIdentifier(), childInfo);
               }
            }

            if (item.getData().isNode())
            {
               Map<String, ItemState> children = lastChildNodeStates.get(item.getData().getParentIdentifier());
               if (children != null)
                  children.remove(item.getData().getIdentifier());
            }
            else
            {
               Map<String, ItemState> children = lastChildPropertyStates.get(item.getData().getParentIdentifier());
               if (children != null)
                  children.remove(item.getData().getIdentifier());
            }
         }
      }
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.ItemState

      return changesList;
   }

   private void traverseChangesByIdentifier(String identifier, List<ItemState> changesList)
   {
      ItemState item = getItemState(identifier);
      if (item != null)
      {
         changesList.add(item);
         Map<String, ItemState> children = lastChildPropertyStates.get(identifier);
         if (children != null)
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.