// Show import messages.
MessageList messages = importResults.getMessages();
Locale locale = LocaleManager.currentLocale();
Iterator it = messages.iterator();
while (it.hasNext()) {
Message message = (Message) it.next();
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()));