On Oct 3, 2012, at 12:10 PM, Thomas Mortagne <thomas.mortagne(a)xwiki.com> wrote:
Hi devs,
In order to fix
https://jira.xwiki.org/browse/XWIKI-8180 Extension
Manager XAR handler need to access some way a mandatory document as it
should be when it's "clean" so that It can then be used as previous
version in a 3 ways merge.
For that the idea is to introduce a new component based mandatory
documents initialization and refactor XWiki#initializeMandatoryClasses
to use it.
This new MandatoryDocumentInitializer would allow:
* provide a new mandatory document initializer from an extension since
XWiki#initializeMandatoryClasses would lookup all of them
* find a clean mandatory document state for a given document reference
in extension manager XAR handler since that's the role hint of those
components
You can find an example of what a XWikiPreferencesDocumentInitializer
would look like in
https://github.com/xwiki/xwiki-platform/tree/feature-standardclasses
branch.
WDYT ?
+1 for the idea (haven't looked at the impl. details)
Just note that I'm not sure if we'll want to keep the idea of creating
classes/documents from java code in the future (I'd rather not since it brings
problems like this one), but that's longer term and for now what you propose it
cleaner than what we already have.
Thanks
-Vincent