Package org.exoplatform.services.jcr.datamodel

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


   {
      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

   @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

    */
   @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

    *           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

    *
    * @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

   /**
    * {@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

   /**
    * {@inheritDoc}
    */
   public ItemData getItemData(String identifier) throws RepositoryException
   {
      final ItemData item = persistentManager.getItemData(identifier);
      return item != null && item.isNode() ? initACL(null, (NodeData)item) : item;
   }
View Full Code Here

    */
   @Override
   public ItemData getItemData(String identifier) throws RepositoryException
   {
      // from cache at first
      ItemData cdata = persistentManager.getCachedItemData(identifier);
      if (cdata != null && !(cdata instanceof NullItemData))
         return super.getItemData(identifier);

      if (!this.equals(versionDataManager) && !identifier.equals(Constants.ROOT_UUID))
      {
         // search in System cache for /jcr:system nodes only
         cdata = versionDataManager.persistentManager.getCachedItemData(identifier);
         if (cdata != null && !(cdata instanceof NullItemData))
            if (isSystemDescendant(cdata.getQPath()))
               return versionDataManager.getItemData(identifier);
            else
               return null;
      }

      // then from persistence
      ItemData data = super.getItemData(identifier);
      if (data != null)
         return data;
      else if (!this.equals(versionDataManager))
      {
         // try from version storage if not the same
         data = versionDataManager.getItemData(identifier);
         if (data != null && isSystemDescendant(data.getQPath()))
            return data;
      }
      return null;
   }
View Full Code Here

   /**
    * {@inheritDoc}
    */
   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)
         {
View Full Code Here

TOP

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

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.