コード例 #1
0
ファイル: RuleEditor.java プロジェクト: hypeastrum/wonder
 public void setRuleFileName(String value) {
   fileName = value;
   model = new ERD2WRuleEditorModel(new File(fileName));
   group = new WODisplayGroup();
   group.setObjectArray(model.publicRules());
   group.setDefaultStringMatchFormat("*%@*");
 }
コード例 #2
0
ファイル: CustomerIssues.java プロジェクト: avoy/Tracker
  public void initCustomerIssues() {
    EOFetchSpecification fs;
    NSDictionary bindings = null;
    Session s = (Session) session();
    NSMutableArray qual = new NSMutableArray();
    NSMutableArray qual1 = new NSMutableArray();
    EOQualifier qualifier;

    // 'Open items'
    // qual.addObject(EOQualifier.qualifierWithQualifierFormat("bugStatus !='CLOSED'", null));
    // qual.addObject(EOQualifier.qualifierWithQualifierFormat("bugStatus !='RESOLVED'", null));
    // qual.addObject(EOQualifier.qualifierWithQualifierFormat("bugStatus !='VERIFIED'", null));

    // Taser
    qual1.addObject(EOQualifier.qualifierWithQualifierFormat("type = 'Prospect'", null));
    qual1.addObject(EOQualifier.qualifierWithQualifierFormat("type = 'Customer'", null));
    qual.addObject(new EOOrQualifier(qual1));

    // Single Customer
    if (customerId() != null) {
      qual.addObject(EOQualifier.qualifierWithQualifierFormat("bugId=" + customerId(), null));
      showProductSelector = true;
    } else {
      // Products
      if (selectedProducts.count() == 1) {
        if (selectedProducts.contains("Trusted Access")) {
          qual.addObject(
              EOQualifier.qualifierWithQualifierFormat(
                  "product.productName = 'Device: Trusted Access'", null));
        } else if (selectedProducts.contains("Secure Storage")) {
          qual.addObject(
              EOQualifier.qualifierWithQualifierFormat(
                  "product.productName = 'Device: Secure Storage'", null));
        }
      }
    }

    Object orderings[] = {
      EOSortOrdering.sortOrderingWithKey("version", EOSortOrdering.CompareAscending),
      EOSortOrdering.sortOrderingWithKey("targetMilestone", EOSortOrdering.CompareAscending),
      EOSortOrdering.sortOrderingWithKey(
          "priority", EOSortOrdering.CompareCaseInsensitiveAscending),
      EOSortOrdering.sortOrderingWithKey(
          "bugSeverity", EOSortOrdering.CompareCaseInsensitiveAscending),
    };

    fs = new EOFetchSpecification("Item", new EOAndQualifier(qual), new NSArray(orderings));
    fs.setRefreshesRefetchedObjects(true);

    ((EODatabaseDataSource) customerIssueDisplayGroup.dataSource()).setFetchSpecification(fs);
    customerIssueDisplayGroup.fetch();
  }
コード例 #3
0
 public int filteredObjectsCount() {
   WODisplayGroup dg = displayGroup();
   if (dg instanceof ERXDisplayGroup) {
     ERXDisplayGroup erxdg = (ERXDisplayGroup) dg;
     return erxdg.filteredObjects().count();
   }
   int result = 0;
   EOQualifier q = dg.qualifier();
   if (q != null) {
     result = EOQualifier.filteredArrayWithQualifier(dg.allObjects(), q).count();
   } else {
     result = dg.allObjects().count();
   }
   return result;
 }
コード例 #4
0
ファイル: RuleEditor.java プロジェクト: hypeastrum/wonder
 public WOComponent deleteRule() {
   Rule oldRule = selectedRule();
   setSelectedRule(currentRule);
   group.delete();
   setSelectedRule(oldRule);
   return null;
 }
コード例 #5
0
ファイル: RuleEditor.java プロジェクト: hypeastrum/wonder
 public WOComponent addRule() {
   ERD2WExtendedRule rule = new ERD2WExtendedRule();
   rule.setAuthor(50);
   rule.setRhs(new Assignment("test", null));
   group.insertObjectAtIndex(rule, 0);
   setSelectedRule(rule);
   return null;
 }
コード例 #6
0
ファイル: CustomerIssues.java プロジェクト: avoy/Tracker
  public void invalidateChildren() {
    /*
    Enumeration enumer = customerIssueDisplayGroup.allObjects().objectEnumerator();
          while(enumer.hasMoreElements()) {
              Item tempEo = (Item)enumer.nextElement();
    	tempEo.invalidateAllChildren();

          }
    */
    invalidateObjects(customerIssueDisplayGroup.allObjects());
  }
コード例 #7
0
ファイル: CustomerIssues.java プロジェクト: avoy/Tracker
  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;
  }
コード例 #8
0
ファイル: ReportListWrapper.java プロジェクト: avoy/Tracker
 public int listSize() {
   return displayGroup.allObjects().count();
 }
コード例 #9
0
ファイル: RuleEditor.java プロジェクト: hypeastrum/wonder
 public void setSelectedRule(Rule rule) {
   group.setSelectedObject(rule);
   qualifier = rule.lhs();
   qualifierString = null;
 }
コード例 #10
0
ファイル: RuleEditor.java プロジェクト: hypeastrum/wonder
 public Rule selectedRule() {
   return (Rule) group.selectedObject();
 }
コード例 #11
0
ファイル: RuleEditor.java プロジェクト: hypeastrum/wonder
 public WOComponent cloneRule() {
   currentRule = currentRule.cloneRule();
   group.insertObjectAtIndex(currentRule, 0);
   setSelectedRule(currentRule);
   return null;
 }