示例#1
0
  public void initListeDiplRN() {
    chargerDiplRN();

    // On va se construire un dico des enreg. pour l'année en cours de IP_DIPL_SANS_RN...
    NSArray bindings = new NSArray(new Object[] {getFannKey()});
    EOQualifier qualifier = EOQualifier.qualifierWithQualifierFormat("fannKey = %@", bindings);

    // la liste des diplomes qui n'autorisent pas les RN par le Web
    EOFetchSpecification fetchSpec = new EOFetchSpecification("IpDiplSansRn", qualifier, null);
    fetchSpec.setRefreshesRefetchedObjects(true);

    EOEditingContext ec = maSession.defaultEditingContext();
    NSArray res = ec.objectsWithFetchSpecification(fetchSpec);

    listeEOipDiplSansRn = new NSMutableDictionary();

    if (res != null && res.count() > 0) {

      Enumeration e = res.objectEnumerator();
      while (e.hasMoreElements()) {
        IpDiplSansRn eoIpDiplSansRN = (IpDiplSansRn) e.nextElement();
        Integer fspnKey = (Integer) eoIpDiplSansRN.fspnKey();

        listeEOipDiplSansRn.setObjectForKey(eoIpDiplSansRN, fspnKey);
      }
    }
  }
  private File _call() {
    // If development
    if (ERXApplication.isDevelopmentModeSafe()) {
      parameters.put("_isDevelopmentMode", Boolean.TRUE);
    } else {
      parameters.put("_isDevelopmentMode", Boolean.FALSE);
    }

    reportFile = null;

    if (log.isDebugEnabled()) log.debug("Starting JasperReportTask: " + toString());
    EOEditingContext ec = ERXEC.newEditingContext();
    ec.lock();
    try {

      @SuppressWarnings("unchecked")
      NSArray<EOEnterpriseObject> objects = ec.objectsWithFetchSpecification(fetchSpecification);

      jrDataSource = new ERJRFoundationDataSource(objects);

      if (jasperCompiledReportFileName != null) {
        reportFile =
            ERJRUtilities.runCompiledReportToPDFFile(
                jasperCompiledReportFileName, frameworkName, parameters, jrDataSource);
      }

    } catch (Exception e) {
      throw new NestableRuntimeException(e);
    } finally {
      ec.unlock();
    }

    return reportFile;
  }
示例#3
0
 public static NSArray<edu.umich.marketplace.eof.Category> fetchTopCategories(
     EOEditingContext editingContext) {
   EOFetchSpecification fetchSpec =
       EOFetchSpecification.fetchSpecificationNamed("topCategories", "Category");
   return (NSArray<edu.umich.marketplace.eof.Category>)
       editingContext.objectsWithFetchSpecification(fetchSpec);
 }
 // CLAUSE WHERE "UV.ANUNIV || UV.PRDUNIV = ... AND UV.UVC = ...
 // AND UV.ANUNIV || UV.PRDUNIV = EIA.ANUNIV || EIA.PRDUNIV" UV o� est
 // inscris l'�tudiant
 private static EOQualifier qualForUv(String uv, String periode) {
   // ARGSUV.addObject(uv);
   NSMutableArray quals = new NSMutableArray();
   EOEditingContext myContext = ERXEC.newEditingContext();
   EOQualifier qalUv =
       EOVueInsuv.UVC
           .eq(uv)
           .and(
               EOVueInsuv.EO_ETUDIANT_INSCR_ADM
                   .dot(EOEtudiantInscrAdm.ETU_ID)
                   .eq(EOVueInsuv.ETU_ID));
   quals.addObject(qalUv);
   if (periode != null) {
     EOQualifier qualPer =
         EOQualifier.qualifierWithQualifierFormat("anUniv=%@ AND prdUniv=%@", ARGSUV);
     quals.addObject(qualPer);
   }
   EOFetchSpecification spec = null;
   if (quals.count() == 2) {
     EOQualifier qual = new EOAndQualifier(quals);
     spec = new EOFetchSpecification("EOVueInsuv", qual, null);
   } else {
     spec = new EOFetchSpecification("EOVueInsuv", qalUv, null);
   }
   spec.setUsesDistinct(true);
   NSArray uvs = myContext.objectsWithFetchSpecification(spec);
   NSMutableArray etuids = new NSMutableArray();
   for (int i = 0; i < uvs.count(); i++) {
     EOVueInsuv luv = (EOVueInsuv) uvs.objectAtIndex(i);
     Long etu_id = luv.etuId();
     etuids.addObject(etu_id);
   }
   EOQualifier fin = ETU_INSCR_ADMS.dot(EOEtudiantInscrAdm.ETU_ID).in(etuids.immutableClone());
   return fin;
 }
 public static NSArray fetchVPersonnelActuelEnses(
     EOEditingContext editingContext, EOQualifier qualifier, NSArray sortOrderings) {
   EOFetchSpecification fetchSpec =
       new EOFetchSpecification(_EOVPersonnelActuelEns.ENTITY_NAME, qualifier, sortOrderings);
   fetchSpec.setIsDeep(true);
   NSArray eoObjects = (NSArray) editingContext.objectsWithFetchSpecification(fetchSpec);
   return eoObjects;
 }
