private void printTicket(String resname, TicketInfo ticket, CustomerInfoExt customer) {
String resource = dlsystem.getResourceAsXML(resname);
if (resource == null) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotprintticket"));
msg.show(this);
} else {
try {
ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.VELOCITY);
script.put("ticket", ticket);
script.put("customer", customer);
ttp.printTicket(script.eval(resource).toString());
} catch (ScriptException e) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotprintticket"), e);
msg.show(this);
} catch (TicketPrinterException e) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotprintticket"), e);
msg.show(this);
}
}
}