Package com.iisigroup.cap.formatter

Examples of com.iisigroup.cap.formatter.ADDateTimeFormatter


            val = callback.reformat(data);
          } else {
            val = callback.reformat(val);
          }
        } else if (val instanceof Timestamp) {
          val = new ADDateTimeFormatter().reformat(val);
        } else if (val instanceof Date || val instanceof Calendar) {
          val = new ADDateFormatter().reformat(val);
        }
      //  row.add(String.valueOf(val));
      } catch (Exception e) {
View Full Code Here


      logger.debug("remind items TYPE[2] are empty! Not Execute");
    }
  }

  public void sendEvent(List<Reminds> reminds) {
    ADDateTimeFormatter formatter = new ADDateTimeFormatter();
    HashMap<String, CapUserDetails> allPrincipal = reminderService
        .getCurrentUser();
    if (CollectionUtils.isEmpty(allPrincipal)) {
      logger.debug("principals are empty!");
      return;
    }
    for (Reminds remind : reminds) {
      Remind content = reminderService.findRemind(remind.getPid());
      try {
        NotifyObject data = new NotifyObject();
        data.setTargetId(remind.getScopePid());
        data.setStartTime(formatter.reformat(content.getStartDate()));
        data.setEndTime(formatter.reformat(content.getEndDate()));
        data.setContent(content.getContent());

        CapUserDetails userDetail = allPrincipal
            .get(data.getTargetId());
        if (userDetail != null) {
View Full Code Here

      }
    }
  }

  public void sendEmail(List<Reminds> reminds) {
    ADDateTimeFormatter formatter = new ADDateTimeFormatter();
    for (Reminds remind : reminds) {
      Remind content = reminderService.findRemind(remind.getPid());
      // 主旨
      StringBuffer subject = new StringBuffer();
      subject.append(CapAppContext.getMessage("remind.subject1"));
      subject.append(formatter.reformat(content.getStartDate()));
      subject.append(" ");
      subject.append(CapAppContext.getMessage("remind.subject2"));
      subject.append(CapString.isEmpty(content.getContent()) ? ""
          : content.getContent().substring(
              0,
              content.getContent().length() > 40 ? 40 : content
                  .getContent().length()));
      // 內文
      StringBuffer sendContext = new StringBuffer();
      sendContext.append(CapAppContext.getMessage("remind.startDate"));
      sendContext.append(formatter.reformat(content.getStartDate()));
      sendContext.append("<br/>");
      sendContext.append(CapAppContext.getMessage("remind.endDate"));
      sendContext.append(formatter.reformat(content.getEndDate()));
      sendContext.append("<br/>");
      sendContext.append(CapAppContext.getMessage("remind.subject2"));
      sendContext.append(formatter.reformat(content.getContent()));

      String email = reminderService.getUsrEmail(remind.getScopePid());
      if (email != null) {
        emailService.sendEmail(new String[] { email },
            subject.toString(), sendContext.toString());
View Full Code Here

  private Map<String, Object> getExecutionResult(JobExecution job) {
    String exeId = String.valueOf(job.getId());
    Map<String, Object> map = batchSerivce.findExecutionDetail(exeId);
    map.put("duration", durationFmt.reformat(map));
    map.put("START_TIME",
        new ADDateTimeFormatter().reformat(map.get("START_TIME")));
    String jobParams = jobParametersExtractor
        .fromJobParameters(batchSerivce.findJobParams(exeId));
    map.put("jobParams", jobParams);
    List<Map<String, Object>> steps = batchSerivce.findSteps(exeId);
    for (Map<String, Object> step : steps) {
View Full Code Here

            .append(":00.000"));

    Page<Map<String, Object>> page = batchSrv.findExecutionsPage(search);
    Map<String, IFormatter> fmt = new HashMap<String, IFormatter>();
    fmt.put("startDate", new ADDateFormatter());
    fmt.put("START_TIME", new ADDateTimeFormatter("HH:mm:ss"));
    fmt.put("duration", new DurationFormatter("START_TIME", "END_TIME",
        "HH:mm:ss.SSS"));
    return new MapGridResult(page.getContent(), page.getTotalRow(), fmt);
  }// ;
View Full Code Here

        .findJobParams(instancId));
    AjaxFormResult result = new AjaxFormResult();
    result.set("jobParams", jobParams);
    result.set("JOB_NAME", (String) map.get("JOB_NAME"));
    result.set("START_TIME",
        new ADDateTimeFormatter().reformat(map.get("START_TIME")));
    result.set("duration", new DurationFormatter("START_TIME", "END_TIME",
        "HH:mm:ss.SSS").reformat(map));
    result.set("jobStatus", (String) map.get("STATUS"));
    result.set("EXIT_CODE", (String) map.get("EXIT_CODE"));
    result.set("JOB_EXECUTION_ID",
View Full Code Here

    if (remind != null) {
      Map<String, IFormatter> fmt = new HashMap<String, IFormatter>();
      fmt.put("startDate", new ADDateFormatter());
      fmt.put("endDate", new ADDateFormatter());

      result.set("startTime", new ADDateTimeFormatter("HH:mm")
          .reformat(remind.getStartDate()));
      result.set("endTime", new ADDateTimeFormatter("HH:mm")
          .reformat(remind.getEndDate()));
      result.putAll(new AjaxFormResult(remind.toJSONObject(
          CapEntityUtil.getColumnName(remind), fmt)));
    }
View Full Code Here

            val = callback.reformat(this);
          } else {
            val = callback.reformat(val);
          }
        } else if (val instanceof Timestamp) {
          val = new ADDateTimeFormatter().reformat(val);
        } else if (val instanceof Date || val instanceof Calendar) {
          val = new ADDateFormatter().reformat(val);
        }
        row.add(String.valueOf(val));
      } catch (Exception e) {
View Full Code Here

            val = callback.reformat(this);
          } else {
            val = callback.reformat(val);
          }
        } else if (val instanceof Timestamp) {
          val = new ADDateTimeFormatter().reformat(val);
        } else if (val instanceof Date || val instanceof Calendar) {
          val = new ADDateFormatter().reformat(val);
        }
        json.element(str, val);
      } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.formatter.ADDateTimeFormatter

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.