Example #1
0
    /**
     * Overriden to contruct a valid SQL92 JOIN clause as opposed to the Oracle-like SQL the
     * superclass produces.
     *
     * <p>kieran copied from PostgresqlExpression
     */
    @Override
    public String joinClauseString() {
      NSMutableDictionary<String, Boolean> seenIt = new NSMutableDictionary<String, Boolean>();
      StringBuilder sb = new StringBuilder();
      JoinClauseDefinition jc;
      EOSortOrdering.sortArrayUsingKeyOrderArray(
          _alreadyJoined,
          new NSArray<EOSortOrdering>(
              EOSortOrdering.sortOrderingWithKey("sortKey", EOSortOrdering.CompareAscending)));
      if (_alreadyJoined.count() > 0) {
        jc = _alreadyJoined.objectAtIndex(0);

        sb.append(jc);
        seenIt.setObjectForKey(Boolean.TRUE, jc._table1);
        seenIt.setObjectForKey(Boolean.TRUE, jc._table2);
      }

      for (int i = 1; i < _alreadyJoined.count(); i++) {
        jc = _alreadyJoined.objectAtIndex(i);

        sb.append(jc._op);
        if (seenIt.objectForKey(jc._table1) == null) {
          sb.append(jc._table1);
          seenIt.setObjectForKey(Boolean.TRUE, jc._table1);
        } else if (seenIt.objectForKey(jc._table2) == null) {
          sb.append(jc._table2);
          seenIt.setObjectForKey(Boolean.TRUE, jc._table2);
        }
        sb.append(jc._joinCondition);
      }
      return sb.toString();
    }
Example #2
0
  public static void sendCommandInstancesToWotaskds(
      String command, NSArray instanceArray, NSArray wotaskdArray, WOTaskdHandler collector) {
    if (instanceArray.count() > 0 && wotaskdArray.count() > 0) {
      int instanceCount = instanceArray.count();

      NSMutableDictionary monitorRequest = new NSMutableDictionary(1);
      NSMutableArray commandWotaskd = new NSMutableArray(instanceArray.count() + 1);

      commandWotaskd.addObject(command);

      for (int i = 0; i < instanceCount; i++) {
        MInstance anInst = (MInstance) instanceArray.objectAtIndex(i);
        commandWotaskd.addObject(
            new NSDictionary(
                new Object[] {
                  anInst.applicationName(), anInst.id(), anInst.hostName(), anInst.port()
                },
                commandInstanceKeys));
      }
      monitorRequest.takeValueForKey(commandWotaskd, "commandWotaskd");

      WOResponse[] responses = collector.sendRequest(monitorRequest, wotaskdArray, false);
      NSDictionary[] responseDicts = collector.generateResponseDictionaries(responses);
      if (NSLog.debugLoggingAllowedForLevelAndGroups(
          NSLog.DebugLevelDetailed, NSLog.DebugGroupDeployment)) {
        NSLog.debug.appendln(
            "OUT: "
                + NSPropertyListSerialization.stringFromPropertyList(monitorRequest)
                + "\n\nIN: "
                + NSPropertyListSerialization.stringFromPropertyList(new NSArray(responseDicts)));
      }
      collector.getCommandErrors(responseDicts);
    }
  }
Example #3
0
  protected NSMutableArray getQueryErrors(NSDictionary[] responseDicts) {
    NSMutableArray errorArray = new NSMutableArray();

    for (int i = 0; i < responseDicts.length; i++) {
      if (responseDicts[i] != null) {
        NSDictionary responseDict = responseDicts[i];
        getGlobalErrorFromResponse(responseDict, errorArray);

        NSArray commandWotaskdResponse =
            (NSArray) responseDict.valueForKey("commandWotaskdResponse");
        if ((commandWotaskdResponse != null) && (commandWotaskdResponse.count() > 0)) {
          int count = commandWotaskdResponse.count();
          for (int j = 1; j < count; j++) {
            NSDictionary aDict = (NSDictionary) commandWotaskdResponse.objectAtIndex(j);
            String errorMessage = (String) aDict.valueForKey("errorMessage");
            if (errorMessage != null) {
              errorArray.addObject(errorMessage);
              if (j == 0) break; // the command produced an error,
              // parsing didn't finish
            }
          }
        }
      }
    }
    if (NSLog.debugLoggingAllowedForLevelAndGroups(
        NSLog.DebugLevelDetailed, NSLog.DebugGroupDeployment))
      NSLog.debug.appendln("##### getQueryErrors: " + errorArray);
    mySession().addObjectsFromArrayIfAbsentToErrorMessageArray(errorArray);
    return errorArray;
  }
