Hi.
I’m trying to set up an Event Listener on the DocumentRenamingEvent as Wiki Component and can not make it work.
I followed the Tutorial for Writing an Event Listener and my test works when I’m listening to DocumentCreatingEvent, DocumentUpdatingEvent or DocumentDeletingEvent, but not for DocumentRenamingEvent. I’ve tried DocumentRenamedEvent, EntitiesRenamedEvent, DocumentCopiedEvent and DocumentCopyingEvent, too and it doesn’t work either.
Ran into this issue again, with DocumentRenamedEvent. The event doesn’t fire at all, even if the listener is loaded correctly. When listening for DocumentUpdatedEvent or XObjectUpdatedEvent, it works.
If this is a bug, I think it might have something to do with DocumentRenamedEvent and DocumentRenamingEvent being part of the org.xwiki.refactoring.event package, while most other events are part of com.xpn.xwiki.internal.event or org.xwiki.bridge.event. Maybe the groovy macro is missing some import paths or something along those lines?
Edit: It also seems like the last argument to onEvent (which is supposed to be the context) is always null, no matter what event I listen to. I don’t know what that is about, or if it is related
Tried with the Script Components but I couldn’t get them to work at all, mistake on my part.