Examples of Personne


Examples of data.reservation.Personne

       */
      while(rsPersRes.next()){
        String nom = rsPersRes.getString(1);
        String prenom = rsPersRes.getString(2);
        String categorie = rsPersRes.getString(3);
        Personne p = new Personne(nom, prenom, new Categorie(categorie));
        res.addPersonne(p);
      }

      // retourner le resultat
      return res;
View Full Code Here

Examples of eu.nicolaslecoz.cmcc.cinema.domain.Personne

    }
   
    Elements directorsElt = doc.select("li[itemprop=director]");
   
    for (Element directorElt : directorsElt) {
      Personne realisateur = new Personne();
     
      recupererInfoPersonneFromAllocine(directorElt, realisateur);
     
      realisateur.addRoleOnFilmByType(film, RoleType.REALISATEUR);
     
      film.getRealisateurs().add(realisateur);
    }
   
    Elements actorsElt = doc.select("li[itemprop=actors]");
   
    for (Element actorElt : actorsElt) {
      Personne acteur = new Personne();
     
      recupererInfoPersonneFromAllocine(actorElt, acteur);
     
      Element actorLinkElt = actorElt.select("a[itemprop=url]").get(0);
      Element roleNameParElt = actorLinkElt.parent().nextElementSibling();
     
      acteur.addRoleOnFilmByType(film, RoleType.ACTEUR);
     
      if (roleNameParElt != null) {
        acteur.getRoles().get(0).setRole(roleNameParElt.text().replaceFirst("Rôle : ", ""));
      }
      film.getActeurs().add(acteur);
    }
   
    Elements actorLineElts = actorsElt.get(0).parent().parent().nextElementSibling().select("tr");
   
    for (Element actorLineElt : actorLineElts) {
      Personne acteur = new Personne();
     
      acteur.addRoleOnFilmByType(film, RoleType.ACTEUR);
      acteur.getRoles().get(0).setRole(actorLineElt.select("td").get(0).text());
     
      Elements actorLinkElts = actorLineElt.select("td").get(1).select("a");
     
      if (actorLinkElts.size() > 0) {
        acteur.setAllocineId(computeAllocineIdFromFicheActeurUrl(actorLinkElts.first().attr("href")));
        acteur.setName(actorLinkElts.get(0).text());
      } else {
        Element actorImgElt = actorLineElt.select("td").get(1).select("img").first();
       
        acteur.setName(actorImgElt.attr("alt"));
      }
      film.getActeurs().add(acteur);
    }
   
    Elements linkPersonElts = doc.select("a[href^=/personne/]");
   
    for (Element linkPersonElt : linkPersonElts) {
      String nom = linkPersonElt.text();
      String role = null;
     
      Elements parents = linkPersonElt.parents();
     
      if (parents != null && parents.size() > 3 && "tr".equalsIgnoreCase(parents.get(2).nodeName())) {
        role = parents.get(2).select("td").get(0).text();
      }
      RoleType roleType = RoleType.getRoleTypeByRoleInAllocine(role);
     
      if (roleType != null) {
        Personne personne = new Personne();
       
        personne.setName(nom);
        personne.setAllocineId(computeAllocineIdFromFicheActeurUrl(linkPersonElt.attr("href")));
       
        personne.addRoleOnFilmByType(film, roleType);
        film.addPersonneParRoleType(personne, roleType);
      }
    }
  }
View Full Code Here

Examples of fr.mylinkedin.entity.Personne

      tx.begin();
      for (int i = 1; i <= 100; i++) {
        if (i % 500 == 0) {
          System.out.println(i);
        }
        Personne personnetest = new Personne();
        personnetest.setNom("NomTest" + i);
        personnetest.setPrenom("PrenomTest" + i);
        personnetest.setCourriel("CourrielTest" + i);
        session.persist(personnetest);
        if (i % 49 != 0) {
          for (int j = 1; j <= 49; j += 2) {
            Personne personnetest2 = (Personne) session.get(
                Personne.class, personnetest.getId() - j);
            if (personnetest2 != null) {
              personnetest.addRelationDirecte(personnetest2);
              session.update(personnetest);
            }
          }
        } else if (i % 49 == 0) {
          Personne personnetest3 = (Personne) session.get(
              Personne.class, personnetest.getId() - 50);
          if (personnetest3 != null)
            personnetest.addRelationDirecte(personnetest3);

        }
        session.update(personnetest);
      }
      tx.commit();
    } else if (testCase.equals("EXEC2")) {
      // Ex�cution des diff�rents chargements et strat�gies
      System.out
      .println("##################    EXEC 2    ###################");
      session = sessionFactory.getCurrentSession();
      tx = session.getTransaction();
      tx.begin();
     
     
      //<set name="relationsDirectes" table="PERSONNE_RELATION_DIRECTE" cascade="save-update" lazy="true" fetch="join" >
      //lazy="true" fetch="join"
      //lazy="true" fetch="select"
      //lazy="true" fetch="subselect"
      //lazy="false" fetch="join"
      //lazy="false" fetch="select"
      //lazy="false" fetch="subselect"
      Personne personne = (Personne) session.get(Personne.class, new Long(1));
     

      tx.commit();
    } else if (testCase.equals("TEST1")) {
      // Retrouver toutes les relations de premier niveau d'une personne
      System.out
      .println("##################    TEST 1    ###################");
      session = sessionFactory.getCurrentSession();
      tx = session.getTransaction();
      tx.begin();

      String courriel = "john.doe@nobody.com";
      Personne personne = findPersonneByCourriel(session, courriel);
      Set<Personne> relationsDirectes = personne.getRelationsDirectesR();

      System.out.println("=>  relations directes de "
          + personne.getCourriel() + " : ");
      displayPersonneCollection(relationsDirectes);

      tx.commit();
    } else if (testCase.equals("TEST2")) {
      // Retrouver toutes les relations de niveau sup�rieur � 1 d'une
      // personne : Java Pur
      System.out.println("##################    TEST 2    ###################");
      session = sessionFactory.getCurrentSession();
      tx = session.getTransaction();
      tx.begin();
     
      // Personne dont on cherche les relations de niveau > 1 (soit les
      // relations indirectes)
      Personne personne = (Personne) session.get(Personne.class, new Long(1));
      int niveau = 5;
      Set<Personne> relationsFound = getRelationsIndirectes(personne,niveau);
     
      System.out.println("=> toutes les relations de niveau "+niveau+" de "+ personne.getCourriel() + " : ");
      displayPersonneCollection(relationsFound);
      tx.commit();
    }

    else if (testCase.equals("TEST3")) {

      // Retrouver toutes les relations de niveau sup�rieur � 1 d'une
      // personne : SQL
      System.out.println("##################    TEST 3    ###################");
      session = sessionFactory.getCurrentSession();
      tx = session.getTransaction();
      tx.begin();
      // Personne dont on cherche les relations de niveau > 1
      Personne personne = (Personne) session.get(Personne.class, new Long(1));
      int niveau = 5;

      @SuppressWarnings("unchecked")
      List<Personne> relations = getRelationsIndirectesSqlNiveau(session,  personne, niveau);

      System.out.println("=> toutes les relations de niveau "+niveau+" de "+ personne.getCourriel() + " : ");
      displayPersonneCollection(relations);
      tx.commit();

    } else if (testCase.equals("TEST4")) {
      // Retrouver toutes les personnes liant directement ou indirectement
      // deux personnes
      // = intersection des relations directes et indirectes des deux
      // personnes
      System.out
      .println("##################    TEST 4    ###################");
      session = sessionFactory.getCurrentSession();
      tx = session.getTransaction();
      tx.begin();
      // Personnes dont on cherche les relations directes et indirectes
      String courriel1 = "john.doe@nobody.com";
      Personne personne1 = findPersonneByCourriel(session, courriel1);
      String courriel2 = "jane.doe@nobody.com";
      Personne personne2 = findPersonneByCourriel(session, courriel2);

      int minDepth = 1;

      @SuppressWarnings("unchecked")
      List<Personne> relations1 = getRelationsIndirectesSQL(session,
          personne1, minDepth);
      @SuppressWarnings("unchecked")
      List<Personne> relations2 = getRelationsIndirectesSQL(session,
          personne2, minDepth);

      @SuppressWarnings("unchecked")
      List<Personne> liens = (List<Personne>) CollectionUtils
      .intersection(relations1, relations2);
      System.out
      .println("=> toutes les personnes liant directement ou indirectement "
          + personne1.getCourriel()
          + " � "
          + personne2.getCourriel() + " : ");
      displayPersonneCollection(liens);

      tx.commit();
    } else if (testCase.equals("TEST5")) {
     
      // Retrouver toutes les relations potentielles d'une personne : Java Pur
      System.out.println("##################    TEST 5    ###################");
      session = sessionFactory.getCurrentSession();
      tx = session.getTransaction();
      tx.begin();
     
      int i = 0;
     
      System.out.println(i++);
      // Personne dont on cherche les relations directes et indirectes
      Personne personne = (Personne) session.get(Personne.class, new Long(9));
     
      System.out.println(i++);
     
      // toutes les relations de niveau 2 et plus
      Set<Personne> relations = getRelationsIndirectes(personne);

      System.out.println(i++);
     
      // toutes les personnes ayant suivi les m�mes formations
      for (Formation form : personne.getFormationsSuiviesR()) {
        for (Personne personneFormee : form.getPersonnesFormeesR()) {
          if (!relations.contains(personneFormee)
              && personneFormee != personne) {
            relations.add(personneFormee);
          }
        }
      }
     
      System.out.println(i++);
     
      // toutes les personnes ayant travaill� dans les m�mes entreprises
      for (PosteOccupe posteOccupe : personne.getPostesOccupesR()) {
        for (PosteOccupe posteOccupeEntreprise : posteOccupe.getEntreprise().getPostesOccupesR()) {
          if (!relations.contains(posteOccupeEntreprise.getPersonne())
              && posteOccupeEntreprise.getPersonne() != personne) {
            relations.add(posteOccupeEntreprise.getPersonne());
          }
        }
      }
      System.out.println("=> tous les contacts potentiels de "
          + personne.getCourriel() + "(nb : "+relations.size() +") : ");
      displayPersonneCollection(relations);
      tx.commit();
     
    } else if (testCase.equals("TEST6")) {
      //Retrouver toutes les relations potentielles d'une personne : HQL et SQL
      System.out.println("##################    TEST 6    ###################");
      session = sessionFactory.getCurrentSession();
      tx = session.getTransaction();
      tx.begin();
      String courriel = "molly.doe@nobody.com";
      Personne personne = findPersonneByCourriel(session, courriel);
      //les contacts de niveau 2 et plus sont des contacts directs potentiels
      List<Personne> personnes = (List<Personne>) getRelationsIndirectesSQL(session, personne, 2);
      //les personnes travaillant ou ayant travaill� pour la m�me entreprise sont des contacts directs potentiels
      @SuppressWarnings("unchecked")
      List<Personne> personnesEntreprise = (List<Personne>) session.getNamedQuery("personne-lien-entreprise")
      .setParameter("personne_id", personne.getId())
      .list();
      //les personnes ayant suivi les memes formations sont des contacts directs potentiels
      @SuppressWarnings("unchecked")
      List<Personne> personnesFormation = (List<Personne>) session.getNamedQuery("personne-lien-formation")
      .setParameter("personne_id", personne.getId())
      .list();
      @SuppressWarnings("unchecked")
      List<Personne> allRelations = (List<Personne>) CollectionUtils.union( CollectionUtils.union(personnes, personnesEntreprise),personnesFormation);
      System.out.println ("=> tous les contacts potentiels de "+personne.getCourriel()+" : ");
      displayPersonneCollection(allRelations);
      tx.commit();
    } else if (testCase.equals("TEST7")) {

      //Retrouver toutes les personnes ayant consult� un profil de personne donn�e
      System.out.println("##################    TEST 7    ###################");
      session = sessionFactory.getCurrentSession();
      tx = session.getTransaction();
      tx.begin();
      String courriel = "bob.doe@nobody.com";
      Personne personne =  findPersonneByCourriel(session, courriel);
      @SuppressWarnings("unchecked")
      List<Personne> consultants = (List<Personne>) session.getNamedQuery("personne-consultant")
            .setParameter("personne_id", personne.getId())
            .list();
     
     
     
      System.out.println("=> toutes les personnes ayant consult� le profil de "+personne.getCourriel()+" : ");
      displayPersonneCollection(consultants);
      tx.commit();
    }
    long t1 = new Date().getTime();
    System.out.println("temps en millisecondes : "+(t1-t0));
