Examples of HistoryEntry


Examples of de.micromata.hibernate.history.HistoryEntry

        group = groupDao.getById(id);
        assertEquals(2, group.getAssignedUsers().size());

        HistoryEntry[] historyEntries = groupDao.getHistoryEntries(group);
        assertEquals(3, historyEntries.length);
        HistoryEntry entry = historyEntries[2];
        assertHistoryEntry(entry, group.getId(), histUser, HistoryEntryType.INSERT);
        entry = historyEntries[1];
        assertHistoryEntry(entry, group.getId(), histUser, HistoryEntryType.UPDATE, "assignedUsers", PFUserDO.class, getUser(TEST_USER2)
            .getId().toString(), "");
        entry = historyEntries[0];
View Full Code Here

Examples of de.micromata.hibernate.history.HistoryEntry

      public Object doInTransaction(final TransactionStatus status)
      {
        // Checking history entries of user for new group:
        HistoryEntry[] historyEntries = userDao.getHistoryEntries(getUser("UserTest.historyUser1a"));
        assertEquals(2, historyEntries.length); // insert and update assignedGroups
        final HistoryEntry entry = historyEntries[0]; // Update assignedGroups entry
        assertEquals(1, entry.getDelta().size());
        assertEquals("", entry.getDelta().get(0).getOldValue());
        assertGroupIds(new String[] { "UserTest.historyGroup1"}, entry.getDelta().get(0).getNewValue());

        // Checking history entries of new group:
        historyEntries = groupDao.getHistoryEntries(getGroup("UserTest.historyGroup1"));
        assertEquals(1, historyEntries.length); // insert
        return null;
View Full Code Here

Examples of de.micromata.hibernate.history.HistoryEntry

    final Integer id = a1.getId();
    a1.setName("History 2");
    contactDao.update(a1);
    HistoryEntry[] historyEntries = contactDao.getHistoryEntries(a1);
    assertEquals(2, historyEntries.length);
    HistoryEntry entry = historyEntries[0];
    log.debug(entry);
    assertHistoryEntry(entry, id, user, HistoryEntryType.UPDATE, "name", String.class, "History test", "History 2");
    entry = historyEntries[1];
    log.debug(entry);
    assertHistoryEntry(entry, id, user, HistoryEntryType.INSERT, null, null, null, null);

    a1.setTask(getTask("1.2"));
    contactDao.update(a1);
    historyEntries = contactDao.getHistoryEntries(a1);
    assertEquals(3, historyEntries.length);
    entry = historyEntries[0];
    log.debug(entry);
    assertHistoryEntry(entry, id, user, HistoryEntryType.UPDATE, "task", TaskDO.class, getTask("1.1").getId(), getTask("1.2").getId());

    a1.setTask(getTask("1.1"));
    a1.setName("History test");
    contactDao.update(a1);
    historyEntries = contactDao.getHistoryEntries(a1);
    assertEquals(4, historyEntries.length);
    entry = historyEntries[0];
    log.debug(entry);
    assertHistoryEntry(entry, id, user, HistoryEntryType.UPDATE, null, null, null, null);
    final List<PropertyDelta> delta = entry.getDelta();
    assertEquals(2, delta.size());
    for (int i = 0; i < 2; i++) {
      final PropertyDelta prop = delta.get(0);
      if ("name".equals(prop.getPropertyName()) == true) {
        assertPropertyDelta(prop, "name", String.class, "History 2", "History test");
View Full Code Here

Examples of org.eclipse.core.internal.localstore.HistoryBucket.HistoryEntry

  public synchronized IFileState[] getStates(IPath filePath, IProgressMonitor monitor) {
    try {
      tree.loadBucketFor(filePath);
      HistoryBucket currentBucket = (HistoryBucket) tree.getCurrent();
      HistoryEntry fileEntry = currentBucket.getEntry(filePath);
      if (fileEntry == null || fileEntry.isEmpty())
        return new IFileState[0];
      IFileState[] states = new IFileState[fileEntry.getOccurrences()];
      for (int i = 0; i < states.length; i++)
        states[i] = new FileState(this, fileEntry.getPath(), fileEntry.getTimestamp(i), fileEntry.getUUID(i));
      return states;
    } catch (CoreException ce) {
      log(ce);
      return new IFileState[0];
    }
View Full Code Here

Examples of org.eclipse.core.internal.localstore.HistoryBucket.HistoryEntry

    private void saveChanges() throws CoreException {
      if (changes.isEmpty())
        return;
      // make effective all changes collected
      Iterator i = changes.iterator();
      HistoryEntry entry = (HistoryEntry) i.next();
      tree.loadBucketFor(entry.getPath());
      HistoryBucket bucket = (HistoryBucket) tree.getCurrent();
      bucket.addBlobs(entry);
      while (i.hasNext())
        bucket.addBlobs((HistoryEntry) i.next());
      bucket.save();
View Full Code Here

Examples of org.eclipse.core.internal.localstore.HistoryBucket.HistoryEntry

      bucket.save();
    }

    public int visit(Entry sourceEntry) {
      IPath destinationPath = destination.append(sourceEntry.getPath().removeFirstSegments(source.segmentCount()));
      HistoryEntry destinationEntry = new HistoryEntry(destinationPath, (HistoryEntry) sourceEntry);
      // we may be copying to the same source bucket, collect to make change effective later
      // since we cannot make changes to it while iterating
      changes.add(destinationEntry);
      return CONTINUE;
    }
View Full Code Here

Examples of org.olat.core.gui.control.history.HistoryEntry

   * @param componentTimestamp
   * @return -1 for back, 1 for forward, 0 for nothing/reload
   */
  private int findInHistory(UserRequest ureq) {
    for (int i = historyPos-1; i>=0; i--) {
      HistoryEntry he = history.get(i);
      if (he.isSame(ureq)) {
        // found "left" to the current position = left in time = back
        historyPos = i; // make ready for future comparisons
        return -1;
      }
    }
    // not found -> check forward
    int size = history.size();
    for (int i = historyPos+1; i<size; i++) {
      HistoryEntry he = history.get(i);
      if (he.isSame(ureq)) {
        // found "right" to the current position = right in time = forward
        historyPos = i; // make ready for future comparisons
        return 1;
      }
    }
View Full Code Here

Examples of org.olat.core.gui.control.history.HistoryEntry

      // add the new URL to the browser history, but not if the klick resulted in a new browser window (a href .. target=...) or in a download (excel or such)
      DispatchResult dr = ureq.getDispatchResult();
      MediaResource tMr = dr.getResultingMediaResource();
      Window tWin = dr.getResultingWindow();
      if (tMr == null && tWin == null) {
        addToHistory(new HistoryEntry(ureq));
      }
      wbackofficeImpl.fireCycleEvent(END_OF_DISPATCH_CYCLE);
     
     
      // if loglevel is set accordingly, collect anonymous controller usage statistics.
View Full Code Here

Examples of org.opensolaris.opengrok.history.HistoryEntry

        }

        int matchedLines = 0;
        Iterator<HistoryEntry> it = in.getHistoryEntries().iterator();
        try {
            HistoryEntry he;
            HistoryEntry nhe=null;
            String nrev;
            while(( it.hasNext()||(nhe!=null) ) && matchedLines < 10) {
                if (nhe==null) { he=it.next(); }
                else { he=nhe; } //nhe is the lookahead revision
                String line = he.getLine();
                String rev = he.getRevision();
                if (it.hasNext()) { nhe=it.next()} //this prefetch mechanism is here because of the diff link generation
                                    // we currently generate the diff to previous revision
                else {nhe=null;}
                if (nhe==null) { nrev=null; }
                else { nrev=nhe.getRevision(); }
                tokens.reInit(line);
                String token;
                int matchState;
                int start = -1;
                while ((token = tokens.next()) != null) {
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.