Data Source Configuration |
![]() ![]() ![]() |
A data source can be defined with dataSource element in the MoreMotion configuration. The definition can be made either in the Page Configuration file or in a global configuration file. See Global Configuration versus Page Configuration.
See DataService Class. The nested Elements class Element Defines the name of the data service class that implements org.moremotion.datasrc.DataService interface. accessControl Element The accessControl element can be used to control the accessing of the data source with a sufficient authority. See accessControl configuration element. Note that protecting the data sources with this element is not always necessary. Usually protecting the page that the data source is used is sufficient. You may consider using this element in the data sources that are used directly by the Ajax calls. unitname Element (Accepts MScript) This element defines the resource bundle name of the data service class. Resource bundles contain multi-lingual resources. See Resource Management. resbundle Element (Accepts MScript) If a resource bundle name is defined with this optional element, the $res() resource definitions existing in the data generated by the data service class is resolved with the resources existing in the resource bundle. See Resource Management. scope Element (Accepts MScript) The value of this element defines the scope of the data object (ADOM) that is generated by the data service class. The valid values are "Request", "Session" and "Application". refreshTimeOut Element (Accepts MScript) The life duration of the populated data object in seconds. This parameter is applicable for "Session" and "Application" scopes only. The default value is "0". MoreMotion will not call the data service class again if the given value is not expired. precond Element The MScript expression to test to call the data service. The data service is called only is the test result of this expression is true. itemsPerPage Element (Accepts MScript) This parameter defines the number of the items (records) to be generated by the data service for each call. The responsibility to provide the data in parts belongs to the data service class. The MoreMotion's responsibility is just transferring the navigation instructions received from the Navigation controls to the the data service to let it know which part of the data to be generated. pagesPerBlock Element (Accepts MScript) This parameter is meaningful together with itemsPerPage parameter and it defines the number of the page indexes. The value of this parameter is evaluated by the MoreMotion to prepare and insert additional control data into the generated data request elements. Defining this parameter instructs the data service to obtain the total number of items and therefore should not be used for the data sources that provide big amount of data since it may slow down the execution. debug Element (Accepts MScript) Data service classes should be designed to print the log records about their execution in order to let the users to trace it. This parameter accepts a number value between 1 and 3 as the level of the logging. param Element (Accepts MScript) The parameters defined with param element are evaluated by the data service classes. A data service parameter can be given either with param element
or with custom element
|