Examples of PlainChangesLog


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

   {

      // validate all, throw an exception if validation failed
      validate(path);

      PlainChangesLog cLog = changesLog.pushLog(path);

      if (log.isDebugEnabled())
      {
         log.debug(" ----- commit -------- \n" + cLog.dump());
      }

      try
      {
         transactionableManager.save(cLog);
View Full Code Here

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

    */
   void rollback(ItemData item) throws InvalidItemStateException, RepositoryException
   {

      // remove from changes log (Session pending changes)
      PlainChangesLog slog = changesLog.pushLog(item.getQPath());
      SessionChangesLog changes = new SessionChangesLog(slog.getAllStates(), session.getId());

      String exceptions = "";

      for (Iterator<ItemImpl> removedIter = invalidated.iterator(); removedIter.hasNext();)
      {
View Full Code Here

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

      TransactionChangesLog newLog = new TransactionChangesLog();

      while (logIterator.hasNextLog())
      {
         List<ItemState> states = new ArrayList<ItemState>(changesLog.getSize());
         PlainChangesLog changes = logIterator.nextLog();
         for (ItemState change : changes.getAllStates())
         {
            states.add(new ItemState(copyItemData(change.getData()), change.getState(), change.isEventFire(), change
               .getAncestorToSave(), change.isInternallyCreated(), change.isPersisted()));
         }

         newLog.addLog(new PlainChangesLogImpl(states, changes.getSessionId(), changes.getEventType()));
      }

      storageDataManager.save(newLog);
   }
View Full Code Here

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

      while (logIterator.hasNextLog())
      {
         List<ItemState> vstates = new ArrayList<ItemState>();
         List<ItemState> nvstates = new ArrayList<ItemState>();

         PlainChangesLog changes = logIterator.nextLog();
         for (ItemState change : changes.getAllStates())
         {
            if (isSystemDescendant(change.getData().getQPath()) && !this.equals(versionDataManager))
            {
               vstates.add(change);
            }
            else
            {
               nvstates.add(change);
            }
         }

         if (vstates.size() > 0)
         {
            if (nvstates.size() > 0)
            {
               // we have pair of logs for system and non-system (this) workspaces
               final String pairId = IdGenerator.generate();

               versionLogs.addLog(new PlainChangesLogImpl(vstates, changes.getSessionId(), changes.getEventType(),
                  pairId));
               nonVersionLogs.addLog(new PlainChangesLogImpl(nvstates, changes.getSessionId(), changes.getEventType(),
                  pairId));
            }
            else
            {
               versionLogs.addLog(new PlainChangesLogImpl(vstates, changes.getSessionId(), changes.getEventType()));
            }
         }
         else if (nvstates.size() > 0)
         {
            nonVersionLogs.addLog(new PlainChangesLogImpl(nvstates, changes.getSessionId(), changes.getEventType()));
         }
      }

      if (versionLogs.getSize() > 0)
      {
View Full Code Here

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

    * @throws RepositoryException
    */
   public void save(ItemStateChangesLog changes) throws RepositoryException
   {

      PlainChangesLog statesLog = (PlainChangesLog)changes;

      if (LOG.isDebugEnabled())
      {
         LOG.debug("save() " + this + " txStarted: " + txStarted() + "\n====== Changes ======\n"
            + (statesLog != null ? "\n" + statesLog.dump() : "[NULL]") + "=====================");
      }

      if (txStarted())
      {
         transactionLog.addLog(statesLog);
View Full Code Here

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

    * @param rootPath
    * @return ItemDataChangesLog
    */
   public PlainChangesLog pushLog(QPath rootPath)
   {
      PlainChangesLog cLog = new PlainChangesLogImpl(sessionId);

      if (rootPath.equals(Constants.ROOT_PATH))
      {
         cLog.addAll(items);
         clear();
      }
      else
      {
         cLog.addAll(getDescendantsChanges(rootPath));
         remove(rootPath);
      }

      return cLog;
   }
View Full Code Here

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

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

      checkValid();

      PlainChangesLog changesLog = new PlainChangesLogImpl(session.getId());

      removeMergeFailed(version, changesLog);

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

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

      dataManager.update(state, false);

      // Should register jcr:mixinTypes and autocreated items if node is not added
      ItemAutocreator itemAutocreator = new ItemAutocreator(ntmanager, valueFactory, dataManager, false);

      PlainChangesLog changes =
         itemAutocreator.makeAutoCreatedItems(nodeData(), type.getName(), dataManager, session.getUserID());

      for (ItemState autoCreatedState : changes.getAllStates())
      {
         dataManager.update(autoCreatedState, false);
      }

      // launch event
View Full Code Here

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

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

      PlainChangesLog changesLog = new PlainChangesLogImpl(session.getId());

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

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

      if (dataManager.hasPendingChanges(getInternalPath()))
         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.getId(), 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.