Hi Thomas,

I managed to do what I wanted. Apparently I mixed up some of the environments. 
I used the DocumentClass to get a document after I set did the setWiki() but 
that didn’t work. Once I switched to the XWikiDocument, it worked like a charm. 
I will most likely have to do some rework to have access to my components from 
a job :-)

Thanks for the help by answering my questions.

Br,

Peter

Van: Thomas Mortagne <[email protected] 
<mailto:[email protected]>>
Onderwerp: Antw.: [xwiki-users] Question on Jobs and context (Peter Huisman)
Datum: 16 november 2015 18:27:13 CET
Aan: XWiki Users <[email protected] <mailto:[email protected]>>
Antwoord aan: XWiki Users <[email protected] <mailto:[email protected]>>


You should never use the same ExecutionContext or XWikiContext in
different threads since they are really not designed for this and you
will have weird random issue at best.

You can find a example of a component getting the current XWikiContext
and setting the current wiki id on
https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-storage/src/main/java/org/xwiki/mail/internal/DatabaseMailStatusStore.java#L73
 
<https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-mail/xwiki-platform-mail-send/xwiki-platform-mail-send-storage/src/main/java/org/xwiki/mail/internal/DatabaseMailStatusStore.java#L73>.
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to