/** * Registered this {@link NotificationAction} with the * {@link NotificationService}. Typically invoked by DI framework. */ public void init() { NotificationEdit notification = notificationService.addTransientNotification(); // we're only interested in being notified of site deletions notification.setFunction(SiteService.SECURE_REMOVE_SITE); // reiterate that we're only interested in site deletions (likely overkill) notification.setResourceFilter(SiteService.REFERENCE_ROOT); // assign this object as the actual action to be fired on site deletions notification.setAction(this); }
notification.setFunction(UsageSessionService.EVENT_LOGOUT);
edit.setFunction(RWikiObjectService.EVENT_RESOURCE_ADD); edit.addFunction(RWikiObjectService.EVENT_RESOURCE_WRITE); edit.addFunction(RWikiObjectService.EVENT_RESOURCE_READ);
edit.setFunction(EVENT_RESOURCE_AVAILABLE); edit.addFunction(EVENT_RESOURCE_WRITE); dbNoti.setFunction(EVENT_RESOURCE_AVAILABLE); dbNoti.addFunction(EVENT_RESOURCE_WRITE);
edit.setFunction(eventId(SECURE_ADD)); edit.addFunction(eventId(SECURE_UPDATE_OWN)); edit.addFunction(eventId(SECURE_UPDATE_ANY));
/** * Final initialization, once all dependencies are set. */ public void init() { try { super.init(); // register a transient notification for mail NotificationEdit edit = m_notificationService.addTransientNotification(); // set function edit.setFunction(eventId(SECURE_ADD)); // set the filter to any email resource (see messageReference()) edit.setResourceFilter(getAccessPoint(true) + Entity.SEPARATOR + REF_TYPE_MESSAGE); // set the action edit.setAction(new SiteEmailNotificationMail()); // register functions FunctionManager.registerFunction(eventId(SECURE_READ)); FunctionManager.registerFunction(eventId(SECURE_ADD)); FunctionManager.registerFunction(eventId(SECURE_REMOVE_ANY)); // entity producer registration m_entityManager.registerEntityProducer(this, REFERENCE_ROOT); M_log.info("init()"); } catch (Throwable t) { M_log.warn("init(): ", t); } } // init
public void init() { m_relativeAccessPoint = REFERENCE_ROOT; NotificationEdit edit = notificationService.addTransientNotification(); edit.setFunction(EVENT_SYLLABUS_POST_NEW); edit.addFunction(EVENT_SYLLABUS_POST_CHANGE); edit.addFunction(EVENT_SYLLABUS_DELETE_POST); edit.addFunction(EVENT_SYLLABUS_READ); edit.addFunction(EVENT_SYLLABUS_DRAFT_NEW); edit.addFunction(EVENT_SYLLABUS_DRAFT_CHANGE); edit.setResourceFilter(getAccessPoint(true)); edit.setAction(new SiteEmailNotificationSyllabus()); entityManager.registerEntityProducer(this, REFERENCE_ROOT); functionManager.registerFunction(SECURE_ADD_ITEM); functionManager.registerFunction(SECURE_BULK_ADD_ITEM); functionManager.registerFunction(SECURE_BULK_EDIT_ITEM); functionManager.registerFunction(SECURE_REDIRECT); }