Hello.
This proposal is about the following issue:
http://jira.xwiki.org/browse/XWIKI-11803.
Currently, our mechanism to overwrite a skin file in the wiki has some
problems:
1 - we need to add a property in the XWiki.XWikiSkins class for every file
that we want to overwrite. It is not clean to change a system class just to
use a feature. Moreover, all the existing skins are polluted with any new
property added to the class, even if the skin does not need it.
2 - we cannot overwrite a file placed in a subdirectory (like
"less/style.less.vm") since we cannot have the "/" character in a
property
name. This blocks
http://jira.xwiki.org/browse/XWIKI-11394.
To avoid the problem 1, people usually attach their overwriting files to
the skin documents. But it causes some other problems: it is not the wiki
spirit to edit a file locally and then to upload it. It would be far better
to edit the code directly in a textarea.
To fix these 2 problems, I propose a new mechanism, that Eddy have
described previously [1]:
* we create a new XClass called XWiki.XWikiSkinFileOverride.
* this class would contain 2 properties:
** a path (eg: htmlheaders.vm, less/buttons.less...)
** a content (a textarea).
Then, on the skin document, we add one XObject per file that we want to
overwrite. The system is simple and flexible.
(On the future, we can even imagine that XWiki automatically merges the
content of the XObject with the existing file in the skin, but this idea is
not a part of this proposal.)
Depending on the time I will have, I may not be able to fully implement
this for 7.0. So I plan to make it work for the LESS files first, that we
cannot overwrite currently.
Here is my +1,
Thanks
[1]
http://jira.xwiki.org/browse/XWIKI-10568?focusedCommentId=81939&page=co…
--
Guillaume Delhumeau (gdelhumeau(a)xwiki.com)
Research & Development Engineer at XWiki SAS
Committer on the
XWiki.org project