示例#6
0
 public static NSArray fetchIndividuUlrs(
     EOEditingContext editingContext, EOQualifier qualifier, NSArray sortOrderings) {
   EOFetchSpecification fetchSpec =
       new EOFetchSpecification(_IndividuUlr.ENTITY_NAME, qualifier, sortOrderings);
   fetchSpec.setIsDeep(true);
   NSArray eoObjects = (NSArray) editingContext.objectsWithFetchSpecification(fetchSpec);
   return eoObjects;
 }
 public static NSArray<org.pachyderm.foundation.eof.PDBPresentation> fetchAllPresentations(
     EOEditingContext editingContext) {
   EOFetchSpecification fetchSpec =
       EOFetchSpecification.fetchSpecificationNamed(
           "allPresentations", _PDBPresentation.ENTITY_NAME);
   return (NSArray<org.pachyderm.foundation.eof.PDBPresentation>)
       editingContext.objectsWithFetchSpecification(fetchSpec);
 }
示例#8
0
 public static NSArray<edu.umich.marketplace.eof.Category> fetchTopCategories(
     EOEditingContext editingContext, NSDictionary<String, Object> bindings) {
   EOFetchSpecification fetchSpec =
       EOFetchSpecification.fetchSpecificationNamed("topCategories", "Category");
   fetchSpec = fetchSpec.fetchSpecificationWithQualifierBindings(bindings);
   return (NSArray<edu.umich.marketplace.eof.Category>)
       editingContext.objectsWithFetchSpecification(fetchSpec);
 }
 // V�rification afin de savoir si le user connect� est un �tudiant
 private static NSArray lesEtudiants(EOEditingContext myContext, EOIndividu etudiant) {
   EOQualifier qalCons = ETU_INSCR_ADMS.dot(EOEtudiantInscrAdm.ETU_ID).eq(etudiant.indivId());
   EOFetchSpecification spec =
       new EOFetchSpecification(
           "EOIndividu", qalCons, new NSArray(new Object[] {SORT_NOM_ASC, SORT_PRENOM_ASC}));
   spec.setUsesDistinct(true);
   NSArray etu = myContext.objectsWithFetchSpecification(spec);
   return etu;
 }
示例#10
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;
 }
示例#11
0
 public static NSArray<org.pachyderm.foundation.eof.PDBPresentation> fetchAllPresentations(
     EOEditingContext editingContext, NSDictionary<String, Object> bindings) {
   EOFetchSpecification fetchSpec =
       EOFetchSpecification.fetchSpecificationNamed(
           "allPresentations", _PDBPresentation.ENTITY_NAME);
   fetchSpec = fetchSpec.fetchSpecificationWithQualifierBindings(bindings);
   return (NSArray<org.pachyderm.foundation.eof.PDBPresentation>)
       editingContext.objectsWithFetchSpecification(fetchSpec);
 }
示例#12
0
 public static NSArray<edu.umich.marketplace.eof.Category> fetchSubCategories(
     EOEditingContext editingContext, edu.umich.marketplace.eof.Category parentBinding) {
   EOFetchSpecification fetchSpec =
       EOFetchSpecification.fetchSpecificationNamed("subCategories", "Category");
   NSMutableDictionary<String, Object> bindings = new NSMutableDictionary<String, Object>();
   bindings.takeValueForKey(parentBinding, "parent");
   fetchSpec = fetchSpec.fetchSpecificationWithQualifierBindings(bindings);
   return (NSArray<edu.umich.marketplace.eof.Category>)
       editingContext.objectsWithFetchSpecification(fetchSpec);
 }
