Package org.structr.core.entity

Examples of org.structr.core.entity.MailTemplate


    final DecimalFormat numberFormat2 = new DecimalFormat("0000.0000", DecimalFormatSymbols.getInstance(Locale.GERMAN));
    final DecimalFormat numberFormat3 = new DecimalFormat("####", DecimalFormatSymbols.getInstance(Locale.SIMPLIFIED_CHINESE));
    final String numberString1        = numberFormat1.format(2.234);
    final String numberString2        = numberFormat2.format(2.234);
    final String numberString3        = numberFormat3.format(2.234);
    MailTemplate template             = null;
    MailTemplate template2             = null;
    TestOne testOne                   = null;
    TestTwo testTwo                   = null;
    TestThree testThree               = null;
    TestFour testFour                 = null;
    List<TestSix> testSixs            = null;
    int index                         = 0;

    try (final Tx tx = app.tx()) {

      testOne        = createTestNode(TestOne.class);
      testTwo        = createTestNode(TestTwo.class);
      testThree      = createTestNode(TestThree.class);
      testFour       = createTestNode(TestFour.class);
      testSixs       = createTestNodes(TestSix.class, 20);

      for (final TestSix testSix : testSixs) {
        testSix.setProperty(TestSix.index, index++);
      }

      // create mail template
      template = createTestNode(MailTemplate.class);
      template.setProperty(MailTemplate.name, "TEST");
      template.setProperty(MailTemplate.locale, "en_EN");
      template.setProperty(MailTemplate.text, "This is a template for ${this.name}");

      // create mail template
      template2 = createTestNode(MailTemplate.class);
      template2.setProperty(MailTemplate.name, "TEST2");
      template2.setProperty(MailTemplate.locale, "en_EN");
      template2.setProperty(MailTemplate.text, "${this.aDouble}");

      // check existance
      assertNotNull(testOne);

      testOne.setProperty(TestOne.name, "A-nice-little-name-for-my-test-object");
View Full Code Here


      if (localeString != null) {
        query.and(MailTemplate.locale, localeString);
      }

      MailTemplate template = query.getFirst();
      if (template != null) {

        final String text = template.getProperty(MailTemplate.text);
        return text != null ? text : defaultValue;

      } else {

        return defaultValue;
View Full Code Here

TOP

Related Classes of org.structr.core.entity.MailTemplate

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.