In this section you can find information about how to configure fragments. From RAIN perspective, a module can contain multiple fragments. This proposal is orientated on fragment level configuration. The following questions are answered into this section:
- What can I configure for a fragment?
- Can I dynamically update a fragment configuration?
- How can I access fragment configuration?
Currently in RAIN each module is defined as follow (configuration is stored in meta.json file):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | {
"id" : "example-app;1.0",
"url" : "/modules/example-app",
"settings" : {
"default_language" : "ro_RO"
"recordsPerPage" : 20
},
"views" : [
{"viewId" : "display-cities",
"view" : "/htdocs/display_cities.html",
"controller" : "/htdocs/scripts/display_cities.js",
"settings" : {
"location" : "Romania"
}
}
]
}
|
This is the general section where you can define module identifier and the base url.
These are general settings of the module. Each view will inherit these settings.
This is the section where you define all public views of the module
This is the javascript file that will be executed automatically on client browser when the fragment is loaded.
Each view can contain a list of settings that will be loaded by RAIN and automatically injected in client side controller.