Package org.exoplatform.services.jcr.datamodel

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


                     + " 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()));
View Full Code Here


         // 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
                  NodeData parent = (NodeData)transactionableManager.getItemData(pooled.getParentIdentifier());
                  if (parent != null)
                  {
                     QPathEntry[] path = pooled.getData().getQPath().getEntries();
                     persisted =
                        transactionableManager.getItemData(parent, path[path.length - 1],
View Full Code Here

         if (action != MERGE_PROPS)
         {
            List<NodeData> childNodes = dataManager.getChildNodesData((NodeData)parent);
            for (int i = 0, length = childNodes.size(); i < length; i++)
            {
               NodeData childNode = childNodes.get(i);
               ret.put(childNode.getIdentifier(), childNode);
            }
         }
         if (action != MERGE_NODES)
         {
            List<PropertyData> childProps =
View Full Code Here

      // make a copy
      if (item.isNode())
      {

         final NodeData node = (NodeData)item;

         // the node ACL can't be are null as ACL manager does care about this
         final AccessControlList acl = node.getACL();
         if (acl == null)
         {
            throw new RepositoryException("Node ACL is null. " + node.getQPath().getAsString() + " "
               + node.getIdentifier());
         }

         return new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(),
            node.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(), node.getParentIdentifier(), acl);
      }

      // else - property
      final PropertyData prop = (PropertyData)item;
View Full Code Here

            }
         }
         childNodes = super.getChildNodesData(nodeData);
         if (cache.isEnabled())
         {
            NodeData parentData = (NodeData)getItemData(nodeData.getIdentifier());

            if (parentData != null)
            {
               cache.addChildNodes(parentData, childNodes);
            }
View Full Code Here

         childProperties = super.getChildPropertiesData(nodeData);
         // TODO childProperties.size() > 0 for SDB
         if (childProperties.size() > 0 && cache.isEnabled())
         {
            NodeData parentData = (NodeData)getItemData(nodeData.getIdentifier());

            if (parentData != null)
            {
               cache.addChildProperties(parentData, childProperties);
            }
View Full Code Here

         }
         propertiesList = super.listChildPropertiesData(nodeData);
         // TODO propertiesList.size() > 0 for SDB
         if (propertiesList.size() > 0 && cache.isEnabled())
         {
            NodeData parentData = (NodeData)getItemData(nodeData.getIdentifier());

            if (parentData != null)
            {
               cache.addChildPropertiesList(parentData, propertiesList);
            }
View Full Code Here

   private AccessControlList getNearestACAncestorAcl(NodeData node) throws RepositoryException
   {

      if (node.getParentIdentifier() != null)
      {
         NodeData parent = (NodeData)getItemData(node.getParentIdentifier());
         while (parent != null)
         {
            if (parent.getACL() != null)
            {
               // has an AC parent
               return parent.getACL();
            }
            // going up to the root
            parent = (NodeData)getItemData(parent.getParentIdentifier());
         }
      }
      return new AccessControlList();
   }
View Full Code Here

   /**
    * Check if same-name sibling exists in persistence.
    */
   private void checkPersistedSNS(NodeData node, WorkspaceStorageConnection acon) throws RepositoryException
   {
      NodeData parent = (NodeData)acon.getItemData(node.getParentIdentifier());
      QPathEntry myName = node.getQPath().getEntries()[node.getQPath().getEntries().length - 1];
      ItemData sibling =
         acon.getItemData(parent, new QPathEntry(myName.getNamespace(), myName.getName(), myName.getIndex() - 1),
            ItemType.NODE);

View Full Code Here

      throws RepositoryException, InvalidItemStateException
   {

      if (item.isNode())
      {
         final NodeData node = (NodeData)item;

         checkSameNameSibling(node, con, addedNodes);
         addedNodes.add(node.getQPath());

         con.add(node);
      }
      else
      {
View Full Code Here

TOP

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

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.