public NSArray scolMaquetteRepartitionAps(
      EOQualifier qualifier, NSArray sortOrderings, boolean fetch) {
    NSArray results;
    if (fetch) {
      EOQualifier fullQualifier;
      EOQualifier inverseQualifier =
          new EOKeyValueQualifier(
              org.cocktail.groupescol.client.eof.ScolMaquetteRepartitionAp.SCOL_MAQUETTE_AP_KEY,
              EOQualifier.QualifierOperatorEqual,
              this);

      if (qualifier == null) {
        fullQualifier = inverseQualifier;
      } else {
        NSMutableArray qualifiers = new NSMutableArray();
        qualifiers.addObject(qualifier);
        qualifiers.addObject(inverseQualifier);
        fullQualifier = new EOAndQualifier(qualifiers);
      }

      results =
          org.cocktail.groupescol.client.eof.ScolMaquetteRepartitionAp
              .fetchScolMaquetteRepartitionAps(editingContext(), fullQualifier, sortOrderings);
    } else {
      results = scolMaquetteRepartitionAps();
      if (qualifier != null) {
        results = (NSArray) EOQualifier.filteredArrayWithQualifier(results, qualifier);
      }
      if (sortOrderings != null) {
        results = (NSArray) EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
      }
    }
    return results;
  }
Exemplo n.º 2
0
  public NSArray salless(EOQualifier qualifier, NSArray sortOrderings, boolean fetch) {
    NSArray results;
    if (fetch) {
      EOQualifier fullQualifier;
      EOQualifier inverseQualifier =
          new EOKeyValueQualifier(
              org.cocktail.superplan.server.metier.Salles.LOCAL_KEY,
              EOQualifier.QualifierOperatorEqual,
              this);

      if (qualifier == null) {
        fullQualifier = inverseQualifier;
      } else {
        NSMutableArray qualifiers = new NSMutableArray();
        qualifiers.addObject(qualifier);
        qualifiers.addObject(inverseQualifier);
        fullQualifier = new EOAndQualifier(qualifiers);
      }

      results =
          org.cocktail.superplan.server.metier.Salles.fetchSalleses(
              editingContext(), fullQualifier, sortOrderings);
    } else {
      results = salless();
      if (qualifier != null) {
        results = (NSArray) EOQualifier.filteredArrayWithQualifier(results, qualifier);
      }
      if (sortOrderings != null) {
        results = (NSArray) EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
      }
    }
    return results;
  }
Exemplo n.º 3
0
  public NSArray<org.pachyderm.foundation.eof.PDBScreen> everyScreen(
      EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings, boolean fetch) {
    NSArray<org.pachyderm.foundation.eof.PDBScreen> results;
    if (fetch) {
      EOQualifier fullQualifier;
      EOQualifier inverseQualifier =
          ERXQ.equals(org.pachyderm.foundation.eof.PDBScreen.PRESENTATION_KEY, this);

      if (qualifier == null) {
        fullQualifier = inverseQualifier;
      } else {
        fullQualifier = ERXQ.and(qualifier, inverseQualifier);
      }

      results =
          org.pachyderm.foundation.eof.PDBScreen.fetchPDBScreens(
              editingContext(), fullQualifier, sortOrderings);
    } else {
      results = everyScreen();
      if (qualifier != null) {
        results =
            (NSArray<org.pachyderm.foundation.eof.PDBScreen>)
                EOQualifier.filteredArrayWithQualifier(results, qualifier);
      }
      if (sortOrderings != null) {
        results =
            (NSArray<org.pachyderm.foundation.eof.PDBScreen>)
                EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
      }
    }
    return results;
  }
Exemplo n.º 4
0
  public NSArray repartValidations(EOQualifier qualifier, NSArray sortOrderings, boolean fetch) {
    NSArray results;
    if (fetch) {
      EOQualifier fullQualifier;
      EOQualifier inverseQualifier =
          new EOKeyValueQualifier(
              fr.univlr.cri.conges.eos.modele.conges.EORepartValidation.OCCUPATION_KEY,
              EOQualifier.QualifierOperatorEqual,
              this);

      if (qualifier == null) {
        fullQualifier = inverseQualifier;
      } else {
        NSMutableArray qualifiers = new NSMutableArray();
        qualifiers.addObject(qualifier);
        qualifiers.addObject(inverseQualifier);
        fullQualifier = new EOAndQualifier(qualifiers);
      }

      results =
          fr.univlr.cri.conges.eos.modele.conges.EORepartValidation.fetchRepartValidations(
              editingContext(), fullQualifier, sortOrderings);
    } else {
      results = repartValidations();
      if (qualifier != null) {
        results = (NSArray) EOQualifier.filteredArrayWithQualifier(results, qualifier);
      }
      if (sortOrderings != null) {
        results = (NSArray) EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
      }
    }
    return results;
  }
Exemplo n.º 5
0
  public NSArray tosIntervention(EOQualifier qualifier, NSArray sortOrderings, boolean fetch) {
    NSArray results;
    if (fetch) {
      EOQualifier fullQualifier;
      EOQualifier inverseQualifier =
          new EOKeyValueQualifier(
              org.cocktail.dt.server.metier.EOIntervention.TO_ACTIVITES_KEY,
              EOQualifier.QualifierOperatorEqual,
              this);

      if (qualifier == null) {
        fullQualifier = inverseQualifier;
      } else {
        NSMutableArray qualifiers = new NSMutableArray();
        qualifiers.addObject(qualifier);
        qualifiers.addObject(inverseQualifier);
        fullQualifier = new EOAndQualifier(qualifiers);
      }

      results =
          org.cocktail.dt.server.metier.EOIntervention.fetchAll(
              editingContext(), fullQualifier, sortOrderings);
    } else {
      results = tosIntervention();
      if (qualifier != null) {
        results = (NSArray) EOQualifier.filteredArrayWithQualifier(results, qualifier);
      }
      if (sortOrderings != null) {
        results = (NSArray) EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
      }
    }
    return results;
  }
