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

Examples of org.exoplatform.services.jcr.impl.core.ItemImpl


      node3.setProperty("exo:text", "Ho ho ha ha");

      session.save();

      Node n = root.getNode(name);
      ItemImpl item = null;
      try
      {
         item = session.getItem("/" + name);
      }
      catch (Exception e)
View Full Code Here


      }
   }

   public void testGetParentDataWhenNodeIsRoot() throws RepositoryException
   {
      ItemImpl node = (ItemImpl)root;

      try
      {
         node.parentData();
         fail();
      }
      catch (ItemNotFoundException e)
      {
      }
View Full Code Here

   }

   public void testEquals() throws ItemExistsException, PathNotFoundException, VersionException,
      ConstraintViolationException, LockException, RepositoryException
   {
      ItemImpl testNode1 = (ItemImpl)root.addNode("testNode1");
      ItemImpl testNode2 = (ItemImpl)root.addNode("testNode2");

      assertFalse(testNode1.equals(new Object()));
      assertFalse(testNode1.equals(testNode2));
   }
View Full Code Here

    * @see org.apache.commons.chain.Command#execute(org.apache.commons.chain.Context)
    */
   @Override
   public boolean execute(Context context) throws Exception
   {
      ItemImpl currentItem = (ItemImpl)context.get("currentItem");
      Node myActionNode = ((Node)currentItem).addNode("myActionNode");
      myActionNode.setProperty(addPropertyName, addPropertyValue);

      return false;
   }
View Full Code Here

   {

      List<String> names = new ArrayList<String>();
      while (iterator.hasNext())
      {
         ItemImpl item = (ItemImpl)iterator.next();
         names.add(item.getName());
      }

      //compare names
      assertEquals(expectedNames.length, names.size());
View Full Code Here

      deletedExistingPropery = false;

      if (isMixReferenceable)
      {
         String identifier = node.getIdentifier();
         ItemImpl relItem = dstDataManager.getItemByIdentifier(identifier, false);

         ItemState changesItemState = null;
         if (changes != null)
         {
            changesItemState = changes.getItemState(identifier);
         }

         if (relItem != null && !(changesItemState != null && changesItemState.isDeleted()))
         {
            if (removeExisting)
            {
               deletedExistingPropery = true;
               itemDeletedExistingStates.add(new ItemState(relItem.getData(), ItemState.DELETED, true, dstDataManager
                  .getItemByIdentifier(relItem.getParentIdentifier(), false).getInternalPath(), level != 0));
            }
            else
            {
               throw new ItemExistsException("Item exists id = " + identifier + " name " + relItem.getName());
            }
         }
         keepIdentifiers = true;
      }
View Full Code Here

   ItemImpl get(QPath path)
   {
      for (Iterator<ItemImpl> i = items.values().iterator(); i.hasNext();)
      {
         ItemImpl item = i.next();
         if (item.getInternalPath().equals(path))
            return item;
      }
      return null;
   }
View Full Code Here

   List<NodeImpl> getChildNodes(String parentIdentifier)
   {
      List<NodeImpl> children = new ArrayList<NodeImpl>();
      for (Iterator<ItemImpl> i = items.values().iterator(); i.hasNext();)
      {
         ItemImpl item = i.next();
         if (item.getParentIdentifier().equals(parentIdentifier) && item.isNode())
            children.add((NodeImpl)item);
      }
      return children;
   }
View Full Code Here

   List<PropertyImpl> getChildProperties(String parentIdentifier)
   {
      List<PropertyImpl> children = new ArrayList<PropertyImpl>();
      for (Iterator<ItemImpl> i = items.values().iterator(); i.hasNext();)
      {
         ItemImpl item = i.next();
         if (item.getParentIdentifier().equals(parentIdentifier) && item.isNode())
            children.add((PropertyImpl)item);
      }
      return children;
   }
View Full Code Here

         ntManager.isNodeType(Constants.MIX_REFERENCEABLE, node.getPrimaryTypeName(), node.getMixinTypeNames());
      deletedExistingPropery = false;
      if (isMixReferenceable)
      {
         String identifier = node.getIdentifier();
         ItemImpl relItem = dstDataManager.getItemByIdentifier(identifier, false);

         ItemState changesItemState = null;
         if (changes != null)
         {
            changesItemState = changes.getItemState(identifier);
         }

         if (relItem != null && !(changesItemState != null && changesItemState.isDeleted()))
         {
            if (removeExisting)
            {
               deletedExistingPropery = true;
               itemDeletedExistingStates.add(new ItemState(relItem.getData(), ItemState.DELETED, true, dstDataManager
                  .getItemByIdentifier(relItem.getParentIdentifier(), false).getInternalPath(), level != 0));
            }
            else
            {
               throw new ItemExistsException("Item exists id = " + identifier + " name " + relItem.getName());
            }
         }
         keepIdentifiers = true;
      }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.core.ItemImpl

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.