Search in sources :

Example 1 with EventService

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);
}
Also used : DocumentEventContext(org.nuxeo.ecm.core.event.impl.DocumentEventContext) Event(org.nuxeo.ecm.core.event.Event) EventService(org.nuxeo.ecm.core.event.EventService)

Aggregations

Event (org.nuxeo.ecm.core.event.Event)1 EventService (org.nuxeo.ecm.core.event.EventService)1 DocumentEventContext (org.nuxeo.ecm.core.event.impl.DocumentEventContext)1