Two idea of base core tools : SuperClass and XWikiApplication
Hello, First of all sorry for the my english, I hope it's understandable. For the multiwiki plugin (mostly used for XEM product) needs I had started to make some JAVA tools mostly for plugins development that can be useful for others. I will expose you the ideas to let everyone discuss around and see what I can change. First implementation (to illustrate) of theses ideas are in jira. SUPERCLASS: http://jira.xwiki.org/jira/browse/XWIKI-1576 First the "SuperClass" concept: not very original (inspired by "com.xpn.xwiki.plugin.userdirectory.Group" class), it's a Xwiki Class and Xwiki Object management tool. It automate some very common actions and assure that needed Class document exist and is valid. It's composed in two interfaces and their abstract default implementations : ISuperClass (and AbstractSuperClass) and IsuperDocument (and IsuperDocument). SuperClass : manage the Xwiki Class document : - first it assure that when using it the class exists in the database with all needed feelds. Not only the Class but also the ClassSheet and the ClassTemplate documents. - it generate, based on the actual pseudo xwiki product implementation norm, all the "ClassName", "FullClassName", "ClassSpace", "ClassSheetName", etc. SuperDocument : manage document containing one instance object of this XwikiClass : just encapsulate XwikiDocument and Document and simplify creation, saving, deleting, merging. These two java classes had to be extended with the type we want to manage (Group, User, Application, Wiki, etc.). XWIKI APPLICATION: http://jira.xwiki.org/jira/browse/XWIKI-1577 (also a example of "SuperClass" use) To create a new sub wiki in XEM from template I need to determine in the "template" wiki which document have to be copied and which included. For this I think that have a real "Xwiki Application" descriptor can be very useful. My implementation is composed in a mainly document that contains all application configuration: - application name (that can be different from Document name) - other applications dependencies - document that application contains (that is not in other applications dependencies) - in theses documents which have to be included and other field that I had not implemented yet but can be very soon: - plugins dependencies - in theses document which have to be linked (need that XWiki support this concept) For now my "application packager" just give to the actual xwiki xar packager all the documents including applications descriptors documents and make a xar file with all this. I think an other format that a maven plugin can parse like XML application descriptor to generate the package combining all the applications dependencies can be made later. Regards, Thomas
participants (1)
-
Thomas Mortagne