Example #4
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;
  }
  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;
  }
Example #6
0
 public NSArray<ERIAttribute> allAttributes() {
   NSMutableArray<ERIAttribute> result = new NSMutableArray<ERIAttribute>();
   for (ERIAttributeGroup group : groups()) {
     result.addObjectsFromArray(attributes());
   }
   return result;
 }
  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;
  }
Example #8
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;
  }
Example #9
0
  /**
   * Parses an array of Git commits and returns an array of commits that affected the specified
   * object.
   *
   * @param repository the Git repository
   * @param commitIds the Git commit IDs to parse
   * @param path the object affected
   * @return an array of {@link GitCommit} objects representing the commits
   */
  public NSArray<GitCommit> commitsWithIds(NSArray<ObjectId> commitIds, String path) {
    try {
      RevWalk rw = new RevWalk(repository);

      try {
        rw.sort(RevSort.COMMIT_TIME_DESC);

        if (path != null) {
          rw.setTreeFilter(
              AndTreeFilter.create(PathSuffixFilter.create(path), TreeFilter.ANY_DIFF));
        } else {
          rw.setTreeFilter(TreeFilter.ALL);
        }

        for (ObjectId commitId : commitIds) {
          rw.markStart(rw.parseCommit(commitId));
        }

        NSMutableArray<GitCommit> commits = new NSMutableArray<GitCommit>();

        for (RevCommit commit : rw) {
          commits.add(new GitCommit(commit));
        }

        return commits;
      } finally {
        rw.release();
      }
    } catch (Exception e) {
      log.error("An exception occurred while parsing the commit: ", e);
      return null;
    }
  }
Example #10
0
 /**
  * Generate tab descriptors from an dictionary of property values.
  *
  * @param dict the properties to use
  * @return An array of the new tab descriptors
  */
 public static NSArray<TabDescriptor> tabsFromDictionary(
     NSDictionary<String, NSDictionary<String, Object>> dict) {
   NSMutableArray<TabDescriptor> tabs = new NSMutableArray<TabDescriptor>();
   for (String label : dict.keySet()) {
     NSDictionary<String, Object> settings = dict.get(label);
     String pageName = (String) settings.objectForKey("pageName");
     int accessLevel =
         ERXValueUtilities.intValueWithDefault(settings.objectForKey("accessLevel"), 0);
     int priority = ERXValueUtilities.intValueWithDefault(settings.objectForKey("priority"), 0);
     boolean wantsStart =
         ERXValueUtilities.booleanValueWithDefault(settings.objectForKey("wantsStart"), false);
     @SuppressWarnings("unchecked")
     NSDictionary<String, NSDictionary<String, Object>> children =
         (NSDictionary<String, NSDictionary<String, Object>>) settings.objectForKey("children");
     String overridingLabel = (String) settings.objectForKey("label");
     if (overridingLabel != null) {
       label = overridingLabel;
     }
     @SuppressWarnings("unchecked")
     NSDictionary<String, Object> tabConfig =
         (NSDictionary<String, Object>) settings.objectForKey("config");
     tabs.addObject(
         new TabDescriptor(
             pageName,
             label,
             accessLevel,
             priority,
             wantsStart,
             (children == null) ? null : tabsFromDictionary(children),
             (String) settings.objectForKey("id"),
             tabConfig));
   }
   return tabs;
 }
