Data Services |
![]() ![]() ![]() |
The data required by the application can be acquired from different sources such as Databases, files, web services, etc. The MoreMotion provides a standard interface for the classes that supposed to populate data by accessing to different sources. The responsibility of a data service class is to populate data and place into the ADOM object passed to it. Data Request The need for data in a page is expressed with dataRequest configuration element in the Page Configuration. Page Configuration:
See below how the data, that is requested with data request "products", is used in XSLT stylesheet. XSL StyleSheet:
A Page XML Data is prepared prior to the XSLT processing and it contains the XML data required by the stylesheet. Page XML Data:
The name of the root element of the Page XML Data is always "root". The second level elements are called data request names. The Page XML data may contain 0 or more second level XML elements depending on the data request defined in the configuration. Data Request Definitions in Page Configuration:
Page XML Data:
If the name of a data request is identical with the name of the data source then the dataSource attribute of the dataRequest element can be omitted. Page Configuration:
The selectAll attribute specifies that all the data provided by the data source should be transferred to the Page XML Data. If the value of the selectAll attribute is "false" then node child element(s) should also be provided to specify which of the data nodes provided by the data source should be included in the Page XML Data. Page Configuration:
See Data Request Configuration. Data Source The data requests are linked to data sources in the configuration. A data source is defined with dataSource configuration element in the configuration. Page Configuration:
A data source is nothing but a definition of the responsible Data Service Class and its parameters. A data source definition must include a class element. The value of the class element should be the name of a Java class that implements org.moremotion.datasrc.DataService interface. See Data Source Configuration.
|