On Tue, Jan 19, 2016 at 11:31 AM, [email protected] <[email protected]> wrote: > > > On 19 Jan 2016 at 11:24:46, Thomas Mortagne > ([email protected](mailto:[email protected])) wrote: > >> If this class is supposed to be available in the wiki even if not yet >> used in an object the simplest is usually to do like most standard >> classes generated from java and register a component extending >> com.xpn.xwiki.internal.mandatory.AbstractMandatoryDocumentInitializer. >> You can find various examples in oldcore. > > Yes conceptually speaking, the idea is to write an EventListener component > that listens to the ApplicationReadyEvent event and then in the onEvent() > method, create your xclass and perform all the operations you need. > > As Thomas mentioned, you could also extend > AbstractMandatoryDocumentInitializer although this is not a public API and it > may be removed or modified in the future. Note that > MandatoryDocumentInitializer is a public API.
Right, I actually forgot it was internal (yes I know I wrote it and I just copy/pasted the package in the mail :)). I think we should make it public since it's very useful for extensions and we are using it a lot. > > Thanks > -Vincent > >> On Tue, Jan 19, 2016 at 11:18 AM, Giordano NinonĂ >> wrote: >> > Hi users, >> > >> > I am wondering on how to create an XClass from java, and bind it to a >> > class-sheet to be used to represent several objects as XWiki pages. How can >> > I achieve that in a way that allow me to incrementaly update the object >> > every time a modification is performed? >> > >> > Thanks for your help, >> > Giordano. > _______________________________________________ > users mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/users -- Thomas Mortagne _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
