Beispiel #1
0
  public NSArray customerIssues() {
    NSMutableArray allChildren = new NSMutableArray();
    NSMutableArray qual = new NSMutableArray();
    Item customer;
    Item child;

    if (customerIssues == null) {

      if (bugId() != null) {
        qual.addObject(EOQualifier.qualifierWithQualifierFormat("bugId=" + bugId(), null));
        EOFetchSpecification spec =
            new EOFetchSpecification("Item", new EOAndQualifier(qual), null);

        // Perform actual fetch
        customerIssues =
            (NSArray) session().defaultEditingContext().objectsWithFetchSpecification(spec);

      } else {

        Enumeration enumer = ((NSArray) customerIssueDisplayGroup.allObjects()).objectEnumerator();
        // For each Customer
        while (enumer.hasMoreElements()) {
          customer = (Item) enumer.nextElement();
          NSArray children = (NSArray) customer.valueForKey("allChildren");

          // Add all of their issues (if they haven't been added already
          Enumeration enumer2 = children.objectEnumerator();
          while (enumer2.hasMoreElements()) {
            child = (Item) enumer2.nextElement();
            if (!allChildren.contains(child)) {
              allChildren.addObject(child);
            }
          }
        }
        Object orderings[] = {
          EOSortOrdering.sortOrderingWithKey("version", EOSortOrdering.CompareAscending),
          EOSortOrdering.sortOrderingWithKey("targetMilestone", EOSortOrdering.CompareAscending),
          EOSortOrdering.sortOrderingWithKey(
              "priority", EOSortOrdering.CompareCaseInsensitiveAscending),
          EOSortOrdering.sortOrderingWithKey(
              "bugSeverity", EOSortOrdering.CompareCaseInsensitiveAscending),
        };

        // Sort the issues
        customerIssues =
            EOSortOrdering.sortedArrayUsingKeyOrderArray(allChildren, new NSArray(orderings));
      }
    }
    return customerIssues;
  }
Beispiel #2
0
 public NSArray itemsWithMultipleParents() {
   if (itemsWithMultipleParents == null) {
     NSMutableArray temp = new NSMutableArray();
     Enumeration enumer = customerIssues().objectEnumerator();
     while (enumer.hasMoreElements()) {
       Item taserIssue = (Item) enumer.nextElement();
       NSArray parents =
           (NSArray) taserIssue.topMostParents(); // will get some non-taser parents.
       if ((parents != null) && (parents.count() > 1)) {
         temp.addObject(taserIssue);
       }
     }
     itemsWithMultipleParents = new NSArray(temp);
   }
   return itemsWithMultipleParents;
 }
Beispiel #3
0
  public WOComponent goIssueView() {
    setIsCustomerView(false);
    showProductSelector = false;
    setBugId("" + anItem.bugId());
    customerIssues = null;

    return null;
  }
Beispiel #4
0
  public NSArray topMostTaserParents() {
    Enumeration enumer = anItem.topMostParents().objectEnumerator();
    NSMutableArray temp = new NSMutableArray();
    // System.out.println("Item - " + anItem.valueForKey("bugId")  + " - " + anItem.shortDesc());

    while (enumer.hasMoreElements()) {
      Item tempEo = (Item) enumer.nextElement();
      // System.out.println("\t\tparentA - " + tempEo.bugId() + " - " + tempEo.shortDesc());

      if ((tempEo.type().equals("Prospect")) || (tempEo.type().equals("Customer"))) {
        temp.addObject(tempEo);

        // System.out.println("\t\tparentB - " + tempEo.bugId() + " - " + tempEo.shortDesc());
      }
    }
    return temp;
  }
Beispiel #5
0
 public String cleanDescription() {
   int index = 0;
   String returnVal = (String) anIssue.valueForKey("shortDesc");
   boolean hasPrefix = returnVal.startsWith("TASER EVAL: ");
   // System.out.println("index - " + index);
   if (hasPrefix == true) {
     index = 12;
   }
   return returnVal.substring(index);
 }
Beispiel #6
0
  public void invalidateObjects(NSArray pObjects) {
    // System.out.println("ReleasePlan.invalidateObjects()");

    // Invalidate Objects
    if (pObjects != null) {
      // System.out.println("ReleasePlan.invalidateObjects() - 2");

      Enumeration enumer = pObjects.objectEnumerator();
      NSMutableArray temp = new NSMutableArray();
      while (enumer.hasMoreElements()) {
        Item i = (Item) enumer.nextElement();
        i.invalidateAllChildren();
        EOGlobalID id = (EOGlobalID) (session().defaultEditingContext().globalIDForObject(i));
        if (id != null) {
          temp.addObject(id);
        }
      }
      session().defaultEditingContext().invalidateObjectsWithGlobalIDs((NSArray) temp);
    }
  }
Beispiel #7
0
 public NSArray sortedClosedChildren() {
   Object orderings[] = {
     EOSortOrdering.sortOrderingWithKey("version", EOSortOrdering.CompareAscending),
     EOSortOrdering.sortOrderingWithKey("targetMilestone", EOSortOrdering.CompareAscending),
     EOSortOrdering.sortOrderingWithKey(
         "priority", EOSortOrdering.CompareCaseInsensitiveAscending),
     EOSortOrdering.sortOrderingWithKey(
         "bugSeverity", EOSortOrdering.CompareCaseInsensitiveAscending),
   };
   return EOSortOrdering.sortedArrayUsingKeyOrderArray(
       (NSArray) anIssue.valueForKey("closedChildren"), new NSArray(orderings));
 }
Beispiel #8
0
  public String filteredRelease() {
    String returnVal;

    String actualRelease = (String) anItem.valueForKey("version");
    if (actualRelease.equals("_Backlog")) {
      returnVal = "Uncommitted";
    } else if (actualRelease.equals("Proposed for the next release")) {
      returnVal = "Proposed";
    } else {
      returnVal = actualRelease;
    }

    return returnVal;
  }
Beispiel #9
0
 public boolean isP1() {
   return (((String) anIssue.valueForKey("priority")).equals("1 - Urgent")) ? true : false;
 }
Beispiel #10
0
 public String bugURL() {
   return ((Application) Application.application()).bugzillaHostUrl()
       + "/show_bug.cgi?id="
       + anItem.valueForKey("bugId");
 }
Beispiel #11
0
 public String timeSinceModified() {
   return elapsedTimeSimple((NSTimestamp) anItem.valueForKey("lastdiffed"), today);
 }
Beispiel #12
0
 public String timeSinceOpened() {
   return elapsedTimeSimple((NSTimestamp) anItem.valueForKey("creationTs"), today);
 }