Search in sources :

Example 1 with AbstractActionExecutionEvent

use of org.xwiki.bridge.event.AbstractActionExecutionEvent in project xwiki-platform by xwiki.

the class ActionExecutionEventConverter method toRemote.

@Override
public boolean toRemote(LocalEventData localEvent, RemoteEventData remoteEvent) {
    if (localEvent.getEvent() instanceof ActionExecutedEvent || localEvent.getEvent() instanceof ActionExecutingEvent) {
        AbstractActionExecutionEvent event = (AbstractActionExecutionEvent) localEvent.getEvent();
        if (this.actions.contains(event.getActionName())) {
            // fill the remote event
            remoteEvent.setEvent(event);
            remoteEvent.setSource(serializeXWikiDocument((XWikiDocument) localEvent.getSource()));
            remoteEvent.setData(serializeXWikiContext((XWikiContext) localEvent.getData()));
        }
        return true;
    }
    return false;
}
Also used : XWikiDocument(com.xpn.xwiki.doc.XWikiDocument) AbstractActionExecutionEvent(org.xwiki.bridge.event.AbstractActionExecutionEvent) ActionExecutedEvent(org.xwiki.bridge.event.ActionExecutedEvent) XWikiContext(com.xpn.xwiki.XWikiContext) ActionExecutingEvent(org.xwiki.bridge.event.ActionExecutingEvent)

Aggregations

XWikiContext (com.xpn.xwiki.XWikiContext)1 XWikiDocument (com.xpn.xwiki.doc.XWikiDocument)1 AbstractActionExecutionEvent (org.xwiki.bridge.event.AbstractActionExecutionEvent)1 ActionExecutedEvent (org.xwiki.bridge.event.ActionExecutedEvent)1 ActionExecutingEvent (org.xwiki.bridge.event.ActionExecutingEvent)1