Package com.jada.content.template

Examples of com.jada.content.template.TemplateEngine


        ItemInfo itemInfo = api.getItem(Format.getLong(itemId), false);
        dataList.add(itemInfo);
      }
     
      // merge with template and stream.
    TemplateEngine engine = TemplateEngine.getInstance();
    engine.init(request, this.getServlet().getServletContext(), true);
    ItemCompareInfo itemCompareInfo = new ItemCompareInfo();
    itemCompareInfo.setItemCompareList(dataList);
    String body = engine.mergeData("components/compare/compareItemList.vm", "itemCompareInfo", itemCompareInfo);
    streamWebService(response, body);
      return null;
    }
View Full Code Here


         return value.booleanValue();
    }
   
    protected void createEmptyTemplateInfo(HttpServletRequest request) throws IOException, Exception {
      boolean empty = true;
      TemplateEngine engine = TemplateEngine.getInstance();
      engine.init(request, getServlet().getServletConfig().getServletContext(), empty);
    EmptyTemplateInfo emptyTemplateInfo =  engine.getEmptyTemplateInfo();
    request.setAttribute("emptyTemplateInfo", emptyTemplateInfo);
    }
View Full Code Here

    request.setAttribute("emptyTemplateInfo", emptyTemplateInfo);
    }

    protected void createEmptySecureTemplateInfo(HttpServletRequest request) throws IOException, Exception {
      boolean empty = true;
      TemplateEngine engine = TemplateEngine.getInstance();
    engine.init(request, getServlet().getServletConfig().getServletContext(), empty);
    EmptyTemplateInfo emptyTemplateInfo =  engine.getEmptySecureTemplateInfo();
    request.setAttribute("emptyTemplateInfo", emptyTemplateInfo);
    }
View Full Code Here

    request.setAttribute("emptyTemplateInfo", emptyTemplateInfo);
    }
   
    protected void createEmptyPrintTemplateInfo(HttpServletRequest request) throws IOException, Exception {
      boolean empty = true;
      TemplateEngine engine = TemplateEngine.getInstance();
      engine.init(request, getServlet().getServletConfig().getServletContext(), empty);
    EmptyTemplateInfo emptyTemplateInfo =  engine.getEmptyPrintTemplateInfo();
    request.setAttribute("emptyTemplateInfo", emptyTemplateInfo);
    }
View Full Code Here

      }
    }
    SiteDomainParamBean siteDomainParamBean = SiteDomainDAO.getSiteDomainParamBean(contentBean.getContentSessionBean().getSiteDomain().getSiteDomainLanguage(), siteDomainLanguage);
    Site site = siteDomain.getSite();

    TemplateEngine engine = TemplateEngine.getInstance();
    engine.init(request, servletContext, true);
    engine.setParameter("orderHeaderId", orderHeader.getOrderHeaderId());
    String body = engine.mergeData("mail/custSaleConfirmation.vm", "template", engine);
        Mailer mailer = new Mailer(site);

        String mailFrom = siteDomainParamBean.getMailFromCustSales();
        String subject = siteDomainParamBean.getSubjectCustSales();
        String mailTo = orderHeader.getCustEmail();
        if (mailFrom == null) {
          mailFrom = "";
        }
        if (subject == null) {
          subject = "";
        }
        if (Format.isNullOrEmpty(mailFrom) || Format.isNullOrEmpty(mailTo)) {
          logger.error("Unable to send customer sales email");
          logger.error("mailFrom = " + mailFrom);
          logger.error("mailTo = " + mailTo);
          logger.error("subject = " + subject);
        }
        mailer.sendMail(mailFrom, mailTo, subject, body, "text/html");
       
    body = engine.mergeData("mail/adminSaleNotification.vm", "template", engine);
    mailTo = siteDomainParamBean.getCheckoutNotificationEmail();
        mailFrom = siteDomainParamBean.getMailFromNotification();
        subject = siteDomainParamBean.getSubjectNotification();
        if (!Format.isNullOrEmpty(mailFrom) && !Format.isNullOrEmpty(mailTo)) {
          mailer.sendMail(mailFrom, mailTo, subject, body, "text/html");
View Full Code Here

      }
    }
    SiteDomainParamBean siteDomainParamBean = SiteDomainDAO.getSiteDomainParamBean(siteDomain.getSiteDomainLanguage(), siteDomainLanguage);
    Site site = siteDomain.getSite();
   
    TemplateEngine engine = TemplateEngine.getInstance();
    engine.init(orderHeader.getSiteDomain(),
          orderHeader.getSiteProfile(),
          orderHeader.getSiteCurrency(),
          servletContext);
    engine.setParameter("orderHeaderId", orderHeader.getOrderHeaderId());
    String body = engine.mergeData("mail/shippingQuote.vm", "template", engine);
        Mailer mailer = new Mailer(site);

        String mailFrom = siteDomainParamBean.getMailFromShippingQuote();
        String subject = siteDomainParamBean.getSubjectShippingQuote();
        String mailTo = orderHeader.getCustEmail();
View Full Code Here

            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
     
      String data = "";
      TemplateEngine engine = TemplateEngine.getInstance();
      engine.init(request, this.getServlet().getServletConfig().getServletContext());
    data =  engine.mergeData("template.vm");
        OutputStream outputStream;
    outputStream = response.getOutputStream();
        outputStream.write(data.getBytes("UTF-8"));
        outputStream.flush();
View Full Code Here

TOP

Related Classes of com.jada.content.template.TemplateEngine

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.