示例#13
0
 public static NSArray<Group> fetchGroups(
     EOEditingContext editingContext,
     EOQualifier qualifier,
     NSArray<EOSortOrdering> sortOrderings) {
   EOFetchSpecification fetchSpec =
       new EOFetchSpecification(_Group.ENTITY_NAME, qualifier, sortOrderings);
   fetchSpec.setIsDeep(true);
   NSArray<Group> eoObjects =
       (NSArray<Group>) editingContext.objectsWithFetchSpecification(fetchSpec);
   return eoObjects;
 }
 public static NSArray<ERSyncClientDevice> fetchERSyncClientDevices(
     EOEditingContext editingContext,
     EOQualifier qualifier,
     NSArray<EOSortOrdering> sortOrderings) {
   EOFetchSpecification fetchSpec =
       new EOFetchSpecification(_ERSyncClientDevice.ENTITY_NAME, qualifier, sortOrderings);
   fetchSpec.setIsDeep(true);
   NSArray<ERSyncClientDevice> eoObjects =
       (NSArray<ERSyncClientDevice>) editingContext.objectsWithFetchSpecification(fetchSpec);
   return eoObjects;
 }
示例#15
0
 public static NSArray<org.pachyderm.foundation.eof.PDBPresentation>
     fetchPresentationNamesAndIdentities(EOEditingContext editingContext, String authorBinding) {
   EOFetchSpecification fetchSpec =
       EOFetchSpecification.fetchSpecificationNamed(
           "presentationNamesAndIdentities", _PDBPresentation.ENTITY_NAME);
   NSMutableDictionary<String, Object> bindings = new NSMutableDictionary<String, Object>();
   bindings.takeValueForKey(authorBinding, "author");
   fetchSpec = fetchSpec.fetchSpecificationWithQualifierBindings(bindings);
   return (NSArray<org.pachyderm.foundation.eof.PDBPresentation>)
       editingContext.objectsWithFetchSpecification(fetchSpec);
 }
示例#16
0
 // V�rification afin de savoir si le user connect� est conseill� d'un
 // �tudiant
 public static NSArray lesConseillers(EOEditingContext myContext, String conseil) {
   NSArray cons = new NSArray();
   if (conseil != null) {
     EOQualifier qalCons =
         ETU_INSCR_ADMS.dot(EOEtudiantInscrAdm.CONSEILLER_ID).eq(Long.valueOf(conseil));
     EOFetchSpecification spec =
         new EOFetchSpecification(
             "EOIndividu", qalCons, new NSArray(new Object[] {SORT_NOM_ASC, SORT_PRENOM_ASC}));
     spec.setUsesDistinct(true);
     cons = myContext.objectsWithFetchSpecification(spec);
   }
   return cons;
 }
示例#17
0
 public static NSArray fetchData(
     EOEditingContext context,
     String leNomTable,
     EOQualifier leQualifier,
     EOSortOrdering sortOrdering) {
   EOFetchSpecification myFetch =
       new EOFetchSpecification(
           leNomTable,
           leQualifier,
           sortOrdering == null ? null : new NSArray<EOSortOrdering>(sortOrdering));
   myFetch.setUsesDistinct(true);
   return context.objectsWithFetchSpecification(myFetch);
 }