Example #11
0
    public NSArray statementsToDropPrimaryKeyConstraintsOnEntityGroups(
        NSArray entityGroups,
        EOSchemaSynchronizationModelChanges changes,
        EOSchemaGenerationOptions options) {
      if (entityGroups == null) return NSArray.EmptyArray;
      if (changes == null) changes = newChanges();

      NSMutableArray expressions = new NSMutableArray();
      for (Enumeration enumerator = entityGroups.objectEnumerator();
          enumerator.hasMoreElements(); ) {
        NSArray entities = (NSArray) enumerator.nextElement();
        EOEntity _last =
            (EOEntity)
                entities.lastObject(); // only need entity to get the table name for the group
        String nameInObjectStore =
            _nameInObjectStoreForEntityGroupWithChangeDictionary(
                entities, changes.changesForTableNamed(_last.externalName()));
        if ((nameInObjectStore != null) && (!"".equals(nameInObjectStore))) {
          expressions.addObject(
              this._expressionForString(
                  "delete from _SYS_RELATIONSHIP where source_table = '"
                      + nameInObjectStore
                      + "' or dest_table = '"
                      + nameInObjectStore
                      + "'"));
        }
      }
      return expressions.immutableClone();
    }
  @Override
  public NSArray getRequestHandlerPathForRequest(WORequest request) {
    NSMutableArray<Object> requestHandlerPath = new NSMutableArray<Object>();

    try {
      String path = request._uriDecomposed().requestHandlerPath();

      ERXRoute matchingRoute =
          setupRequestWithRouteForMethodAndPath(request, request.method(), path);
      if (matchingRoute != null) {
        @SuppressWarnings("unchecked")
        NSDictionary<ERXRoute.Key, String> keys =
            (NSDictionary<ERXRoute.Key, String>)
                request.userInfo().objectForKey(ERXRouteRequestHandler.KeysKey);
        String controller = keys.objectForKey(ERXRoute.ControllerKey);
        String actionName = keys.objectForKey(ERXRoute.ActionKey);
        requestHandlerPath.addObject(controller);
        requestHandlerPath.addObject(actionName);
      } else {
        requestHandlerPath.addObject(
            ERXProperties.stringForKeyWithDefault(
                "ERXRest.missingControllerName", "ERXMissingRouteController"));
        requestHandlerPath.addObject("missing");
        // throw new FileNotFoundException("There is no controller for the route '" + path + "'.");
      }

    } catch (Throwable t) {
      throw new RuntimeException("Failed to process the requested route.", t);
    }

    return requestHandlerPath;
  }
Example #13
0
 /** retourne les globalIDs des objets */
 public static NSArray globalIDsForObjects(EOEditingContext eContext, NSArray objects) {
   NSMutableArray gids = new NSMutableArray();
   for (int i = 0; i < objects.count(); i++) {
     gids.addObject(eContext.globalIDForObject((EOEnterpriseObject) objects.objectAtIndex(i)));
   }
   return gids;
 }
 /**
  * Called when firing this assignment with the key-path: <b>tabSectionsContents</b>. Constructs an
  * array of {@link ERD2WContainer}s representing each tab and optionally another array of
  * containers representing each section. See {@link ERD2WTabInspectPage} for the exact format of
  * the tabs and sections.
  *
  * @return array of containers for each tab
  */
 public Object tabSectionsContents(D2WContext context) {
   NSMutableArray tabSectionsContents = new NSMutableArray();
   for (Enumeration e = ((NSArray) value()).objectEnumerator(); e.hasMoreElements(); ) {
     NSArray tab = (NSArray) e.nextElement();
     ERD2WContainer c = new ERD2WContainer();
     c.name = (String) tab.objectAtIndex(0);
     c.keys = new NSMutableArray();
     Object testObject = tab.objectAtIndex(1);
     if (testObject instanceof NSArray) { // format #2
       for (int i = 1; i < tab.count(); i++) {
         NSArray sectionArray = (NSArray) tab.objectAtIndex(i);
         ERD2WContainer section = new ERD2WContainer();
         section.name = (String) sectionArray.objectAtIndex(0);
         section.keys = new NSMutableArray(sectionArray);
         section.keys.removeObjectAtIndex(0);
         c.keys.addObject(section);
       }
     } else { // format #1
       ERD2WContainer fakeTab = new ERD2WContainer();
       fakeTab.name = "";
       fakeTab.keys = new NSMutableArray(tab);
       fakeTab.keys.removeObjectAtIndex(0);
       c.keys.addObject(fakeTab);
     }
     tabSectionsContents.addObject(c);
   }
   return tabSectionsContents;
 }
