You should not use xwiki.getDocument
. You can get the previous XWikiDocument
using docSource.originalDocument
.
Note that if you are only listening to DocumentUpdatingEvent you won’t be called for new document (just making sure you are aware of it ).
What do you mean by “fail” exactly ? You get some error ?
I don’t really understand what is the link between the first extract and “The Entire Code” since can’t find it in it.