protected LogEvent prepareLogEvent(LogEvent.Types eventType) { LogEvent logEvent = new LogEvent(); logEvent.setType(eventType); User user = (User) VaadinSession.getCurrent().getAttribute(User.class.getName()); logEvent.setUserName(user.getName()); user = null; logEvent.setIp(UI.getCurrent().getPage().getWebBrowser().getAddress()); logEvent.setResult(this.getClass().getName()); logEvent.setAction(this.getClass().getName()); logEvent.setViewName(view.getName()); logEvent.setCreateDate(new Date()); logEvent.setEntity(null); return logEvent; }
public void operate(String theName) throws Exception { if (controller.getEntity() != null) view.setViewToEntity(); Method method = null; try { method = controller.getClass().getMethod(theName, controller.getEntity().getClass()); if (method != null) method.invoke(controller, controller.getEntity()); log(); executeAfterController(); } catch (Exception e) { Notification.show( theName + " Islemi Sirasinda Hata Olustu. " + e.getMessage(), Type.ERROR_MESSAGE); throw e; } }