On Mon, Sep 19, 2011 at 4:03 PM, Denis Gervalle <dgl(a)softec.lu> wrote:
On Mon, Sep 19, 2011 at 12:15, Marius Dumitru Florea
<
mariusdumitru.florea(a)xwiki.com> wrote:
Hi devs,
One of the features of the new sheet system is that it can
automatically detect and apply sheets. For instance, if you have:
Space.YourClass (no objects)
Space.YourClassSheet (no objects)
Space.YourDocument (with an object of type YourClass and no include
macro call to YourSheet in the content)
YourDocument will be automatically displayed with YourSheet. This
Well, following our discussion on IRC, this is really too much magic.
Associating a sheet with class just by using its document name introduce a
convention on document name. This would be the first time document name
receive a meaning,
Not exactly actually since wiki id is extracted from the wiki
descriptor page name.
and I am -1 releasing this without a larger discussion
on
introducing convention in document name.
Moreover, keeping only explicit binding will automagically ;) solve your
backward compatibility question.
So +1 for keeping only explicit bindings without name convention.
Denis
introduces a backward compatibility problem
because the new sheet
system will be triggered for existing XWiki applications that haven't
been updated to use the new system. One way to prevent this is to
trigger the new system only if XWikDocumenti#getDefaultEditMode()
returns "edit" (it should return "inline" for current XWiki
applications). XWikiDocument#getDefaultEditMode() uses two classes,
EditModeClass and SheetClass, to determine the default edit mode.
EditModeClass was recently introduced so most of the current XWiki
applications are still using the deprecated SheetClass.
In the new sheet system I needed a class to describe a sheet and I
opted for reusing the name of an existing class, SheetClass, because
IMO it is the best name for a class describing a sheet. As a
consequence the current implementation of
XWikiDocument#getDefaultEditMode() will return "inline" if you try to
include a sheet in the content of a document. This limits the new
sheet system because you should be able to do anything with the
document content, even including another sheet.
I talked with Vincent about this and we found three solutions:
(1) Change XWikiDocument#getDefaultEditMode() to use only the
EditModeClass. The breaks backward compatibility because current
applications have to update their sheets to use EditModeClass instead
of SheetClass (if they want to keep the old behavior)
(2) Use XWikiDocument#getDefaultEditMode() only if a backward
compatibility configuration flag is set. This means that the
limitation I mentioned above (can't include a sheet in the document
content) will be true only if you want backward compatibility.
(3) Use a different name for the class describing the sheet, e.g.
SheetDescriptorClass. This way XWikiDocument#getDefaultEditMode() will
keep returning "inline" for applications that are still using the
deprecated SheetClass.
I'm going to implement (3) if no one is against it.
Thanks,
Marius
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Denis Gervalle
SOFTEC sa - CEO
eGuilde sarl - CTO
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne