Package org.exoplatform.services.jcr.datamodel

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


      checkValid();

      JCRPath itemPath = locationFactory.parseRelPath(relPath);

      ItemData prop = dataManager.getItemData(nodeData(), itemPath.getInternalPath().getEntries(), ItemType.PROPERTY);
      return prop != null && !prop.isNode();
   }
View Full Code Here


      // Remove mixin nt definition node/properties from this node
      QPath ancestorToSave = nodeData().getQPath();

      for (PropertyDefinitionData pd : ntmanager.getAllPropertyDefinitions(removedName))
      {
         ItemData p = dataManager.getItemData(nodeData(), new QPathEntry(pd.getName(), 1), ItemType.PROPERTY);
         if (p != null && !p.isNode())
         {
            // remove it
            dataManager.delete(p, ancestorToSave);
         }
      }

      for (NodeDefinitionData nd : ntmanager.getAllChildNodeDefinitions(removedName))
      {
         ItemData n = dataManager.getItemData(nodeData(), new QPathEntry(nd.getName(), 1), ItemType.NODE);
         if (n != null && n.isNode())
         {
            // remove node with subtree
            ItemDataRemoveVisitor remover = new ItemDataRemoveVisitor(dataManager, ancestorToSave);
            n.accept(remover);
            for (ItemState deleted : remover.getRemovedStates())
            {
               dataManager.delete(deleted.getData(), ancestorToSave);
            }
         }
View Full Code Here

   {

      PlainChangesLog changesLog =
         new PlainChangesLogImpl(new ArrayList<ItemState>(), session.getId(), ExtendedEvent.UNLOCK);

      ItemData lockOwner =
         dataManager.getItemData(nodeData(), new QPathEntry(Constants.JCR_LOCKOWNER, 0), ItemType.PROPERTY);

      changesLog.add(ItemState.createDeletedState(lockOwner));

      ItemData lockIsDeep =
         dataManager.getItemData(nodeData(), new QPathEntry(Constants.JCR_LOCKISDEEP, 0), ItemType.PROPERTY);

      changesLog.add(ItemState.createDeletedState(lockIsDeep));

      dataManager.getTransactManager().save(changesLog);
View Full Code Here

   private boolean hasProperty(InternalQName name)
   {
      try
      {
         ItemData pdata = dataManager.getItemData(nodeData(), new QPathEntry(name, 1), ItemType.PROPERTY);

         if (pdata != null && !pdata.isNode())
         {
            return true;
         }
      }
      catch (RepositoryException e)
View Full Code Here

   }

   public ItemData getItemData(NodeData parentData, QPathEntry name, ItemType itemType) throws RepositoryException,
      IllegalStateException
   {
      ItemData itemData = null;
      QPath qPath = QPath.makeChildPath(parentData.getQPath(), name);

      if (itemType == ItemType.NODE || itemType == ItemType.UNKNOWN)
      {
         itemData = (ItemData)items.get(new MapKey(qPath, ItemType.NODE));
View Full Code Here

   public ItemData getItemData(String identifier) throws RepositoryException, IllegalStateException
   {
      Iterator itemsIterator = items.values().iterator();
      while (itemsIterator.hasNext())
      {
         ItemData data = (ItemData)itemsIterator.next();
         if (data.getIdentifier().equals(identifier))
            return data;
      }
      return null;
   }
View Full Code Here

   {
      ArrayList<PropertyData> refs = new ArrayList<PropertyData>();
      Iterator it = items.values().iterator();
      while (it.hasNext())
      {
         ItemData itemData = (ItemData)it.next();
         ValueData identifierVal = ((PropertyData)itemData).getValues().get(0);
         try
         {
            if ((itemData instanceof PropertyData) && ((PropertyData)itemData).getType() == PropertyType.REFERENCE
               && new String(identifierVal.getAsByteArray()).equals(identifier))
View Full Code Here

         BaseXmlExporter exporter =
            new ExportImportFactory().getExportVisitor(XmlMapping.DOCVIEW, contentHandler, skipBinary, noRecurse,
               getTransientNodesManager(), repository.getNamespaceRegistry(), valueFactoryImpl);

         JCRPath srcNodePath = getLocationFactory().parseAbsPath(absPath);
         ItemData srcItemData = dataManager.getItemData(srcNodePath.getInternalPath());

         if (srcItemData == null)
         {
            throw new PathNotFoundException("No node exists at " + absPath);
         }
View Full Code Here

         BaseXmlExporter exporter =
            new ExportImportFactory().getExportVisitor(XmlMapping.DOCVIEW, out, skipBinary, noRecurse,
               getTransientNodesManager(), repository.getNamespaceRegistry(), valueFactoryImpl);

         JCRPath srcNodePath = getLocationFactory().parseAbsPath(absPath);
         ItemData srcItemData = dataManager.getItemData(srcNodePath.getInternalPath());

         if (srcItemData == null)
         {
            throw new PathNotFoundException("No node exists at " + absPath);
         }
View Full Code Here

      {
         BaseXmlExporter exporter =
            new ExportImportFactory().getExportVisitor(XmlMapping.BACKUP, out, skipBinary, noRecurse,
               getTransientNodesManager(), repository.getNamespaceRegistry(), valueFactoryImpl);

         ItemData srcItemData = dataManager.getItemData(Constants.ROOT_UUID);
         if (srcItemData == null)
         {
            throw new PathNotFoundException("Root node not found");
         }
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.