Examples of PlainChangesLogImpl


Examples of org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl

      try
      {
         for (int i = 0; i < list.length; i++)
         {
            PlainChangesLog plainChangesLog =
               new PlainChangesLogImpl(new ArrayList<ItemState>(), IdentityConstants.SYSTEM, ExtendedEvent.UNLOCK);

            NodeData lockedNodeData = (NodeData)dataManager.getItemData(list[i]);
            // No item no problem
            if (lockedNodeData != null)
            {
               PropertyData dataLockIsDeep =
                  (PropertyData)dataManager.getItemData(lockedNodeData, new QPathEntry(Constants.JCR_LOCKISDEEP, 0),
                     ItemType.PROPERTY);

               if (dataLockIsDeep != null)
               {
                  plainChangesLog.add(ItemState.createDeletedState(new TransientPropertyData(QPath.makeChildPath(
                     lockedNodeData.getQPath(), Constants.JCR_LOCKISDEEP), dataLockIsDeep.getIdentifier(), 0,
                     dataLockIsDeep.getType(), dataLockIsDeep.getParentIdentifier(), dataLockIsDeep.isMultiValued())));
               }

               PropertyData dataLockOwner =
                  (PropertyData)dataManager.getItemData(lockedNodeData, new QPathEntry(Constants.JCR_LOCKOWNER, 0),
                     ItemType.PROPERTY);
               if (dataLockOwner != null)
               {
                  plainChangesLog.add(ItemState.createDeletedState(new TransientPropertyData(QPath.makeChildPath(
                     lockedNodeData.getQPath(), Constants.JCR_LOCKOWNER), dataLockOwner.getIdentifier(), 0,
                     dataLockOwner.getType(), dataLockOwner.getParentIdentifier(), dataLockOwner.isMultiValued())));
               }

               if (plainChangesLog.getSize() > 0)
               {
                  transactionChangesLog.addLog(plainChangesLog);
               }
            }
         }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl

   }

   public PlainChangesLog makeAutoCreatedItems(final NodeData parent, final InternalQName nodeTypeName,
      final ItemDataConsumer targetDataManager, final String owner) throws RepositoryException
   {
      final PlainChangesLogImpl changes = new PlainChangesLogImpl();
      final NodeTypeData type = nodeTypeDataManager.getNodeType(nodeTypeName);

      changes.addAll(makeAutoCreatedProperties(parent, nodeTypeName,
         nodeTypeDataManager.getAllPropertyDefinitions(nodeTypeName), targetDataManager, owner).getAllStates());
      // Add autocreated child nodes
      changes.addAll(makeAutoCreatedNodes(parent, nodeTypeName,
         nodeTypeDataManager.getAllChildNodeDefinitions(nodeTypeName), targetDataManager, owner).getAllStates());

      // versionable
      if (nodeTypeDataManager.isNodeType(Constants.MIX_VERSIONABLE, new InternalQName[]{type.getName()}))
      {

         // using VH helper as for one new VH, all changes in changes log
         changes.addAll(makeMixVesionableChanges(parent).getAllStates());
      }
      return changes;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl

   public PlainChangesLog makeAutoCreatedNodes(final NodeData parent, final InternalQName typeName,
      final NodeDefinitionData[] nodeDefs, final ItemDataConsumer targetDataManager, final String owner)
      throws RepositoryException
   {
      final PlainChangesLogImpl changes = new PlainChangesLogImpl();
      final Set<InternalQName> addedNodes = new HashSet<InternalQName>();
      for (final NodeDefinitionData ndef : nodeDefs)
      {
         if (ndef.isAutoCreated())
         {
            final ItemData pdata =
               avoidCheckExistedChildItems ? null : targetDataManager.getItemData(parent, new QPathEntry(
                  ndef.getName(), 0), ItemType.NODE, false);
            if (pdata == null && !addedNodes.contains(ndef.getName()) || pdata != null && !pdata.isNode())
            {

               final TransientNodeData childNodeData =
                  TransientNodeData.createNodeData(parent, ndef.getName(), ndef.getDefaultPrimaryType(),
                     IdGenerator.generate());
               changes.add(ItemState.createAddedState(childNodeData, false));
               changes.addAll(makeAutoCreatedItems(childNodeData, childNodeData.getPrimaryTypeName(),
                  targetDataManager, owner).getAllStates());
               addedNodes.add(ndef.getName());
            }
            else
            {
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl

   public PlainChangesLog makeAutoCreatedProperties(final NodeData parent, final InternalQName typeName,
      final PropertyDefinitionData[] propDefs, final ItemDataConsumer targetDataManager, final String owner)
      throws RepositoryException
   {
      final PlainChangesLogImpl changes = new PlainChangesLogImpl();

      final Set<InternalQName> addedProperties = new HashSet<InternalQName>();

      // Add autocreated child properties

      for (final PropertyDefinitionData pdef : propDefs)
      {

         if (pdef.isAutoCreated())
         {

            final ItemData pdata =
               avoidCheckExistedChildItems ? null : targetDataManager.getItemData(parent, new QPathEntry(
                  pdef.getName(), 0), ItemType.PROPERTY, false);
            if (pdata == null && !addedProperties.contains(pdef.getName()) || pdata != null && pdata.isNode())
            {

               final List<ValueData> listAutoCreateValue = autoCreatedValue(parent, typeName, pdef, owner);

               if (listAutoCreateValue != null)
               {
                  final TransientPropertyData propertyData =
                     TransientPropertyData.createPropertyData(parent, pdef.getName(), pdef.getRequiredType(),
                        pdef.isMultiple(), listAutoCreateValue);
                  changes.add(ItemState.createAddedState(propertyData));
                  addedProperties.add(pdef.getName());
               }
            }
            else
            {
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl

    * @return
    * @throws RepositoryException
    */
   public PlainChangesLog makeMixVesionableChanges(final NodeData parent) throws RepositoryException
   {
      PlainChangesLog changesLog = new PlainChangesLogImpl();
      new VersionHistoryDataHelper(parent, changesLog, dataConsumer, nodeTypeDataManager);
      return changesLog;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl

         {
            return;
         }

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

         ItemData lockOwner =
            copyItemData((PropertyData)dataManager.getItemData(nData, new QPathEntry(Constants.JCR_LOCKOWNER, 1),
               ItemType.PROPERTY));

         //Skip removing, because that lock was removed in other node of cluster. 
         if (lockOwner == null)
         {
            return;
         }

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

         ItemData lockIsDeep =
            copyItemData((PropertyData)dataManager.getItemData(nData, new QPathEntry(Constants.JCR_LOCKISDEEP, 1),
               ItemType.PROPERTY));

         //Skip removing, because that lock was removed in other node of cluster. 
         if (lockIsDeep == null)
         {
            return;
         }

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

         // lock probably removed by other thread
         if (lockOwner == null && lockIsDeep == null)
         {
            return;
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl

      List<PropertyDefinitionData> removedDefinitionData = new ArrayList<PropertyDefinitionData>();
      init(ancestorDefinition, recipientDefinition, sameDefinitionData, changedDefinitionData, newDefinitionData,
         removedDefinitionData);

      // create changes log
      PlainChangesLog changesLog = new PlainChangesLogImpl();

      // removing properties
      validateRemoved(registeredNodeType, removedDefinitionData, recipientDefinition, affectedNodes);

      // new property definition
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl

            + session.getUserID() + " item owner " + getACL().getOwner());
      }

      checkValid();

      PlainChangesLog changesLog = new PlainChangesLogImpl(session);

      removeMergeFailed(version, changesLog);

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

Examples of org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl

      {
         throw new AccessDeniedException("Access denied: done merge operation " + getPath() + " for: "
            + session.getUserID() + " item owner " + getACL().getOwner());
      }

      PlainChangesLog changesLog = new PlainChangesLogImpl(session);

      VersionImpl base = (VersionImpl)getBaseVersion();
      base.addPredecessor(version.getUUID(), changesLog);
      removeMergeFailed(version, changesLog);
View Full Code Here

Examples of org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl

         throw new InvalidItemStateException("Node has pending unsaved changes " + getPath());
      }

      Lock newLock = session.getLockManager().addLock(this, isDeep, isSessionScoped, -1);

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

      PropertyData propData =
         TransientPropertyData.createPropertyData(nodeData(), Constants.JCR_LOCKOWNER, PropertyType.STRING, false,
            new TransientValueData(session.getUserID()));
      changesLog.add(ItemState.createAddedState(propData));

      propData =
         TransientPropertyData.createPropertyData(nodeData(), Constants.JCR_LOCKISDEEP, PropertyType.BOOLEAN, false,
            new TransientValueData(isDeep));
      changesLog.add(ItemState.createAddedState(propData));

      dataManager.getTransactManager().save(changesLog);

      session.getActionHandler().postLock(this);
      return newLock;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.