Le 1 oct. 2012 à 09:25, Thomas Mortagne a écrit :
The canonical way to check if you are called by a
remote event is by
using the component
org.xwiki.observation.remote.RemoteObservationManagerContex#isRemoteState()
(from xwiki-platform-observation-remote).
How do I get an instance of this from Groovy?
LazyXWikiDocument is what is used when emulating a
document event from
the remote observation module. It's actually supposed to behave like a
XWikiDocument except that it actually load the document from the
database only if something actually need to manipulate it. The only
thing for which it's not supposed to work well is if you try to save
it directly but it's not recommended for a document coming in a local
event anyway since it's creating an events mess. So unless you really
have a specific logic that need to do different things from local and
remote events the best would be that we fix what's wrong with
LazyXWikiDocument in your use case.
It was the request of previous versions which has failed.
All that seems quite curriki specific in there is a simple listener, using the
old-style-notification, which analyzes the document and indexes it and maybe
"related" documents (for example reindexes the user-document so as to display
the count of contributions, or reindexes all of the resources of the user if the user has
changed his name...). The IndexUpdater of the LucenePlugin does not seem to care for this
(but then, it doesn't seem to measure differences).
thanks in advance
Paul