[xwiki-devs] [Proposal] Default edit mode for a page

Luca Anca lucaa at xwiki.com
Thu Mar 24 17:28:40 UTC 2011


Hi all,

starting from the need of the dashboards, to specify the default edit
mode for a page, here's how I would like to implement it, in the
following days.

Context:
There is already a mechanism for this, which works like this: if,
document A includes sheet B and sheet B has an object of type
"XWiki.SheetClass", then clicking the edit button of document A will
automatically open the edit mode specified in the XWiki.SheetClass
object of the sheet B.

Proposal:

1/ I propose an enhancement of the existing mechanism, to allow such an
XWiki.SheetClass object to be attached to the document A directly.
Namely the edit mode for the document A will be read first from the
objects of type XWiki.SheetClass in document A, then if none found, from
the objects in the included sheet.

2/ XWiki.SheetClass should be renamed to XWiki.EditModeClass, or
XWiki.DefaultEditModeClass, or something alike, that suggests its
purpose. Current class name will be deprecated but still preserved for a
good while. What would be your name proposals for this?

3/ optionally, we could deprecate the current mechanism, and say that
objects should never be attached to sheets anymore, only to pages. This
way, the usecase of a sheet should be implemented by adding the
EditModeClass object in the template from which docs are created, so
that it can be easily propagated to a set of documents. 
I am not against the current mechanism, I think it's a nice helper, and
the replacing implementation has the drawback of making it mandatory to
create documents through templates, or manually adding this object in
the doc creation code. Therefore, I would be -0.5 on this. 
WDYT?

4/ optionally, add an edit mode panel (or whatever we want to replace
them with) to change this from a nice UI. This can turn out useful in
cases when such an edit object is added automatically (e.g. dashboards)
and when it's no longer needed (dashboard macro call is deleted from the
page), the default edit mode still stays the one set automatically. This
is  very optional, as I see little cases when users would delete just
the macro call, and not the page as a whole.

Thanks,
Anca





More information about the devs mailing list