Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
0.9.840
-
None
-
list dynamic property
-
Low
-
Description
Dynamic lists and lists improvement.
StaticList and DBList doesn't provide enough features, that's why we propose to create a third List property type based on scripts.
Usage examples:
- apply some filter to a list of results fetched from the database (like rights, languages ...),
- build lists from document content,
- build lists from XWiki API,
- build lists from other sources than the database (from a web service
call etc.)
Short Property specification:
The property re-use properties attributes like :
- Name
- Pretty Name
- Unmodifiable
- Number
And List attributes : - Diplay Type
- Multiple Select
- Relationnal Storage
- Size
We added two properties : - Script Type : StaticList (Velocity|Groovy)
- Script : TextArea
When you display this property, a renderer is called (depending on the script type) and return the standart input formatted as a ArrayList with the getListFromString() method.
- Class DynamicListMetaClass extends ListMetaClass
this class add two properties :- A script type list, where you choose the renderer between Velocity and Groovy.
In this case is it better to manually choose the renderer or to use both. - A script textarea input.
- A script type list, where you choose the renderer between Velocity and Groovy.
- Class DynamicListClass extends ListClass
this class provide attributes accessors and extends the method getList(XWikiContext context).
Lists internationalisation
- What about adding an attribute to Lists properties (like multiselect)
Other lists types implementation
- The checkboxes and radio boxes are quite similar : checkboxes are designed for multiselect lists and radio boxes are for non-multiselect ones. The best way is to reduce lists to select and boxes, boxes depends on the multiselect value.