Example #15
0
 public static void invalidateObjects(EOEditingContext ec, NSArray list) {
   NSMutableArray listGIDs = new NSMutableArray();
   for (int i = 0; i < list.count(); i++) {
     listGIDs.addObject(ec.globalIDForObject((EOEnterpriseObject) list.objectAtIndex(i)));
   }
   ec.invalidateObjectsWithGlobalIDs(listGIDs);
 }
Example #16
0
 /** retourne des faults d'objets à partir des globalIDs */
 public static NSArray faultsForGlobalIDs(EOEditingContext eContext, NSArray ids) {
   NSMutableArray objects = new NSMutableArray();
   for (int i = 0; i < ids.count(); i++) {
     objects.addObject(eContext.faultForGlobalID((EOGlobalID) ids.objectAtIndex(i), eContext));
   }
   return objects;
 }
Example #17
0
 public void setNavigationLevel(int level, String state) {
   if (level > 0) {
     NSMutableArray navTemp = new NSMutableArray(navigationState());
     if (navTemp.count() >= level) navTemp.replaceObjectAtIndex(state, level - 1);
     else navTemp.addObject(state);
     setNavigationState(navTemp);
   }
 }
 public Object fire(D2WContext c) {
   NSMutableArray<Object> results = new NSMutableArray<Object>();
   NSArray<String> keyPaths = (NSArray<String>) value();
   for (String path : keyPaths) {
     results.addObject(c.valueForKeyPath(path));
   }
   return results;
 }
Example #19
0
 public NSArray modelPages() {
   Enumeration e = model.publicDynamicPages().elements();
   NSMutableArray arr = new NSMutableArray();
   while (e.hasMoreElements()) {
     arr.addObject(fixString(e.nextElement()));
   }
   return arr;
 }
Example #20
0
 public void cancel() {
   ec.revert();
   // NSDictionary snapshot = ec.committedSnapshotForObject(onEdit);
   if (ec.insertedObjects().contains(item)) {
     NSMutableArray fullList = (NSMutableArray) session().valueForKey("personList");
     fullList.removeObject(item);
   }
   //		onEdit = null;
 }
Example #21
0
 /**
  * <span class="en"> Constructs an Or qualifier for filtering an array of strings that might have
  * the * wildcard character. Will be nice when we have regex in Java 1.4.
  *
  * @param emailPatterns array of email patterns
  * @return or qualifier to match any of the given patterns </span>
  *     <p><span class="ja"> ワイルドカード文字 * を持つ配列をフィルターする Or qualifier を作成します。
  * @param emailPatterns - メール・パタンの配列
  * @return 指定パタンのマッチに使用する or qualifier </span>
  */
 protected EOOrQualifier qualifierArrayForEmailPatterns(NSArray<String> emailPatterns) {
   NSMutableArray<EOQualifier> patternQualifiers = new NSMutableArray<EOQualifier>();
   for (String pattern : emailPatterns) {
     patternQualifiers.addObject(
         EOQualifier.qualifierWithQualifierFormat(
             "toString caseInsensitiveLike '" + pattern + "'", null));
   }
   return new EOOrQualifier(patternQualifiers);
 }
 /**
  * M�thode utilitaire qui convertit un tableau d'objets Map en NSArray d'objets NSDictionary.
  *
  * @param objs Tableau de Map
  * @return
  */
 public NSArray arrayMapsToNSArrayNSDictionarys(Object[] objs) throws Exception {
   // On transforme le tableau de map en NSArray de NSDictionary
   NSMutableArray tmpres = new NSMutableArray();
   for (int i = 0; i < objs.length; i++) {
     Map object = (Map) objs[i];
     tmpres.addObject(mapToNSDictionary(object));
   }
   return tmpres.immutableClone();
 }
