I think it is a great idea.. We also need to enhance the lists to have different values in the id and in the test of lists (such lists should also be internationalisable, so based on a dictionnary). The other three types of lists need to be implemented (checkbox, etc..).. It would make sense to make a nice spec of this and start implementing I think the Groovy script should be put in the class itself.. If we need some generic code, it should probably go into the XWiki API or a plugin.. Caching will be an issue to work on.. (caching is easy, expiration is what makes it complex) Ludovic Stéphane Laurière wrote:
Hi XWiki devs,
At Mandriva we have the need for a class property type that would be able to handle dynamic lists. Well, the DBList properties are already dynamic, but we'd need something more dynamic.
Usage examples: * apply some filter to a list of results fetched from the database, * translate the DBList values returned by a SQL query before presenting them to the user * build lists from other sources than the database (from a web service call etc.)
Such lists would be built by a Velocity or Groovy script, declared as an attribute of the class property. What do you think of the feature? Do you have any suggestion on the way it should be implemented? We could either create a new Java type "DynamicList" + new wiki table xwikidynlistclasses, inspired by the "DBList" Java type, or transform the DBList into a "DynamicList" that would handle either Hibernate SQL queries, or Velocity/Groovy scripts. That would be handy also to have the possibility to specify the name of the document containing the script to be executed, if the script is to be reused by several classes.
Stéphane and Christophe
------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic