private void sendMml(DocumentModel sendModel) {
Chart chart = (KarteEditor.this).getContext();
// MML Message を生成する
MMLHelper mb = new MMLHelper();
mb.setDocument(sendModel);
mb.setUser(Project.getUserModel());
mb.setPatientId(chart.getPatient().getPatientId());
mb.buildText();
try {
VelocityContext context = ClientContext.getVelocityContext();
context.put("mmlHelper", mb);
// このスタンプのテンプレートファイルを得る
String templateFile = "mml2.3Helper.vm";
// Merge する
StringWriter sw = new StringWriter();
BufferedWriter bw = new BufferedWriter(sw);
InputStream instream = ClientContext.getTemplateAsStream(templateFile);
BufferedReader reader = new BufferedReader(new InputStreamReader(instream, "UTF-8"));
Velocity.evaluate(context, bw, "mml", reader);
bw.flush();
bw.close();
reader.close();
String mml = sw.toString();
//System.out.println(mml);
System.out.println("KarteEditor.sendMml mml=" + mml);
// debug出力を行う
if (ClientContext.getMmlLogger() != null) {
ClientContext.getMmlLogger().debug(mml);
}
if (sendMml && mmlListener != null) {
MmlMessageEvent mevt = new MmlMessageEvent(this);
mevt.setGroupId(mb.getDocId());
mevt.setMmlInstance(mml);
if (mb.getSchema() != null) {
mevt.setSchema(mb.getSchema());
}
mmlListener.mmlMessageEvent(mevt);
}
} catch (IOException ex) {