use of org.nuxeo.ecm.core.event.EventService in project nuxeo-drive-server by nuxeo.
the class NuxeoDriveManagerImpl method fireEvent.
protected void fireEvent(DocumentModel sourceDocument, CoreSession session, String eventName, String impactedUserName) {
EventService eventService = Framework.getService(EventService.class);
DocumentEventContext ctx = new DocumentEventContext(session, session.getPrincipal(), sourceDocument);
ctx.setProperty(CoreEventConstants.REPOSITORY_NAME, session.getRepositoryName());
ctx.setProperty(CoreEventConstants.SESSION_ID, session.getSessionId());
ctx.setProperty("category", NuxeoDriveEvents.EVENT_CATEGORY);
ctx.setProperty(NuxeoDriveEvents.IMPACTED_USERNAME_PROPERTY, impactedUserName);
Event event = ctx.newEvent(eventName);
eventService.fireEvent(event);
}
Aggregations