Jean-Vincent Drean wrote:
Hi,
I wrote a POC about document types a while back. Some mockups are available [1]. Summary:
- Introduce a new property in xwiki classes: class type. 3 different class types: document type, document meta, system. More below. - Make defaultViewSheet and defaultEditSheet properties (BaseClass) persistent. - New Document API methods : getViewSheet, getEditSheet. Those methods loop over documents objects and resolve the sheet to use. -- On the first object from a "document type" class (Users, Blog articles, etc) the sheet to use for this class is returned. -- Document meta / System classes (comments, tags, etc) never trigger the use of a sheet. - When viewing/editing a page getViewSheet/getEditSheet is called and the returned sheet is used. - If there's no object from a "document type" class in a document, "document meta" objects are displayed before or after the content (depending on a class property) with their custom viewSheet/editSheet or with the default sheet we provide (an improved version of what we currenlty have in the object editor).
If we all agree that this is what we want to handle document types then I think the best would be to develop the first part ("document types" handling) during 1.9. If we can't develop this in the timeframe, adding viewSheet/editSheet properties to XWikiDocument does not conflict with the scenario above (they could be the first properties checked by Document#get*Sheet). The only issue I foresee is that it could make things look more complex when we'll have class types and everything. WDYT ?
+1, I reached the same conclusion, and I already started working on this. If you also have some code, we should merge efforts.
[1] : http://dev.xwiki.org/xwiki/bin/view/Design/OverhaulOfXWikiClassesAndObjectsM...
-- Sergiu Dumitriu http://purl.org/net/sergiu/