示例#18
0
  // Préviens de charger la liste des diplomes avec RN ... et celle sans RN, pour l'année en cours
  // à chaque refetch, on raffraichit avec les datas de la base...
  public void chargerDiplRN() {

    NSArray bindings = new NSArray(new Object[] {cptLogin, getFannKey()});
    EOQualifier qualifier =
        EOQualifier.qualifierWithQualifierFormat("cptLogin = %@ and fannKey = %@", bindings);

    EOSortOrdering ordreDipl =
        EOSortOrdering.sortOrderingWithKey("diplome", EOSortOrdering.CompareAscending);
    NSArray sortOrderings = new NSArray(new Object[] {ordreDipl});

    // la liste des diplomes qui n'autorisent pas les RN par le Web
    EOFetchSpecification fetchSpec =
        new EOFetchSpecification("VDiplomeSansRn", qualifier, sortOrderings);
    fetchSpec.setRefreshesRefetchedObjects(true);

    EOEditingContext ec = maSession.defaultEditingContext();
    listeDiplSansRN = ec.objectsWithFetchSpecification(fetchSpec);

    // la liste des diplomes qui autorisent les RN par le Web
    fetchSpec = new EOFetchSpecification("VDiplomeAvecRn", qualifier, sortOrderings);
    fetchSpec.setRefreshesRefetchedObjects(true);

    listeDiplAvecRN = ec.objectsWithFetchSpecification(fetchSpec);
  }
 private void updatePreferences() {
   EOQualifier qual1 =
       new EOKeyValueQualifier(
           PrefScol.INDIVIDU_KEY,
           EOKeyValueQualifier.QualifierOperatorEqual,
           app.userInfo("individu"));
   EOQualifier qual2 =
       new EOKeyValueQualifier(
           PrefScol.ANNEE_KEY,
           EOKeyValueQualifier.QualifierOperatorEqual,
           myView.getCbAnnee().getSelectedItem());
   EOQualifier qualifier =
       new EOAndQualifier(new NSArray<EOQualifier>(new EOQualifier[] {qual1, qual2}));
   EOFetchSpecification myFetch = new EOFetchSpecification(PrefScol.ENTITY_NAME, qualifier, null);
   eodHabilitationsChoisies.setObjectArray(ec.objectsWithFetchSpecification(myFetch));
   myView.getMyEOTableHabilitationsChoisies().updateData();
 }
示例#20
0
 public static NSArray fetchAll(
     EOEditingContext editingContext,
     EOQualifier qualifier,
     NSArray sortOrderings,
     boolean distinct,
     int fetchLimit,
     DTEOEditingContextHandler handler) {
   EOFetchSpecification fetchSpec =
       new EOFetchSpecification(ENTITY_NAME, qualifier, sortOrderings);
   fetchSpec.setIsDeep(true);
   fetchSpec.setUsesDistinct(distinct);
   fetchSpec.setFetchLimit(fetchLimit);
   if (handler != null) {
     fetchSpec.setPromptsAfterFetchLimit(true);
     editingContext.setMessageHandler(handler);
   }
   return (NSArray) editingContext.objectsWithFetchSpecification(fetchSpec);
 }
  private void updateEodHabilitations() {
    boolean edtCreateur = ((Boolean) app.userInfo("edtCreateur")).booleanValue();
    NSArray<Object> droits = (NSArray<Object>) app.userInfo("droits");
    if (!edtCreateur && (droits == null || droits.count() == 0)) {
      eodHabilitations.setObjectArray(null);
      myView.getMyEOTableHabilitations().updateData();
      return;
    }

    String grade = myView.getTfGrade().getText();
    String diplome = myView.getTfDiplome().getText();

    NSMutableArray<EOQualifier> sumQualifiers = new NSMutableArray<EOQualifier>();

    if (!diplome.equals("")) {
      sumQualifiers.addObject(
          EOQualifier.qualifierWithQualifierFormat(
              FormationHabilitation.FORMATION_SPECIALISATION_KEY
                  + "."
                  + FormationSpecialisation.SCOL_FORMATION_DIPLOME_KEY
                  + "."
                  + FormationDiplome.FDIP_ABREVIATION_KEY
                  + " caseInsensitiveLike '*"
                  + diplome
                  + "*'"
                  + " or "
                  + FormationHabilitation.FORMATION_SPECIALISATION_KEY
                  + "."
                  + FormationSpecialisation.SCOL_FORMATION_DIPLOME_KEY
                  + "."
                  + FormationDiplome.FDIP_ABREVIATION_KEY
                  + " caseInsensitiveLike '*"
                  + diplome
                  + "*'",
              null));
    }

    if (!grade.equals("")) {
      sumQualifiers.addObject(
          EOQualifier.qualifierWithQualifierFormat(
              FormationHabilitation.FORMATION_SPECIALISATION_KEY
                  + "."
                  + FormationSpecialisation.SCOL_FORMATION_DIPLOME_KEY
                  + "."
                  + FormationDiplome.FGRA_CODE_KEY
                  + " caseInsensitiveLike '*"
                  + grade
                  + "*'",
              null));
    }

    sumQualifiers.addObject(
        EOQualifier.qualifierWithQualifierFormat(
            FormationHabilitation.FANN_KEY_KEY + " = %@",
            new NSArray<Object>(
                ((FormationAnnee) myView.getCbAnnee().getSelectedItem()).fannKey())));

    // si edtCreateur : peut voir tous les diplomes
    if (!edtCreateur) {
      sumQualifiers.addObject(
          new EOKeyValueQualifier(
              FormationHabilitation.DROIT_DIPLOMES_KEY + "." + ScolDroitDiplome.DLOG_KEY_KEY,
              EOKeyValueQualifier.QualifierOperatorEqual,
              droits.objectAtIndex(0)));
      sumQualifiers.addObject(
          new EOKeyValueQualifier(
              FormationHabilitation.DROIT_DIPLOMES_KEY + "." + ScolDroitDiplome.DDIP_EDT_KEY,
              EOKeyValueQualifier.QualifierOperatorEqual,
              "A"));
    }

    EOQualifier totalQualifier = new EOAndQualifier(sumQualifiers);

    EOFetchSpecification myFetch =
        new EOFetchSpecification(FormationHabilitation.ENTITY_NAME, totalQualifier, null);
    myFetch.setUsesDistinct(true);
    myFetch.setRefreshesRefetchedObjects(true);
    eodHabilitations.setObjectArray(ec.objectsWithFetchSpecification(myFetch));
    myView.getMyEOTableHabilitations().updateData();
  }
