Vincent,
I like the general direction for conditional displayers and alternate
displays. In Curriki/XClams, there are presently two factors that affect the
default display. A page is displayed as a learning resource IF it has an
AssetClass AND it resides in a spaces starting with "Coll_" (For resource
collection space.) Now we have often talked about changing the view based on
the role or type of the user, (Student, vs. Teacher vs. Parent, etc.) So how
does that factor in?
There is certainly room for improvement over the current mish-mash of xpage=
and viewer= parameters.
Joshua Marks
CTO
Curriki: The Global Education and Learning Community
jmarks(a)curriki.org
www.curriki.org
-----Original Message-----
From: devs-bounces(a)xwiki.org [mailto:devs-bounces@xwiki.org] On Behalf Of
Vincent Massol
Sent: Sunday, July 22, 2012 8:00 AM
To: XWiki Developers
Subject: [xwiki-devs] [Proposal] Displayer Architecture for the future
Hi devs,
I've been thinking about Displayer architecture today and here are my
thoughts on how I see them implemented (without entering low-level details):
Basics
======
* Everything in XWiki should be a Component and should be able to be
implemented in Java and optionally extended in wiki pages (wiki components
notion)
* Have a Displayer component Role (ie a java interface for displayers)
* Have default implementations in the display module for all basic types we
want to support (textareas, date, string, number, etc). Basically this means
rewriting the current displayers as components.
* Allow to register Displayers defined in wiki pages by using wiki
components (same mechanism as wiki macros).
* Since a lot of Displayers are better written in wiki pages (javascript,
css), create a UI submodule of the current display module which contains
displayers we want bundled by default in XE (for ex for Dates and
Users/Groups)
* Extend the current {{display}} macro to support displaying Objects and
Object Properties (it already supports passing an EntityType parameter but
it's not used ATM).
* The {{display}} macro will use the CM to get an instance of a displayer
for the Object property type. It'll do by finding the XClass and getting the
type from the XClass and then do a getInstance
* Add an optional parameter to the {{display}} macro to support passing a
displayer hint (by default it would use the "default" displayer for the
property type). This will allow some pages to decide which displayer to use
to render their content without being forced to use the default displayer.
Advanced
=========
In order to make it easy for a given class or a given object to decide how
to display itself we could also define some special DisplayerBinding
XObjects (one per property type). It could work like this:
* If the {{display}} macro has the displayer hint specified as parameter
then use it
* If the {{display}} macro doesn't have the displayer hint specified then
check if the xclass document has a DisplayerBinding XObject defined and if
so use the displayer pointed to by the binding
* If the {{display}} macro doesn't have the displayer hint specified and the
xclass document doesn't have a DisplayerBinding XObject defined then check
if the object to display have such an XObject and if so use it
* Deprecate the notion of "custom displayer" that we have in our XClass
since it wouldn't be needed anymore
WDYT?
I know we're not there yet but it would be cool to make progress on the
direction we'd like to take.
Thanks
-Vincent
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs