Package util

Examples of util.MailSenDer


     
      this.pimng.savePersonalInfo(f.getPi());
     
      /**Sends an email to the student*/
     
      MailSenDer ms = new MailSenDer(path+"mail.properties");
      ms.sendAccuse(f.getPi().getEmail(), f.getPi().getLastname()+" "+f.getPi().getFirstname());
     
      model.put("urlPdfFolder", "./pdf/"+pdfFile);
     
      return new ModelAndView("completed", model);
    }
View Full Code Here


  private ModelAndView handleGetFirstChoice(HttpServletRequest request,
      HttpServletResponse response) {
    ModelAndView mav = null;

    String path = request.getSession().getServletContext().getRealPath("/");
    MailSenDer ms = new MailSenDer(path + "mail.properties");
    Map model = new HashMap<String, List>();

    List error = new ArrayList();
    String[] boxes = RequestUtils.getStringParameters(request, "box");
    String action = request.getParameter("action");
View Full Code Here

      message = "";
     
      List advancementsInterviews = foldermanager.findByStateAndFormation(Folder.FOLDER_INTERVIEW, p.getFormation());
     
      String path = request.getSession().getServletContext().getRealPath("/");
      MailSenDer mdInterview = new MailSenDer(path+"mail.properties");
      boolean send = true;
     
      for (Iterator iterAdvancements = advancementsInterviews.iterator(); iterAdvancements
          .hasNext();) {
        Advancement advancement = (Advancement) iterAdvancements.next();
        Formation f = (Formation)advancement.getAdvancement().keySet().iterator().next();
        Etat interview = advancement.getAdvancement().get(f);
        boolean convoq = mdInterview.sendInterviewMail(advancement, p, interview);
        send = send && convoq;
        if(!convoq){
          message += advancement.getPi().getEmail()+" ";
        }
      }
View Full Code Here

        if(update==0){
          page.add("Echec");
          message = "Le dossier de " + folder.getPi().getLastname() +" "+folder.getPi().getFirstname()+ " n\'a pas �t� transf�r� aux responsables.";
        }else{
          String path = request.getSession().getServletContext().getRealPath("/");
          MailSenDer msd = new MailSenDer(path + "mail.properties");
          boolean send = msd.sendAccuseDossierPapier(folder.getPi().getEmail(), folder.getPi().getLastname()
              + " " + folder.getPi().getFirstname());
          if(send){
            page.add("Confirmation");
            message = "Le dossier de " + folder.getPi().getLastname() +" "+folder.getPi().getFirstname()+ " a �t� transf�r� aux responsables. Le candidat a �t� notifi�. Vous le trouverez dans la liste des dossiers complets.";
          }else{
View Full Code Here

    }else if(finalmail!=null){
      List<Advancement> advancements = this.foldermanager.findFinalAdvancement();
      Map<String,String> responsables = foldermanager.findAllResponsables();
     
      String path = request.getSession().getServletContext().getRealPath("/");
      MailSenDer mailSender = new MailSenDer(path+"mail.properties");
      List nonReussit = mailSender.sendFinalMail(advancements, responsables);
      if(nonReussit.isEmpty()){
        page.add("Confirmation");
        message = "L'envoie de mail reussit!";
        model.put("page", page);
        model.put("message", message);
      }else{
        page.add("Echec");
        message = "Les mails n'ont pas pu etre envoy�s aux candidats suivants :";
        model.put("page", page);
        model.put("message", message);
        model.put("nonReussit", nonReussit);
      }
   
      /* The action of removing a candidate from a principal list  */
    }else if(desistement!=null && formations.length > 0 ){
     
      int id = Integer.parseInt(sId);
      message ="";
      boolean send = true;
      int refuse = 0;
      int beforeRefuse=0;
      int remonte = 0;
      List envoieNonReussit = new ArrayList();

      /* For every formation that we want to remove */
      for (int i = 0; i < formations.length; i++) {
       
        String labelidf = formations[i];
        String[] lesdeux = labelidf.split("_");
        Formation f = new Formation();
        f.setId(Integer.parseInt(lesdeux[1]));
        f.setLabel(lesdeux[0]);
       
        Etat e = new Etat();
        e.setState(Folder.FOLDER_REFUSED);
        beforeRefuse = refuse;
       
        /* Refusing the candidate*/
        refuse += foldermanager.storeAdvancement(id, e, f);
        /*If correctly refused*/
        if(beforeRefuse!=refuse){
          /*Moving the first on the complementary list to the principal list */
          int pi_first = foldermanager.findPersonalInfoByFormationAndComplementaryPosition(f.getId());
         
          Etat newAdmit = new Etat();
          newAdmit.setState(Folder.FOLDER_ACCEPTED);
          remonte = foldermanager.storeAdvancement(pi_first, newAdmit, f);
          /* If correctly transfered from complementary to principal list */
          if(remonte != 0){
            /* Sending email to the new accepted */
            PersonalInfo personalInfo = foldermanager.findPersonalInfoById(pi_first);
            String responsableEmail = (String)foldermanager.findResponsableEmailByFormation(f.getId()).get(0);
            String path = request.getSession().getServletContext().getRealPath("/");
            MailSenDer md = new MailSenDer(path + "mail.properties");
            String mail = md.sendEvolutionComplementaryToPrincipalListMail(personalInfo.getEmail(),personalInfo.getLastname()+" "+personalInfo.getFirstname(), responsableEmail, f.getLabel());
            if(!mail.equals("")){
              envoieNonReussit.add(mail);
            }
          }
          remonte = 0;
        }
      }
     
      if(refuse==formations.length && envoieNonReussit.isEmpty()){
        page.add("Confirmation");
      }else{
        page.add("Confirmations et Echecs");
      }
      if(refuse==formations.length){
        message += "Le d�sistement du candidat a r�ussit. ";
      }else{
        message += "Le d�sistement du candidat n'a pas r�ussit correctement. ";
      }
      if(envoieNonReussit.isEmpty()){
        message += "La notification des premiers sur les listes compl�mentaires a r�ussit. ";
      }else{
        message += "La notification des premiers sur les listes compl�mentaires n'a pas r�ussit pour les adresses suivantes : ";
        for (Iterator iterMails = envoieNonReussit.iterator(); iterMails
            .hasNext();) {
          String email = (String) iterMails.next();
          message += email+" ";
        }
      }
      model.put("page",page);
      model.put("message",message);
     
     
    }else if (pieces != null && pieces.length > 0) {
      int id = Integer.parseInt(sId);
      boolean envoye = false;
      Folder folder = foldermanager.findFolderById(id);
      String path = request.getSession().getServletContext().getRealPath(
          "/");
      MailSenDer msd = new MailSenDer(path + "mail.properties");
      //for (int i = 0; i < pieces.length; i++) {
      envoye = msd.sentPiecesManquantes(pieces, folder.getPi().getEmail(), folder.getPi().getLastname() + " "+ folder.getPi().getFirstname());
      if(envoye){
        int update = this.foldermanager.updatePersonalInfoState(id,Folder.FOLDER_INCOMPLETE);
        if(update == 0){
          page.add("Confirmation et Echec");
          message = "Le mail avec les pieces manquantes a �t� envoy� au candidat mais le dossier n\'a pas �t� marqu� incomplet.";
View Full Code Here

      be.rejectValue("email", "email.invalid", "Adresse inconnue");
      return showForm(request, response, be);
    } else {
      String path = request.getSession().getServletContext().getRealPath(
          "/");
      MailSenDer ms = new MailSenDer(path + "mail.properties");
      ms.senLostPass(email, pi.getLastname() + " " + pi.getFirstname(),
          pi.getPassword());
      model.put("email", email);
      return new ModelAndView("pass-sent", model);
    }
View Full Code Here

    smng.saveSkills(folder.getSkills());

    /** Sends an email to the student */

    String path = request.getSession().getServletContext().getRealPath("/");
    MailSenDer ms = new MailSenDer(path + "mail.properties");
    int res = ms.sendPassword(folder.getPi().getEmail(), folder.getPi()
        .getLastname()
        + " " + folder.getPi().getFirstname(), folder.getPi()
        .getPassword());

    Map model = new HashMap();
View Full Code Here

TOP

Related Classes of util.MailSenDer

Copyright © 2018 www.massapicom. 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.