The Document Object Model (DOM) is a tree structure of nodes and properties; each node is made up of more nodes and properties. The DOM and JavaScript engine provide the ability to interrogate and update the state. In Impact Management Services, it is not necessary to expand the whole Interactive Reporting document, only those nodes with properties of interest. For example, when doing a data model update, only query and data model sections need to be expanded. However, this procedure requires no expansion, as the information is available at the top level of the DOM.
Expanding part of an Interactive Reporting document speeds up document loading and consumes less memory. The document loading routines expand only what is required as it is requested. Any scripts that make use of this optimization continue to work; the Document Conversion Strategy parameter is ignored.
Note:
You can include the bqReadWriteDom and bqReadOnlyDom scripts; however, their values are ignored.
Each document manipulated by a script is stored in the form of a DOM, represented by a tree of nodes, each of which contains a set of associated properties.
The DOM for a document is acquired by retrieving the file and loading the content; for example,
var uuid = env.getParameterValue(“document”); var file = repository.retrieveFile(uuid); var dom = env.getBqyDocument(file, bqReadWriteDom, bqDashboardReportStrategy)
The first line retrieves the parameter that contains the document UUID. The second line is used to copy the file from the repository to a temporary file which is deleted when the script ends. The third line loads the content of the file, providing a BqyDocument object that represents the DOM.
Note:
The second parameter, bqReadWriteDom, specifies that the document is to be rewritten. If it is not to be rewritten, specify bqReadOnlyDom to reduce the amount of memory required for the DOM. The third parameter is the document conversion strategy, bqDashboardReportStrategy. It determines how much of the underlying document structure is accessible to the script.
Using different strategies, the amount of memory required by a script can be reduced, as can the time spent loading the document.