+ "s";
// no linefeed at the end!!!
boolean first = true;
MessagePart topMsg = report.getTopMessagePart();
Properties properties = report.getExtraProperties();
if (properties == null) {
properties = new Properties();
report.setExtraProperties(properties);
}
Collection<Map<String, Object>> details = new ArrayList<Map<String, Object>>();
properties.put("jobs", details);
for (JobInfo info : jobInfoList) {
if (first) {
topMsg.setMessage(String.format(formattedLine, TITLE_NAME, TITLE_JOBID, TITLE_TIME, TITLE_STATE,TITLE_EXITCODE,TITLE_USER ));
first = false;
}
MessagePart msg = topMsg.addChild();
msg.setMessage(String.format(formattedLine, info.jobName, info.jobId, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(info.commandExecutionDate), info.state,info.exitCode,info.user));
Map<String, Object> detail = new HashMap<String, Object>();
details.add(detail);
detail.put(NAME, info.jobName);
detail.put(ID, info.jobId);
detail.put(DATE, new Date(info.commandExecutionDate));