slonm / orion-cpu

Automatically exported from code.google.com/p/orion-cpu
0 stars 0 forks source link

Оформить сообщения о проделанной операции. #47

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
1. Оформить компонент Alerts аналогично тому 
как сделано в приложениях Google (см. 
вложение). 
2. Сделать сервис-надстройку над AlertManager.alert, 
с методом, который будет получать 
объект-задачу типа Runnable. Как-то так:

void doWork(Runnable work, String messageFormat, String ... messageArgs){
try {
  work.run();
  alertManager.alert(Duration.TRANSIENT, Severity.INFO,
                    messages.format("message.success."+messageFormat,
                    messageArgs);
        } catch (RuntimeException ex) {
            alertManager.alert(Duration.TRANSIENT, Severity.ERROR,
                    messages.format("message.error."+messageFormat,
                    messageArgs);
//Если непродуктивный режим, то выдать Tapestry 
AJAX сообщение об ошибке.
        }
} 

Пример вызова:

alerter.doWork(new Runable(){
void run(){
es.merge(object);
}
}, "update.entity", messages.get("entity." + entityType),
                    es.getStringValue(object)))

Original issue reported on code.google.com by slobodya...@gmail.com on 1 Mar 2012 at 9:03

Attachments:

GoogleCodeExporter commented 9 years ago
Еще пример

Original comment by slobodya...@gmail.com on 1 Mar 2012 at 9:55

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 53 has been merged into this issue.

Original comment by slobodya...@gmail.com on 13 Mar 2012 at 2:13

GoogleCodeExporter commented 9 years ago
r1055 Надстройка над AlertManager

Original comment by slobodya...@gmail.com on 20 Mar 2012 at 8:23