Package com.knowgate.dataxslt

Examples of com.knowgate.dataxslt.FastStreamReplacer


    if (bHasReplacements) {
      HashMap oMap = new HashMap(13);
      oMap.put("Message.id", sId);
      StringBuffer oTextBody = new StringBuffer(sTextBody);
      StringBuffer oHtmlBody = new StringBuffer(sHtmlBody);
      FastStreamReplacer oRpl = new FastStreamReplacer();
        for (int r=0; r<nRecipients; r++) {
          String sRecipientAddr = Gadgets.removeChars(aRecipients[r], " \t\r\n");
          if (sRecipientAddr.length()>0) {
            try {
              String sUniqueId = sId+"."+String.valueOf(r+1);
              oMap.remove("Message.id");
              oMap.put("Message.id", sUniqueId);             
              SMTPMessage oCurrentMsg = composeMessage(sSubject, sEncoding, oRpl.replace(oTextBody, oMap), oRpl.replace(oHtmlBody, oMap), sUniqueId, aAttachmentsPath, sUserDir);
              oCurrentMsg.setFrom(new InternetAddress(sFromAddr, null==sFromPersonal ? sFromAddr : sFromPersonal));
              if (null!=sReplyAddr) oCurrentMsg.setReplyTo(new Address[]{new InternetAddress(sReplyAddr)});
              if (DebugFile.trace) DebugFile.writeln("SMTPMessage.setRecipient("+aRecType[r]+","+sRecipientAddr+")");
              oCurrentMsg.setRecipient(aRecType[r], new InternetAddress(sRecipientAddr));     
              sendMessage(oCurrentMsg);
View Full Code Here


  public EmailSender() {
    bHasReplacements = true;
    oFileStr = null;
    oHTMLStr = null;
    oFS = new FileSystem();
    oReplacer = new FastStreamReplacer();
    oDocumentImages = new HashMap<String,String>();
    oMailSession = null;
    oMailTransport = null;
  }
View Full Code Here

  // ---------------------------------------------------------------------------

  public FileDumper() {
    bHasReplacements = true;
    oFileStr = null;
    oReplacer = new FastStreamReplacer();
  }
View Full Code Here

  private FastStreamReplacer oReplacer;

  private FileSystem oFileSys;

  public FTPPublisher() {
    oReplacer = new FastStreamReplacer();
    oFileSys = new FileSystem();
  }
View Full Code Here

      oStmt=null;

      oConn.close("MimeSender");
      oConn=null;
     
      FastStreamReplacer oRplcr = new FastStreamReplacer(sFBody.length()+256);
      try {
        sPersonalizedBody = oRplcr.replace(new StringBuffer(sFBody), FastStreamReplacer.createMap(
                             new String[]{"Data.Name","Data.Surname","Data.Salutation","Data.Legal_Name","Address.EMail","Job.Guid","Job.Atom","Data.Company_Guid","Data.Contact_Guid","Address.URL",
                                          "Datos.Nombre","Datos.Apellidos","Datos.Saludo","Datos.Razon_Social","Direccion.EMail","Lote.Guid","Lote.Atomo","Datos.Guid_Empresa","Datos.Guid_Contacto","Direccion.URL"},

                             new String[]{sNm,sSn,sSl,sCo,sEm,oJob.getString(DB.gu_job),String.valueOf(oAtm.getInt(DB.pg_atom)),sCp,sCn,sIn,
                                          sNm,sSn,sSl,sCo,sEm,oJob.getString(DB.gu_job),String.valueOf(oAtm.getInt(DB.pg_atom)),sCp,sCn,sIn}));
View Full Code Here

  public void run() {
    try {
      Thread.sleep(delay);
    } catch (InterruptedException e) { }
    FastStreamReplacer oRpl = new FastStreamReplacer();
      try {
      MailSessionHandler oHlr = new MailSessionHandler();
      HashMap oMap = FastStreamReplacer.createMap(new String[] {"1","2","3"},
      new String[] {fullname,uid,uuid});
      ByteArrayOutputStream oByOut = new ByteArrayOutputStream();
      PrintStream oPrt = new PrintStream(oByOut);
      InputStream oTxt = getClass().getResourceAsStream("Confirmation.txt");
      InputStream oHtm = getClass().getResourceAsStream("Confirmation.html");
      oHlr.sendMessage("Acceso a zesped", "Zesped", "noreply@zesped.com", "noreply@zesped.com",
      new String[] {email}, RecipientType.TO, oRpl.replace(oTxt, oMap), oRpl.replace(oHtm, oMap),"ISO8859_1", null, null, null, oPrt);
      oPrt.close();
      Log.out.info(oByOut.toString());
      oByOut.close();
      DAO.log(User.class, "SEND ACTIVATION", AtrilEvent.Level.INFO, oByOut.toString());
    } catch (IOException ioe) {
View Full Code Here

  }
 
  public void run() {
    User oUsr = null;
    String sUid;
    FastStreamReplacer oRpl = new FastStreamReplacer();
      MailSessionHandler oHlr = null;
    HashMap<String,Object> oActivationInfo = new HashMap<String,Object>();

      Log.out.debug("Begin AsyncSendInvitation()");
     
      try {
      oHlr = new MailSessionHandler();
    } catch (IOException ioe) {
      Log.out.error("AsyncSendInvitation new MailSessionHandler() "+ioe.getClass().getName()+" "+ioe.getMessage(), ioe);
    }
     
      AtrilSession oSes = DAO.getAdminSession("AsyncSendInvitation");
      oSes.autoCommit(true);
      Dms oDms = oSes.getDms();
    CustomerAccount oAcc = new CustomerAccount(oDms, sAccId);
     
    for (int t=0; t<aTxprs.length; t++) {
      String sTxpId = aTxprs[t];
        TaxPayer oTxp = new TaxPayer (oDms, sTxpId);

        try {

          sUid = User.forEmail(sEmail);
        oUsr = new User(oSes, sUid);
        try {
          oUsr.allowTaxPayer(oSes, oTxp.id());
        } catch (Exception xcpt) {
          Log.out.error("AsyncSendInvitation User.allowTaxPayer() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
        }

        } catch (ElementNotFoundException enfe) {

        String sPwd = Gadgets.generateRandomId(6, "abcdefghjkmnpqrtuvwxyz", Character.LOWERCASE_LETTER);
        sUid = User.create(oSes, sRec1stName, sRec2ndName, sRecEmail, sPwd, false).id();
        oUsr = new User(oSes, sUid);
        oUsr.canApproveInvoices(bApprove);
        oUsr.canSettleBillNotes(bSettle);
        oUsr.canUsePremiumCaptureServiceFlavor(bPremium);
        oUsr.setRole(oSes, oAcc, Role.user);
        oUsr.save(oSes);     

        try {
          oUsr.allowTaxPayer(oSes, oTxp.id());
        } catch (Exception xcpt) {
          Log.out.error("AsyncSendInvitation User.allowTaxPayer() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
        }
       
        HashMap oMap = FastStreamReplacer.createMap(new String[] {"1","2","3","4","5","6"},
                              new String[] {oUsr.getFirstName(), sSender1stName, sSender2ndName, oTxp.getBusinessName() + (aTxprs.length>1 ? " y a otras " + String.valueOf(aTxprs.length-1) + " más": ""), oUsr.id(), sPwd});
          ByteArrayOutputStream oByOut = new ByteArrayOutputStream();
          PrintStream oPrt = new PrintStream(oByOut);             
          try {
              Log.out.debug("sending email");
          oHlr.sendMessage("Acceso a zesped", "Zesped", "noreply@zesped.com", "noreply@zesped.com",
                           new String[] {sEmail}, RecipientType.TO, oRpl.replace(oTxt, oMap), oRpl.replace(oHtm, oMap),
                           "ISO8859_1", null, null, null, oPrt);
        } catch (Exception xcpt) {
          Log.out.error("AsyncSendInvitation MailSessionHandler.sendMessage() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
        }
          oPrt.close();
View Full Code Here

    if (bHasReplacements) {
      HashMap oMap = new HashMap(13);
      oMap.put("Message.id", sId);
      StringBuffer oTextBody = new StringBuffer(sTextBody);
      StringBuffer oHtmlBody = new StringBuffer(sHtmlBody);
      FastStreamReplacer oRpl = new FastStreamReplacer();
        for (int r=0; r<nRecipients; r++) {
          String sRecipientAddr = Gadgets.removeChars(aRecipients[r], " \t\r\n");
          if (sRecipientAddr.length()>0) {
            try {
              String sUniqueId = sId+"."+String.valueOf(r+1);
              oMap.remove("Message.id");
              oMap.put("Message.id", sUniqueId);             
              SMTPMessage oCurrentMsg = composeMessage(sSubject, sEncoding, oRpl.replace(oTextBody, oMap), oRpl.replace(oHtmlBody, oMap), sUniqueId, aAttachmentsPath, sUserDir);
              oCurrentMsg.setFrom(new InternetAddress(sFromAddr, null==sFromPersonal ? sFromAddr : sFromPersonal));
              if (null!=sReplyAddr) oCurrentMsg.setReplyTo(new Address[]{new InternetAddress(sReplyAddr)});
              oCurrentMsg.setRecipient(aRecType[r], new InternetAddress(sRecipientAddr));     
              sendMessage(oCurrentMsg);
              oOut.println("OK "+sRecipientAddr);
View Full Code Here

TOP

Related Classes of com.knowgate.dataxslt.FastStreamReplacer

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.