Example #23
0
 public NSArray localList() {
   if (indexItem == null) return null;
   NSDictionary local = (NSDictionary) indexItem.valueForKey("local");
   if (local == null) return null;
   NSArray result = (NSArray) local.valueForKey("list");
   if (result != null) return result;
   String entityName = (String) local.valueForKey("entityName");
   if (entityName != null) {
     EOQualifier qual = null;
     String qualifier = (String) local.valueForKey("qualifier");
     if (qualifier != null) {
       NSArray args = (NSArray) local.valueForKey("args");
       if (args != null && args.count() > 0) {
         Object[] a = new Object[args.count()];
         for (int i = 0; i < a.length; i++) {
           a[i] = DisplayAny.ValueReader.evaluateValue(args.objectAtIndex(i), plist, this);
         }
         args = new NSArray(a);
       }
       qual = EOQualifier.qualifierWithQualifierFormat(qualifier, args);
     }
     NSArray sorter = (NSArray) local.valueForKey("sorter");
     if (sorter != null && sorter.count() > 0) {
       Object[] s = new Object[sorter.count()];
       for (int i = 0; i < s.length; i++) {
         Object sort = sorter.objectAtIndex(i);
         if (sort instanceof String) {
           s[i] = new EOSortOrdering((String) sort, EOSortOrdering.CompareAscending);
         } else {
           NSDictionary so = (NSDictionary) sort;
           String key = (String) so.valueForKey("key");
           String order = (String) so.valueForKey("order");
           s[i] = new EOSortOrdering(key, EOSortOrdering._operatorSelectorForString(order));
         }
       }
       sorter = new NSArray(s);
     }
     EOFetchSpecification fs = new EOFetchSpecification(entityName, qual, sorter);
     result = ec.objectsWithFetchSpecification(fs);
   } else if (local.valueForKey("methodName") != null)
     result = (NSArray) DisplayAny.ValueReader.evaluateDict(local, plist, this);
   if (result != null) {
     String uniq = (String) local.valueForKey("uniqueAttribute");
     if (uniq != null) {
       NSMutableArray res = new NSMutableArray();
       for (int i = 0; i < result.count(); i++) {
         Object obj =
             NSKeyValueCodingAdditions.Utility.valueForKeyPath(result.objectAtIndex(i), uniq);
         if (obj instanceof String) obj = WOMessage.stringByEscapingHTMLString((String) obj);
         if (!res.containsObject(obj)) res.addObject(obj);
       }
       result = res;
     }
   }
   local.takeValueForKey(result, "list");
   return result;
 }
Example #24
0
  public Application() {
    super();

    PachySanity.adjustEnvironment();

    if (isFirstTime()) {

      PachySanity.showEnvironment();

    } else {

      if (ERXProperties.booleanForKeyWithDefault("pachy.CreateEnvironment", false)) {
        PachySanity.createEnvironment();
      }

      if (ERXProperties.booleanForKeyWithDefault("pachy.ShowEnvironment", true)) {
        PachySanity.showEnvironment();
      }

      PachySanity.testEnvironment();

      if (ERXProperties.booleanForKey("pachy.exitAfterInitialize")) {
        LOG.info("[APPLICATION] EXIT AFTER INITIALIZING [pachy.exitAfterInitialize == true]");
        System.exit(0);
        /* ############################################# MIGHT STOP HERE (pachy.exitAfterInitialize) #### */
      }
    }

    er.extensions.ERXExtensions.setAdaptorLogging(
        ERXProperties.booleanForKeyWithDefault("pachy.optionEnableAdaptorLog", false));

    /*------------------------------------------------------------------------------------------------*
     *  ... add the metadata database to the objectStores (why does EOModel not do this?)
     *------------------------------------------------------------------------------------------------*/
    try {
      CXObjectStoreCoordinator.getDefaultCoordinator()
          .addObjectStore(
              "org.pachyderm.assetdb", ERXProperties.stringForKey("dbConnectURLGLOBAL"));
      LOG.info("org.pachyderm.assetdb registered.");
    } catch (Exception x) {
      LOG.error("org.pachyderm.assetdb not registered.", x);
    }

    /*------------------------------------------------------------------------------------------------*
     *  add the English and French locales to the locale array ...
     *------------------------------------------------------------------------------------------------*/
    locales = new NSMutableArray<Locale>();
    locales.addObject(Locale.ENGLISH);
    locales.addObject(Locale.FRENCH);

    /*------------------------------------------------------------------------------------------------*
     *  loading this class, causes "UTRuntimeProvider" to scan for UTI definitions which can take
     *  a long time (~10 seconds on a good day).  Rather than have the first unfortunate user incur
     *  that penalty unpredictably, we get it over with now, before anyone logs in ...
     *------------------------------------------------------------------------------------------------*/
    UTType.loadThisClassNow();
  }
