Package at.molindo.notify.model

Examples of at.molindo.notify.model.Template


    for (File template : keyDir.listFiles()) {
      Matcher m = PATTERN.matcher(template.getName());
      if (m.matches()) {
        try {
          templates.add(new Template().setKey(key).setVersion(Version.valueOf(m.group(1).toUpperCase()))
              .setLocale(m.group(2) == null ? null : new Locale(m.group(2)))
              .setType(Type.valueOf(m.group(3).toUpperCase()))
              .setLastModified(new Date(template.lastModified()))
              .setContent(StreamUtils.string(FileUtils.in(template, Compression.NONE))));
        } catch (IOException e) {
View Full Code Here


  }

  @Override
  public Message render(String key, Version version, IParams params) throws RenderException {

    Template template = NotifyUtils.choose(_templateDAO.findTemplates(key), null, version);

    if (template == null) {
      throw new RenderException("no template available for '" + key + "' (" + version + ")");
    }

    return Message.parse(_renderer.render(template, params), template.getType());
  }
View Full Code Here

TOP

Related Classes of at.molindo.notify.model.Template

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.