Locale locale = LocaleManager.currentLocale();
for (Message message : messages) {
switch (message.getMessageType()) {
case Message.ERROR: messagesHandler.addError(message.getMessage(locale)); break;
case Message.WARNING: messagesHandler.addWarning(message.getMessage(locale)); break;
case Message.INFO: messagesHandler.addMessage(message.getMessage(locale)); break;
}
}
} catch (Exception e) {
log.error("Error importing KPIs from file (" + file + ")", e);
messagesHandler.addError(new ExportHandlerMessage("import.kpis.importAbortedError", new Object[] {}).getMessage(LocaleManager.currentLocale()));