Examples of ItemData


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

   void refresh(ItemData item) throws InvalidItemStateException, RepositoryException
   {
      if (!isModified(item) && itemsPool.contains(item.getIdentifier()))
      {
         // if not modified but was pooled, load data from persistent storage
         ItemData persisted = transactionableManager.getItemData(item.getIdentifier());
         if (persisted == null)
         {
            // ...try by path
            NodeData parent = (NodeData)transactionableManager.getItemData(item.getParentIdentifier());
            if (parent != null)
            {
               QPathEntry[] path = item.getQPath().getEntries();
               persisted =
                  transactionableManager.getItemData(parent, path[path.length - 1], ItemType.getItemType(item));
            } // else, the item has an invalid state, will be throwed on save
         }

         if (persisted != null)
         {
            // the item
            itemsPool.reload(item.getIdentifier(), persisted);

            // the childs is acquired in the session.
            for (ItemImpl pooled : itemsPool.getDescendats(persisted.getQPath()))
            {
               persisted = transactionableManager.getItemData(pooled.getInternalIdentifier());
               if (persisted == null)
               {
                  // ...try by path
View Full Code Here

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

         traverseStoredDescendants(rootData, dataManager, MERGE_NODES, descendants, false, transientDescendants);

         // merge data
         for (ItemState state : transientDescendants)
         {
            ItemData data = state.getData();
            if (!state.isDeleted())
            {
               descendants.put(data.getIdentifier(), data);
            }
            else
            {
               descendants.remove(data.getIdentifier());
            }
         }
         Collection<ItemData> desc = descendants.values();
         return new ArrayList<ItemData>(desc);
      }
View Full Code Here

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

         traverseStoredDescendants(rootData, dataManager, MERGE_PROPS, descendants, false, transientDescendants);

         // merge data
         for (ItemState state : transientDescendants)
         {
            ItemData data = state.getData();
            if (!state.isDeleted())
            {
               descendants.put(data.getIdentifier(), data);
            }
            else
            {
               descendants.remove(data.getIdentifier());
            }
         }
         Collection<ItemData> desc = descendants.values();
         return new ArrayList<ItemData>(desc);
      }
View Full Code Here

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

         traverseStoredDescendants(rootData, dataManager, action, descendants, true, transientDescendants);

         // merge data
         for (ItemState state : transientDescendants)
         {
            ItemData data = state.getData();
            if (!state.isDeleted())
            {
               descendants.put(data.getIdentifier(), data);
            }
            else
            {
               descendants.remove(data.getIdentifier());
            }
         }
         Collection<ItemData> desc = descendants.values();
         List<ItemData> retval;
         if (deep)
View Full Code Here

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

   {
      HashMap<String, ItemState> changes = new HashMap<String, ItemState>();

      for (int i = 0; i < items.size(); i++)
      {
         ItemData item = items.get(i).getData();
         if (item.getIdentifier().equals(rootData.getIdentifier()))
         {
            // the node
            if (items.get(i).isAdded())
               // if a new item - no modify changes can be
               return new ArrayList<ItemState>();

            if (!items.get(i).isDeleted())
               changes.put(item.getIdentifier(), items.get(i));
         }
         else if (item.getParentIdentifier().equals(rootData.getIdentifier()))
         {
            // childs
            changes.put(item.getIdentifier(), items.get(i));
         }
      }

      return changes.values();
   }
View Full Code Here

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

   @Override
   public ItemData getItemData(NodeData parentData, QPathEntry name, ItemType itemType) throws RepositoryException
   {

      // 1. Try from cache
      ItemData data = getCachedItemData(parentData, name, itemType);

      // 2. Try from container
      if (data == null)
      {
         final DataRequest request = new DataRequest(parentData.getIdentifier(), name);

         try
         {
            request.start();
            // Try first to get the value from the cache since a
            // request could have been launched just before
            data = getCachedItemData(parentData, name, itemType);
            if (data == null)
            {
               data = getPersistedItemData(parentData, name, itemType);
            }
         }
         finally
         {
            request.done();
         }
      }

      if (data instanceof NullItemData)
      {
         return null;
      }

      if (data != null && !data.isNode())
      {
         fixPropertyValues((PropertyData)data);
      }

      return data;
View Full Code Here

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

    */
   @Override
   public ItemData getItemData(String identifier) throws RepositoryException
   {
      // 2. Try from cache
      ItemData data = getCachedItemData(identifier);

      // 3. Try from container
      if (data == null)
      {
         final DataRequest request = new DataRequest(identifier);

         try
         {
            request.start();
            // Try first to get the value from the cache since a
            // request could have been launched just before
            data = getCachedItemData(identifier);
            if (data == null)
            {
               data = getPersistedItemData(identifier);
            }
         }
         finally
         {
            request.done();
         }
      }

      if (data instanceof NullItemData)
      {
         return null;
      }

      if (data != null && !data.isNode())
      {
         fixPropertyValues((PropertyData)data);
      }

      return data;
View Full Code Here

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

    *           error
    */
   protected ItemData getPersistedItemData(NodeData parentData, QPathEntry name, ItemType itemType)
      throws RepositoryException
   {
      ItemData data = super.getItemData(parentData, name, itemType);
      if (cache.isEnabled())
      {
         if (data == null)
         {
            if (itemType == ItemType.NODE || itemType == ItemType.UNKNOWN)
View Full Code Here

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

    *
    * @see org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager#getItemData(java.lang.String)
    */
   protected ItemData getPersistedItemData(String identifier) throws RepositoryException
   {
      ItemData data = super.getItemData(identifier);
      if (cache.isEnabled())
      {
         if (data != null)
         {
            cache.put(data);
View Full Code Here

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

   /**
    * {@inheritDoc}
    */
   public ItemData getItemData(NodeData parent, QPathEntry name, ItemType itemType) throws RepositoryException
   {
      final ItemData item = persistentManager.getItemData(parent, name, itemType);
      return item != null && item.isNode() ? initACL(parent, (NodeData)item) : item;
   }
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.