Example #25
0
 // Methods for keeping track of current state
 public NSArray navigationState() {
   NSArray navigationState = (_navigationState == null) ? new NSArray() : _navigationState;
   if (_additionalNavigationState != null) {
     NSMutableArray combinedNavigationState = new NSMutableArray(_navigationState);
     combinedNavigationState.addObjectsFromArray(_additionalNavigationState);
     navigationState = combinedNavigationState;
   }
   return navigationState;
 }
Example #26
0
 public void setNavigationStateWithString(String navigationStateString) {
   if (navigationStateString != null) {
     NSMutableArray navigationState = new NSMutableArray();
     StringTokenizer navigationStateTokenizer = new StringTokenizer(navigationStateString, ".");
     while (navigationStateTokenizer.hasMoreTokens()) {
       navigationState.addObject(navigationStateTokenizer.nextToken());
     }
     setNavigationState(navigationState);
   }
 }
 /**
  * Returns the routes for the given controller class.
  *
  * @param routeController the controller class
  * @return the routes for the given controller class
  */
 public NSArray<ERXRoute> routesForControllerClass(
     Class<? extends ERXRouteController> routeController) {
   NSMutableArray<ERXRoute> routes = new NSMutableArray<ERXRoute>();
   for (ERXRoute route : _routes) {
     if (route.controller() == routeController) {
       routes.add(route);
     }
   }
   return routes;
 }
Example #28
0
 /** enleve tous les autres pointeurs d'un objet */
 public static NSMutableArray retirerMultiples(NSArray array) {
   NSMutableArray resultat = new NSMutableArray();
   for (int i = 0; i < array.count(); i++) {
     Object obj = array.objectAtIndex(i);
     if (!resultat.containsObject(obj)) {
       resultat.addObject(obj);
     }
   }
   return resultat;
 }
Example #29
0
  /**
   * Loops over each RecordGroup and group it. Init each new sub RecordGroup with empty record
   * groups for each record group in the parent
   */
  public void groupSubRecordGroupsWithMasterCriteriaLookupDict(NSDictionary groupLookUpDict) {
    Enumeration anEnum = recordGroupList().objectEnumerator();

    while (anEnum.hasMoreElements()) {
      DRRecordGroup recGrp = (DRRecordGroup) anEnum.nextElement();
      NSMutableArray arr = new NSMutableArray(masterCriteriaDrillDownList());
      arr.removeObjectAtIndex(0);
      recGrp.groupSubRecordGroupGroupLookUpDict(arr, groupLookUpDict);
    }
  }
 // Dictionnary Null value decoder
 protected static NSMutableArray reWriteListDico(NSArray dicoList) {
   NSMutableArray listDico = new NSMutableArray();
   for (int j = 0; j < dicoList.count(); j++) {
     NSMutableDictionary tinyDico = new NSMutableDictionary();
     tinyDico = (NSMutableDictionary) dicoList.objectAtIndex(j);
     reWriteDico(tinyDico);
     listDico.addObject(tinyDico);
   }
   return listDico;
 }