CDF Dashboard
Asynchronous Module Definition (AMD) has modernized CDF's functionality. AMD is a JavaScript specification that provides an API for creating modular code with managed dependencies. Its key benefits include:
Asynchronous loading of interdependent modules
Logical organization of code into smaller, focused files
Better code structure and maintainability
CDF implements AMD through RequireJS, a JavaScript module loader that offers several advantages:
Namespace Protection: By isolating code into modules, RequireJS prevents global namespace pollution, reducing the risk of function or variable name conflicts
Organized Code Structure: Developers can arrange code across multiple folders and files
Smart Loading: RequireJS handles asynchronous loading of dependencies while maintaining proper execution order
The workshops demonstrate RequireJS integration with CDF. While this approach also simplifies dashboard embedding in third-party applications (covered later), our current focus will be on basic dashboard creation.
The rewrite maintains the same information but presents it in a more structured and concise format, making it easier to understand the relationship between AMD, RequireJS, and CDF.
To build a CDF dashboard, you need to create two main files that are mandatory:
• XCDF: This is the main file that identifies the dashboard as a CDF dashboard type inside Pentaho. This is the file that identifies the dashboards inside Pentaho, and where the general settings are. For instance, we can set the name, template, and style for our dashboards. This file is written using the XML syntax.
• HTML: This is the template file with HTML content where the components will be rendered.
x
x
XCDF is the main file, where the root element and the following child elements are:
• <title>: This corresponds to the title displayed in the Pentaho User Console (PUC).
• <author>: This is the author of the file that will be displayed inside the user console. • <description>: This is the description displayed in the PUC and on the browser.
• <icon>: This is the icon to be displayed.
x
x
x
x
x
x
x
Last updated
Was this helpful?