Merge from master
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/d8c9479d Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/d8c9479d Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/d8c9479d Branch: refs/heads/master Commit: d8c9479dd1f14d8af8f2d5bd6ded992c40e2cfe6 Parents: 79b1e80 6d120f7 Author: Francesco Chicchiriccò <[email protected]> Authored: Fri Jun 5 16:53:03 2015 +0200 Committer: Francesco Chicchiriccò <[email protected]> Committed: Fri Jun 5 16:53:03 2015 +0200 ---------------------------------------------------------------------- .../syncope/client/console/pages/Reports.java | 12 ++ .../syncope/client/console/pages/Tasks.java | 9 ++ .../console/panels/NotificationTasks.java | 3 + .../client/console/panels/RuntimePanel.java | 130 +++++++++++++++++++ .../client/console/panels/SchedTasks.java | 3 + .../client/console/panels/SyncTasksPanel.java | 6 +- .../client/console/rest/JobRestClient.java | 31 +++++ .../client/console/rest/ReportRestClient.java | 25 +++- .../client/console/rest/TaskRestClient.java | 25 +++- .../html/repeater/data/table/JobColumn.java | 66 ++++++++++ .../syncope/client/console/pages/Reports.html | 13 ++ .../syncope/client/console/pages/Tasks.html | 15 +++ .../client/console/panels/RuntimePanel.html | 49 +++++++ .../syncope/core/logic/AbstractJobLogic.java | 15 ++- .../api/notification/NotificationManager.java | 4 +- .../notification/NotificationManagerImpl.java | 8 +- pom.xml | 6 +- 17 files changed, 410 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/d8c9479d/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java ---------------------------------------------------------------------- diff --cc core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java index 776b8db,900abc7..a0469a2 --- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java +++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java @@@ -271,31 -266,29 +271,32 @@@ public class NotificationManagerImpl im final Object output, final Object... input) { - SubjectType subjectType = null; - Subject<?, ?, ?> subject = null; - List<NotificationTask> notificationList = new ArrayList<NotificationTask>(); + Any<?, ?, ?> any = null; if (before instanceof UserTO) { - subjectType = SubjectType.USER; - subject = userDAO.find(((UserTO) before).getKey()); + any = userDAO.find(((UserTO) before).getKey()); } else if (output instanceof UserTO) { - subjectType = SubjectType.USER; - subject = userDAO.find(((UserTO) output).getKey()); + any = userDAO.find(((UserTO) output).getKey()); + } else if (before instanceof AnyObjectTO) { + any = anyObjectDAO.find(((AnyObjectTO) before).getKey()); + } else if (output instanceof AnyObjectTO) { + any = anyObjectDAO.find(((AnyObjectTO) output).getKey()); } else if (before instanceof GroupTO) { - subjectType = SubjectType.GROUP; - subject = groupDAO.find(((GroupTO) before).getKey()); + any = groupDAO.find(((GroupTO) before).getKey()); } else if (output instanceof GroupTO) { - subjectType = SubjectType.GROUP; - subject = groupDAO.find(((GroupTO) output).getKey()); + any = groupDAO.find(((GroupTO) output).getKey()); } - LOG.debug("Search notification for [{}]{}", subjectType, subject); + AnyType anyType = any == null ? null : any.getType(); + LOG.debug("Search notification for [{}]{}", anyType, any); ++ List<NotificationTask> notifications = new ArrayList<>(); for (Notification notification : notificationDAO.findAll()) { - LOG.debug("Notification available user about {}", notification.getUserAbout()); - LOG.debug("Notification available group about {}", notification.getGroupAbout()); + if (LOG.isDebugEnabled()) { + for (AnyAbout about : notification.getAbouts()) { + LOG.debug("Notification about {} defined: {}", about.getAnyType(), about.get()); + } + } if (notification.isActive()) { String currentEvent = AuditLoggerName.buildEvent(type, category, subcategory, event, condition); @@@ -318,18 -314,23 +319,21 @@@ model.put("output", output); model.put("input", input); - if (subject instanceof User) { - model.put("user", userDataBinder.getUserTO((User) subject)); - } else if (subject instanceof Group) { - model.put("group", groupDataBinder.getGroupTO((Group) subject)); + if (any instanceof User) { + model.put("user", userDataBinder.getUserTO((User) any)); + } else if (any instanceof Group) { + model.put("group", groupDataBinder.getGroupTO((Group) any)); } - taskDAO.save(getNotificationTask(notification, any, model)); - NotificationTask notificationTask = getNotificationTask(notification, subject, model); ++ NotificationTask notificationTask = getNotificationTask(notification, any, model); + notificationTask = taskDAO.save(notificationTask); - notificationList.add(notificationTask); ++ notifications.add(notificationTask); } } else { - LOG.debug("Notification {}, userAbout {}, groupAbout {} is deactivated, " - + "notification task will not be created", notification.getKey(), - notification.getUserAbout(), notification.getGroupAbout()); + LOG.debug("Notification {} is not active, task will not be created", notification.getKey()); } } - return notificationList; ++ return notifications; } private String getRecipientEmail( http://git-wip-us.apache.org/repos/asf/syncope/blob/d8c9479d/pom.xml ----------------------------------------------------------------------