示例#22
0
  // SELECT des �tudiants master
  public static NSArray EtudiantsMST(
      EOEditingContext myContext, NSDictionary bindinds, Recherche searchMsg) {
    String periode = (String) bindinds.valueForKey("periode");
    String diplome = (String) bindinds.valueForKey("diplome");
    String prdDiplome = (String) bindinds.valueForKey("prdDiplome");
    String niveau = (String) bindinds.valueForKey("niveau");
    String uv = (String) bindinds.valueForKey("uv");
    String nom = (String) bindinds.valueForKey("nom");
    String prenom = (String) bindinds.valueForKey("prenom");
    String numero = (String) bindinds.valueForKey("numero");
    String idConseiller = (String) bindinds.valueForKey("idConseiller");
    NSMutableArray quals = new NSMutableArray();
    quals.addObject(typeEmail());
    quals.addObject(qualCivilite());
    quals.addObject(qualEia());
    // quals.addObject(refMail());
    if ((StringCtrl.isEmpty(nom))
        && (StringCtrl.isEmpty(prenom))
        && ((StringCtrl.isEmpty(numero)))
        && (periode == null || (StringCtrl.isEmpty(periode)))
        && (diplome == null || (StringCtrl.isEmpty(diplome)))
        && (niveau == null || (StringCtrl.isEmpty(niveau)))
        && (uv == null || (StringCtrl.isEmpty(uv)))
        && ((StringCtrl.isEmpty(idConseiller)))) {
      searchMsg.setSearchMsg("Veuillez affiner la recherche, trop de donn�es remont�es");
      return NSArray.EmptyArray;
    }
    if (lesConseillers(myContext, idConseiller).count() != 0) {
      quals.addObject(qualForConseiller(myContext, idConseiller));
    } else {
      if (!(StringCtrl.isEmpty(nom))) {
        NSMutableArray qua = new NSMutableArray();
        qua.addObject(qualForNomLike(nom));
        qua.addObject(qualForNomNaisLike(nom));
        EOQualifier nor = new EOOrQualifier(qua);
        quals.addObject(nor);
      }
      if (!(StringCtrl.isEmpty(prenom))) {
        String deb = prenom.substring(0, 1).toUpperCase();
        String rest = prenom.substring(1, prenom.length()).toLowerCase();
        prenom = deb + rest;
        quals.addObject(qualForPrenomLike(prenom));
      }
      if (!(StringCtrl.isEmpty(numero))) {
        quals.addObject(qualNumero(numero));
      }
      if (periode != null && !(StringCtrl.isEmpty(periode))) {
        quals.addObject(qualForPeriode(periode));
      }
      if (diplome != null && !(StringCtrl.isEmpty(diplome))) {
        quals.addObject(qualDiplome(diplome));
      }
      if (prdDiplome != null && !(StringCtrl.isEmpty(prdDiplome))) {
        quals.addObject(qualPrdDiplome(prdDiplome));
      }
      if (niveau != null && !(StringCtrl.isEmpty(niveau))) {
        quals.addObject(qualMST(niveau, diplome, prdDiplome));
      }
      if (uv != null && !(StringCtrl.isEmpty(uv))) {
        quals.addObject(qualForUv(uv, periode));
      }
    }

    EOQualifier qual = new EOAndQualifier(quals);
    EOFetchSpecification spec =
        new EOFetchSpecification(
            "EOIndividu", qual, new NSArray(new Object[] {SORT_NOM_ASC, SORT_PRENOM_ASC}));
    spec.setPrefetchingRelationshipKeyPaths(preFetch());
    spec.setUsesDistinct(true);
    NSArray disp = myContext.objectsWithFetchSpecification(spec);
    return disp;
  }
