|
|
|
Small implementation specification :
The NotificationService should be a component that registers notifications that have a name and a collection of events that they should "process". In the contrib xml should be represented as Entities with a String name and a list of strings that represent events. Users should be able to subscribe to certain notifications. The persistence should be done using the placeful service, registering 2 entities(annotations). One for the user / notification association, and a different one for group / notification association. UsersSubscriptions : username + notification(unique name) GroupsSubscriptions : group_id + notification The subscriptions service should be used asynchonuously to alert a MDB that should send emails according to the existing subscriptions. The MDB may be implemented as a SEAM component(because it needs the email_template.xhtml) but it should reside in the webapp project. I've attached a sequence diagram that shows how the event should be processed in order to register a message in the Nuxeo message queue. After the registration the MDB should asynchronuously process the events and send out emails. I'm waiting for the approval ! Attached sequence diagram for the implementation specification.
Here is some comments.
1/ a notification is registered through an extension point and is defined by: a name, a set of events, a template, a channel (email, jabber, etc. for now only email is available but you need the "NotificationChannel" and "NotificationTransport" concepts) 2/ You don't need a UserSubscription and a GroupSubscription, just use Subscription and the same system as in the right management (user:username and group:groupname or something like that). 3/ If you can use SEAM and within the required context, it's perfect. If not use a Freemarker based templating system. Now I'm stuck on this exception at startup of JBoss :
17:53:44,937 INFO [Ejb3Configuration] found EJB3 Entity bean: org.nuxeo.ecm.platform.ec.placeful.SubscriptionConfig 17:53:44,937 WARN [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null. 17:53:45,015 WARN [ServiceController] Problem starting service persistence.units:ear=nuxeo.ear,jar=nxplacefulservice.jar,unitName=nxplacefulservice javax.persistence.PersistenceException: [PersistenceUnit: nxplacefulservice] class or package not found at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:965) Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.nuxeo.ecm.platform.ec.notification.UserSubscription at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212) Yes, in that case all users should get the notification.
The notification Tab should filters the subscriptions based on the permission of the user :
- if user has the Administer permission : he should see all subscriptions - if not, he will see only his subscriptions And yes, you should list the subscriptions and not the events. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
org.nuxeo.ecm.ec.email