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.
My getEvents Method looks like this:
{{groovy}}
import org.xwiki.bridge.event.*
xcontext.method.output.value = [new DocumentRenamingEvent()]
{{/groovy}}
onEvent:
{{groovy}}
def Testpage = xwiki.getDocument("MyTestPage.Child1.WebHome")
Testpage.setContent("thisisatest")
Testpage.save("testSaveOnRenaming", true)
{{/groovy}}
Any idea what I’m doing wrong?