Exemplo n.º 6
0
 public NSArray repartStructures(EOQualifier qualifier, NSArray sortOrderings) {
   NSArray results;
   results = repartStructures();
   if (qualifier != null) {
     results = (NSArray) EOQualifier.filteredArrayWithQualifier(results, qualifier);
   }
   if (sortOrderings != null) {
     results = (NSArray) EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
   }
   return results;
 }
Exemplo n.º 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));
 }
Exemplo n.º 8
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;
  }
Exemplo n.º 9
0
  public NSArray sortedCriteriaList() {
    if (_sortedArray == null) {
      _sortedArrayBase = EOSortOrdering.sortedArrayUsingKeyOrderArray(criteriaList(), _ordering);
      NSMutableArray sortedArray2 = new NSMutableArray(_sortedArrayBase);
      sortedArray2.addObject(DRCriteria.asTotalWithMasterCriteria(_masterCriteria));
      _sortedArray = new NSArray(sortedArray2);
    }

    if (_useGroupTotal) {
      return _sortedArray;
    }

    return _sortedArrayBase;
  }
 public NSArray<er.sync.eo.ERSyncClientApp> applications(
     EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings) {
   NSArray<er.sync.eo.ERSyncClientApp> results;
   results = applications();
   if (qualifier != null) {
     results =
         (NSArray<er.sync.eo.ERSyncClientApp>)
             EOQualifier.filteredArrayWithQualifier(results, qualifier);
   }
   if (sortOrderings != null) {
     results =
         (NSArray<er.sync.eo.ERSyncClientApp>)
             EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
   }
   return results;
 }
Exemplo n.º 11
0
 public NSArray<er.rbac.eof.ERPrivilege> privileges(
     EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings) {
   NSArray<er.rbac.eof.ERPrivilege> results;
   results = privileges();
   if (qualifier != null) {
     results =
         (NSArray<er.rbac.eof.ERPrivilege>)
             EOQualifier.filteredArrayWithQualifier(results, qualifier);
   }
   if (sortOrderings != null) {
     results =
         (NSArray<er.rbac.eof.ERPrivilege>)
             EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
   }
   return results;
 }
Exemplo n.º 12
0
  public NSArray<edu.umich.marketplace.eof.Advert> adverts(
      EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings, boolean fetch) {
    NSArray<edu.umich.marketplace.eof.Advert> results;
    if (fetch) {
      EOQualifier fullQualifier;
      EOQualifier inverseQualifier =
          new EOKeyValueQualifier(
              edu.umich.marketplace.eof.Advert.CATEGORY_KEY,
              EOQualifier.QualifierOperatorEqual,
              this);

      if (qualifier == null) {
        fullQualifier = inverseQualifier;
      } else {
        NSMutableArray qualifiers = new NSMutableArray();
        qualifiers.addObject(qualifier);
        qualifiers.addObject(inverseQualifier);
        fullQualifier = new EOAndQualifier(qualifiers);
      }

      results =
          edu.umich.marketplace.eof.Advert.fetchAdverts(
              editingContext(), fullQualifier, sortOrderings);
    } else {
      results = adverts();
      if (qualifier != null) {
        results =
            (NSArray<edu.umich.marketplace.eof.Advert>)
                EOQualifier.filteredArrayWithQualifier(results, qualifier);
      }
      if (sortOrderings != null) {
        results =
            (NSArray<edu.umich.marketplace.eof.Advert>)
                EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
      }
    }
    return results;
  }
  public NSArray<er.sync.eo.ERSyncPrincipal> principals(
      EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings, boolean fetch) {
    NSArray<er.sync.eo.ERSyncPrincipal> results;
    if (fetch) {
      EOQualifier fullQualifier;
      EOQualifier inverseQualifier =
          new EOKeyValueQualifier(
              er.sync.eo.ERSyncPrincipal.DEVICE_TYPE_KEY, EOQualifier.QualifierOperatorEqual, this);

      if (qualifier == null) {
        fullQualifier = inverseQualifier;
      } else {
        NSMutableArray qualifiers = new NSMutableArray();
        qualifiers.addObject(qualifier);
        qualifiers.addObject(inverseQualifier);
        fullQualifier = new EOAndQualifier(qualifiers);
      }

      results =
          er.sync.eo.ERSyncPrincipal.fetchERSyncPrincipals(
              editingContext(), fullQualifier, sortOrderings);
    } else {
      results = principals();
      if (qualifier != null) {
        results =
            (NSArray<er.sync.eo.ERSyncPrincipal>)
                EOQualifier.filteredArrayWithQualifier(results, qualifier);
      }
      if (sortOrderings != null) {
        results =
            (NSArray<er.sync.eo.ERSyncPrincipal>)
                EOSortOrdering.sortedArrayUsingKeyOrderArray(results, sortOrderings);
      }
    }
    return results;
  }
Exemplo n.º 14
0
 /**
  * Takes an unordered set and creates a sorted array from its elements.
  *
  * @param <T> type of set contents
  * @param set the set containing the elements to sort
  * @param orderings the sort orderings
  * @return an array with sorted elements
  */
 public static <T> NSArray<T> sortedArrayFromSet(NSSet<T> set, NSArray<EOSortOrdering> orderings) {
   return EOSortOrdering.sortedArrayUsingKeyOrderArray(set.allObjects(), orderings);
 }