Examples of CheckoutEntry


Examples of org.apache.lenya.cms.rc.CheckOutEntry

        Identity identity = (Identity) session.getAttribute(Identity.class
                .getName());

        if (step.equals("checkit")) {
            if (rcml.getLatestEntry().getType() != RCML.ci) {
                CheckOutEntry coe = rcml.getLatestCheckOutEntry();
                actionMap.put("user", coe.getIdentity());
                Date checkOutDate = new Date(coe.getTime());
                actionMap.put("date", checkOutDate.toString());
                actionMap.put("message", "lenya.rc.checkedoutalready");
                actionMap.put("state", "co");
            } else {
                CheckInEntry cie = rcml.getLatestCheckInEntry();
View Full Code Here

Examples of org.apache.lenya.cms.rc.CheckOutEntry

                version++;
            }
            entry = new CheckInEntry(sessionId, identity, time, version, backup);
            break;
        case RCML.co:
            entry = new CheckOutEntry(sessionId, identity, time);
            break;
        default:
            throw new IllegalArgumentException("No such type: [" + type + "]");
        }
View Full Code Here

Examples of org.apache.lenya.cms.rc.CheckOutEntry

                String versionString = element.getAttribute(ATTR_VERSION);
                int version = new Integer(versionString).intValue();
                boolean backup = element.hasAttribute(ATTR_BACKUP);
                return new CheckInEntry(sessionId, identity, time, version, backup);
            } else if (type.equals(ELEMENT_CHECKOUT)) {
                return new CheckOutEntry(sessionId, identity, time);
            } else {
                throw new RuntimeException("Unsupported RCML entry type: [" + type + "]");
            }
        } else {
            return getLegacyEntry(helper, element);
View Full Code Here

Examples of org.apache.lenya.cms.rc.CheckOutEntry

            String versionString = getChildValue(helper, element, ELEMENT_VERSION);
            int version = new Integer(versionString).intValue();
            boolean backup = helper.getChildren(element, ELEMENT_BACKUP).length > 0;
            return new CheckInEntry(sessionId, identity, time, version, backup);
        } else if (type.equals(ELEMENT_CHECKOUT)) {
            return new CheckOutEntry(sessionId, identity, time);
        } else {
            throw new RuntimeException("Unsupported RCML entry type: [" + type + "]");
        }
    }
View Full Code Here

Examples of org.apache.lenya.cms.rc.CheckOutEntry

            for (Iterator i = otherEntries.iterator(); i.hasNext();) {
                RCMLEntry entry = (RCMLEntry) i.next();
                RCMLEntry newEntry = null;
                switch (entry.getType()) {
                case co:
                    newEntry = new CheckOutEntry(entry.getSessionId(), entry.getIdentity(), entry
                            .getTime());
                    break;
                case ci:
                    CheckInEntry ciEntry = (CheckInEntry) entry;
                    newEntry = new CheckInEntry(ciEntry.getSessionId(), ciEntry.getIdentity(),
View Full Code Here

Examples of org.eclipse.jgit.lib.CheckoutEntry

    setupReflog("logs/HEAD", switchBranch);
    List<ReflogEntry> entries = db.getReflogReader(Constants.HEAD)
        .getReverseEntries();
    assertEquals(1, entries.size());
    ReflogEntry entry = entries.get(0);
    CheckoutEntry checkout = entry.parseCheckout();
    assertNotNull(checkout);
    assertEquals("master", checkout.getToBranch());
    assertEquals("new/work", checkout.getFromBranch());
  }
View Full Code Here

Examples of org.eclipse.jgit.lib.CheckoutEntry

        ReflogReader reflogReader = repository.getReflogReader(Constants.HEAD);
        if (reflogReader != null) {
          List<ReflogEntry> lastEntry = reflogReader.getReverseEntries();
          for (ReflogEntry entry : lastEntry) {
            if (entry.getNewId().name().equals(commitId)) {
              CheckoutEntry checkoutEntry = entry.parseCheckout();
              if (checkoutEntry != null) {
                Ref ref = repository.getRef(checkoutEntry.getToBranch());
                if (ref != null) {
                  if (ref.getObjectId().getName()
                      .equals(commitId))
                    return checkoutEntry.getToBranch();
                  ref = repository.peel(ref);
                }
                if (ref != null) {
                  ObjectId id = ref.getPeeledObjectId();
                  if (id != null && id.getName().equals(commitId))
                    return checkoutEntry.getToBranch();
                }
              }
            }
          }
        }
View Full Code Here

Examples of org.eclipse.jgit.lib.CheckoutEntry

      // Add the MAX_NUM_MENU_ENTRIES most recently used branches first
      List<ReflogEntry> reflogEntries = repository.getReflogReader(
          Constants.HEAD).getReverseEntries();
      for (ReflogEntry entry : reflogEntries) {
        CheckoutEntry checkout = entry.parseCheckout();
        if (checkout != null) {
          Ref ref = localBranches.get(checkout.getFromBranch());
          if (ref != null)
            if (sortedRefs.size() < MAX_NUM_MENU_ENTRIES)
              sortedRefs.put(checkout.getFromBranch(), ref);
          ref = localBranches.get(checkout.getToBranch());
          if (ref != null)
            if (sortedRefs.size() < MAX_NUM_MENU_ENTRIES)
              sortedRefs.put(checkout.getToBranch(), ref);
        }
      }

      // Add the recently used branches to the menu, in alphabetical order
      int itemCount = 0;
View Full Code Here

Examples of org.eclipse.jgit.storage.file.CheckoutEntry

  private String resolveReflogCheckout(int checkoutNo)
      throws IOException {
    List<ReflogEntry> reflogEntries = new ReflogReader(this, Constants.HEAD)
        .getReverseEntries();
    for (ReflogEntry entry : reflogEntries) {
      CheckoutEntry checkout = entry.parseCheckout();
      if (checkout != null)
        if (checkoutNo-- == 1)
          return checkout.getFromBranch();
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.jgit.storage.file.CheckoutEntry

  private String resolveReflogCheckout(int checkoutNo)
      throws IOException {
    List<ReflogEntry> reflogEntries = new ReflogReader(this, Constants.HEAD)
        .getReverseEntries();
    for (ReflogEntry entry : reflogEntries) {
      CheckoutEntry checkout = entry.parseCheckout();
      if (checkout != null)
        if (checkoutNo-- == 1)
          return checkout.getFromBranch();
    }
    return 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.