Hi devs,
In order to integrate XWiki in a portal (
http://dev.xwiki.org/xwiki/bin/view/Drafts/PortletIntegration ) we need
to change a bit the front end to:
* ensure XWiki's HTML element IDs are unique within the portal page
* ensure XWiki's stylesheets doesn't affect other portlets and the
portal page itself
* ensure XWiki content is not affected by stylesheets of other portlets
or the portal page itself
We could do the following:
(1) "Mark" IDs and class names whenever they are used in JavaScript
code, both in-line and stand-alone, using two identify functions:
id(String) and className(String). This is required because identifying
automatically IDs and class names in JavaScript code is not always possible.
(2) Automatically rewrite IDs and class names in CSS and HTML (except
in-line JavaScript) and "marked" IDs and class names in both in-line and
stand-alone JavaScript code before the response for each of the
resources (page included) reaches the client. This can be easily done in
the XWiki portlet bridge (
http://svn.xwiki.org/svnroot/xwiki/contrib/sandbox/xwiki-portlet/ ).
Final IDs and class names will include the portlet identifier and the
XWiki namespace (e.g. a simple 'x' prefix).
(3) Split XWiki's stylesheets (e.g. colibri.css) in two:
(a) general rules, including skin reset
(b) XWiki specific rules (i.e. with selectors including class names or IDs)
and import only (b) in portlet mode.
WDYT?
Thanks,
Marius