-
Notifications
You must be signed in to change notification settings - Fork 0
Lists
Cosmo Data Services implements a layer for managing data lists. Data lists is a useful utility to implement groups of data that can be used in lists, comboboxes, radio buttons group or other similar controls. A typical example can be the country list in a signup form.
The data can come from many sources (databases, REST/SOAP calls,...) and it depends from the module that you use. All modules must implement the abstract class Cosmo.Data.Lists.IDataList. At the moment Cosmo implement modules for static and SQL Server data lists.
All data list must be defined in the cosmo.config.xml file.
A static list is an inmutable group of data. For example, the user gender (Male/Famale) can be a static list. Cosmo provide the module Cosmo.Data.Lists.Impl.StaticDataListImpl that can be used as a static data list provider.
The definition of the modules is placed inside the data-services section:
<data-services default="workspace-[%MACHINENAME%]">
(...)
<data-lists>
<data-list id="gender" driver="Cosmo.Data.Lists.Impl.StaticDataListImpl">
<param key="default.value" value="0" />
<param key="0" value="Male" />
<param key="1" value="Female" />
<param key="2" value="Enterprise / Corporation" />
</data-list>
<data-list id="street-type" driver="Cosmo.Data.Lists.Impl.StaticDataListImpl">
<param key="default.value" value="0" />
<param key="0" value="Street" />
<param key="1" value="Avenue" />
<param key="2" value="Road" />
</data-list>
</data-lists>
</data-services>