Package org.exoplatform.services.jcr.impl.core

Examples of org.exoplatform.services.jcr.impl.core.SessionDataManager$ItemReferencePool


   /**
    * Is a predecessor of the merge version
    */
   protected boolean isPredecessor(NodeData mergeVersion, NodeData corrVersion) throws RepositoryException
   {
      SessionDataManager mergeDataManager = mergeSession.getTransientNodesManager();

      PropertyData predecessorsProperty =
         (PropertyData)mergeDataManager.getItemData(mergeVersion, new QPathEntry(Constants.JCR_PREDECESSORS, 0));

      if (predecessorsProperty != null)
         for (ValueData pv : predecessorsProperty.getValues())
         {
            try
            {
               String pidentifier = new String(pv.getAsByteArray());

               if (pidentifier.equals(corrVersion.getIdentifier()))
                  return true; // got it

               // search in predecessors of the predecessor
               NodeData predecessor = (NodeData)mergeDataManager.getItemData(pidentifier);
               if (predecessor != null)
               {
                  if (isPredecessor(predecessor, corrVersion))
                  {
                     return true;
View Full Code Here


   /**
    * Is a successor of the merge version
    */
   protected boolean isSuccessor(NodeData mergeVersion, NodeData corrVersion) throws RepositoryException
   {
      SessionDataManager mergeDataManager = mergeSession.getTransientNodesManager();

      PropertyData successorsProperty =
         (PropertyData)mergeDataManager.getItemData(mergeVersion, new QPathEntry(Constants.JCR_SUCCESSORS, 0));

      if (successorsProperty != null)
         for (ValueData sv : successorsProperty.getValues())
         {
            try
            {
               String sidentifier = new String(sv.getAsByteArray());

               if (sidentifier.equals(corrVersion.getIdentifier()))
                  return true; // got it

               // search in successors of the successor
               NodeData successor = (NodeData)mergeDataManager.getItemData(sidentifier);
               if (successor != null)
               {
                  if (isSuccessor(successor, corrVersion))
                  {
                     return true;
View Full Code Here

   }

   @Override
   protected void tearDown() throws Exception
   {
      SessionDataManager sdm = session.getTransientNodesManager();
      TransactionableDataManager trm = sdm.getTransactManager();
      SharedDataManager wdm = trm.getStorageDataManager();

      CompositeChangesLog clog = new TransactionChangesLog();
      PlainChangesLogImpl changes = new PlainChangesLogImpl();
      for (int i = cleanUpList.size(); i > 0;)
View Full Code Here

      super.tearDown();
   }

   public void testItemAdd_Connection() throws Exception
   {
      SessionDataManager sdm = session.getTransientNodesManager();
      TransactionableDataManager trm = sdm.getTransactManager();
      SharedDataManager wdm = trm.getStorageDataManager();

      NodeData rootData = (NodeData)wdm.getItemData(Constants.ROOT_UUID);

      InternalQName nodeName = InternalQName.parse("[]testNode");
View Full Code Here

   }

   public void testItemAdd_DataManager() throws Exception
   {
      SessionDataManager sdm = session.getTransientNodesManager();
      TransactionableDataManager trm = sdm.getTransactManager();
      SharedDataManager wdm = trm.getStorageDataManager();

      NodeData rootData = (NodeData)wdm.getItemData(Constants.ROOT_UUID);

      InternalQName nodeName = InternalQName.parse("[]testNode");
View Full Code Here

      catch (RepositoryException e)
      {
         // OK - wc1  Version History contain nt:versionedChild with link to non exist Version history

         // remove bugy version history
         SessionDataManager dataManager = session.getTransientNodesManager();
         NodeImpl vhPicture =
            (NodeImpl)session.getItem("/jcr:system/jcr:versionStorage/" + versionHistory
               + "/1/jcr:frozenNode/medias/picture");

         assertTrue(vhPicture.isNodeType("nt:versionedChild"));

         PlainChangesLog changesLogDelete = new PlainChangesLogImpl();
         changesLogDelete.add(ItemState.createDeletedState(((PropertyImpl)vhPicture
            .getProperty("jcr:childVersionHistory")).getData()));
         changesLogDelete.add(ItemState.createDeletedState(((PropertyImpl)vhPicture.getProperty("jcr:primaryType"))
            .getData()));
         changesLogDelete.add(ItemState.createDeletedState((vhPicture.getData())));

         picture = wc1.getNode("medias").getNode("picture");
         changesLogDelete.add(ItemState.createDeletedState(((PropertyImpl)picture.getProperty("jcr:mixinTypes"))
            .getData()));

         dataManager.getTransactManager().save(changesLogDelete);
      }
   }
View Full Code Here

      catch (RepositoryException e)
      {
         // OK - wc1  Version History contain nt:versionedChild with link to non exist Version history

         // remove bugy version history
         SessionDataManager dataManager = session.getTransientNodesManager();
         NodeImpl vhPicture =
            (NodeImpl)session.getItem("/jcr:system/jcr:versionStorage/" + versionHistory
               + "/1/jcr:frozenNode/medias/picture");

         assertTrue(vhPicture.isNodeType("nt:versionedChild"));

         PlainChangesLog changesLogDelete = new PlainChangesLogImpl();
         changesLogDelete.add(ItemState.createDeletedState(((PropertyImpl)vhPicture.getProperty("jcr:primaryType"))
            .getData()));
         changesLogDelete.add(ItemState.createDeletedState(((PropertyImpl)vhPicture
            .getProperty("jcr:childVersionHistory")).getData()));
         changesLogDelete.add(ItemState.createDeletedState((vhPicture.getData())));

         picture = wc1.getNode("medias").getNode("picture");
         changesLogDelete.add(ItemState.createDeletedState(((PropertyImpl)picture.getProperty("jcr:mixinTypes"))
            .getData()));

         dataManager.getTransactManager().save(changesLogDelete);
      }
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.core.SessionDataManager$ItemReferencePool

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.