View Full Code Here

Examples of net.fqsc.inscriptions.model.identification.Personne

      {
        if (this.getDomainModel().isInitialized())
        {
          final Inscription inscription = (Inscription) entity;

          final Personne personneInscription = inscription
              .getPersonne();
          if (this.getPersonne() == null)
          {
            if (!personneInscription.getInscriptions().contain(
                inscription))
            {
              post = personneInscription.getInscriptions().add(
                  inscription);
            }
          }
        }
      }
View Full Code Here

Examples of net.fqsc.inscriptions.model.identification.Personne

    {
      if (super.postRemove(entity))
      {
        final Inscription inscription = (Inscription) entity;

        final Personne personneInscription = inscription.getPersonne();
        if (this.getPersonne() == null)
        {
          if (personneInscription.getInscriptions().contain(
              inscription))
          {
            post = personneInscription.getInscriptions().remove(
                inscription);
          }
        }
      }
      else
View Full Code Here

Examples of net.fqsc.inscriptions.model.identification.Personne

      if (super.postUpdate(beforeEntity, afterEntity))
      {
        final Inscription beforeInscription = (Inscription) beforeEntity;
        final Inscription afterInscription = (Inscription) afterEntity;

        final Personne beforePersonne = beforeInscription.getPersonne();
        final Personne afterPersonne = afterInscription.getPersonne();

        if (beforeEntity != afterEntity)
        {
          if (beforePersonne.getInscriptions().contain(
              beforeInscription))
            post = beforePersonne.getInscriptions().remove(
                beforeInscription);

          if (post)
          {
            post = afterPersonne.getInscriptions().add(
                afterInscription);
          }
        }
      }
      else
View Full Code Here

Examples of net.fqsc.inscriptions.model.identification.Personne

  @Override
  protected void populateItem(final Item item)
  {

    final Personne personne = (Personne) item.getModelObject();
    final Comptes comptes = personne.getComptes();
    Map map = new HashMap();

    // si la page est train de gérer les admin
    if (this.admin)
    {
      // Si l'usager possède un compte
      if (comptes.getList().size() > 0)
      {
        map.put("Oid", personne.getOid());
        item.add(HomePage.link("selection", DisplayPersonneAdmin.class,
            map));
      }
      else
      {
        item.add(new Label("selection", "L'usager n'a pas de compte"));
      }
    }
    // l'usager est train de gérer les plaques....
    else if (this.saison != null)
    {
      map = new HashMap();
      map.put( DisplayPlaquePersonne.TypeParameters.ISNEW, true);
      map.put(DisplayPlaquePersonne.TypeParameters.INFOSAISON, null);
      map.put(DisplayPlaquePersonne.TypeParameters.PERSONNE, personne);
      map.put(ViewPersonnePanel.TypeParameters.SAISON, this.saison);
      map.put(DisplayPlaquePersonne.TypeParameters.SAISON, this.saison);
      try
      {
        map.put(DisplayPlaquePersonne.TypeParameters.INFOSSAISONS, personne.getInfosSaison());
      }
      catch (final Exception e)
      {
        throw new SystemeException(e.getMessage());
      }
      item.add(HomePage.link("selection",DisplayPlaquePersonne.class, map))
    }
    // l'usager est en train de gérer les membres.
    else
    {
      map.put("Oid", personne.getOid());
      item.add(HomePage
          .link("selection", DisplayPersonnePanel.class, map));
    }

    item.add(new Label("prenom", new PropertyModel(personne, "prenom")));
View Full Code Here

Examples of net.fqsc.inscriptions.model.identification.Personne

  }
 
  @Override
  protected void populateItem(final ListItem item) {
    final InfoSaison infoSaison = (InfoSaison) item.getModelObject();
    final Personne personne = (Personne) this.personnes.retrieveByOid(infoSaison.getPersonne().getOid());
    final Categorie categorie = (Categorie) this.categories.retrieveByOid(infoSaison.getCategorie().getOid());
   
    final Map map = new HashMap();
    map.put(DisplayPlaquePersonne.TypeParameters.INFOSAISON, infoSaison);
    map.put(DisplayPlaquePersonne.TypeParameters.ISNEW, false);
    map.put(DisplayPlaquePersonne.TypeParameters.PERSONNE, personne);
    map.put(DisplayPlaquePersonne.TypeParameters.SAISON, this.saison);
    try
    {
      map.put(DisplayPlaquePersonne.TypeParameters.INFOSSAISONS, personne.getInfosSaison());
    }
    catch (final Exception e)
    {
      throw new SystemeException(e.getMessage());
    }
View Full Code Here

Examples of net.fqsc.inscriptions.model.identification.Personne

  public CreationPersonneForm(final String id, final Map parameters)
  {
    super(id);
    final InscriptionsApp app = (InscriptionsApp) this.getApplication();
    this.personnes = (Personnes) app.getEntry("Personnes");
    this.personne = new Personne(this.personnes.getDomainModel());
    this.createComponents();

  }
View Full Code Here

Examples of net.fqsc.inscriptions.model.identification.Personne

      {
        if (this.getDomainModel().isInitialized())
        {
          final InfoSaison infoSaison = (InfoSaison) entity;

          final Personne personneInfoSaison = infoSaison
              .getPersonne();
          if (this.getPersonne() == null)
          {
            if (!personneInfoSaison.getInfosSaison().contain(
                infoSaison))
            {
              post = personneInfoSaison.getInfosSaison().add(
                  infoSaison);
            }
          }
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.