示例#23
0
  // changer la valeur dans la base de l'occurence concernée de l'entite IP_BILANRN_OK
  // SSI la valeur a été changé par l'utilisateur !!!
  private void setEtatRnAff(boolean semImpair, Integer nouvValSessionAutorn) {

    EOGenericRecord leDiplSemCourant;
    if (semImpair) leDiplSemCourant = leDiplSemCourantImpair;
    else leDiplSemCourant = leDiplSemCourantPair;

    int ancValSessionAutorn = getEtatChoixAutorn(semImpair);
    if (ancValSessionAutorn != nouvValSessionAutorn.intValue()) { // alors on a changé qq chose

      String diplome = ((Session) session()).monApp.recuperer1String(leDiplSemCourant, "diplome");
      String mparLibelle =
          ((Session) session()).monApp.recuperer1String(leDiplSemCourant, "mparLibelle");
      int msemOrdre = ((Session) session()).monApp.recuperer1int(leDiplSemCourant, "msemOrdre");
      NSLog.out.appendln(
          "On change l'état pour "
              + diplome
              + ", "
              + mparLibelle
              + " sem."
              + msemOrdre
              + " : passage à "
              + nouvValSessionAutorn);

      //  		MAJ des relationsChips... pour suivre l’ajout des objets
      //  		catSelected.addObjectToBothSidesOfRelationshipWithKey(itemEdit,"items");

      // est-ce que l'on a déjà un EO pour l'entite IP_BILANRN_OK qui serait associée à ce
      // "leDiplSemCourantImpair" ?
      Integer mrsemKey = (Integer) leDiplSemCourant.valueForKey("mrsemKey");
      Integer fannKey = new Integer(((Session) session()).getAnneeEnCours());
      EOEditingContext ec = ((Session) session()).defaultEditingContext();

      Integer etatAutoRN = (Integer) leDiplSemCourant.valueForKey("rnaffEtat");
      if (etatAutoRN == null) { // non : créer le nouvel EO et l'insérer...
        IpBilanrnOk etatAutorn = new IpBilanrnOk();
        etatAutorn.setFannKey(fannKey);
        etatAutorn.setMrsemKey(mrsemKey);
        etatAutorn.setRnaffEtat(nouvValSessionAutorn);
        ec.insertObject(etatAutorn);

      } else {
        // oui : modifier le EO... en commençant par le fetcher...
        NSArray bindings = new NSArray(new Object[] {fannKey, mrsemKey});
        EOQualifier qualifier =
            EOQualifier.qualifierWithQualifierFormat("fannKey = %@ and mrsemKey = %@", bindings);

        EOFetchSpecification fetchSpec = new EOFetchSpecification("IpBilanrnOk", qualifier, null);
        fetchSpec.setRefreshesRefetchedObjects(true);

        NSArray res = ec.objectsWithFetchSpecification(fetchSpec);
        if (res != null && res.count() > 0) {
          IpBilanrnOk etatAutorn = (IpBilanrnOk) res.objectAtIndex(0);
          etatAutorn.setRnaffEtat(nouvValSessionAutorn);
        }
      }

      // sauver le tout...
      ec.saveChanges();

      // TODO : marche pas ci-dessous... faire un reload !
      // leDiplSemCourant.takeStoredValueForKey(new Integer(sessionAutorn), "rnaffEtat");
      monAutornDiplCtrlr.reloaderVueAutoRN(mrsemKey);
    }
  }
 /**
  * Retrieve objects using a fetch specification.
  *
  * @param context The editing context to use
  * @param fspec The fetch specification to use
  * @return an NSArray of the entities retrieved
  */
 @SuppressWarnings("unchecked")
 public static NSArray<UserMessageSubscription> objectsWithFetchSpecification(
     EOEditingContext context, EOFetchSpecification fspec) {
   return context.objectsWithFetchSpecification(fspec);
 }