Hi Colin,
There are a couple of mechanisms available for passing parameters to the Views and you will see both applied in the out-of-the-box Views.
First, the Essential Viewer Engine allows you to pass your own, user-defined parameters as part of the URL, as standard request parameters, e.g. parameterName=value¶meterName2=value2
These are available within the View XSL as parameters that are passed to it by the Engine and you can pick these up by defining the parameter, using the <xsl:param> statement at the top of your View template XSL. e.g.
<xsl:param name=“parameterName”/>
and also this enables you to define default values for this within your template. The name of the parameter is taken from the name part of the URL request parameter that you’ve specified.
There are a number of reserved parameter names that must not be used:
- XML
- XSL
- LABEL
- PMA
- PMA2
- PMA3
- PMA4
- CT
- FILE
- PGH
- cl
- i18n
These are most commonly used to manage dynamic values or to simply pass a value from a particular request (e.g. from a form or a link on a page).
Alternatively, there is the concept of Report Constants that can be made available to the Views. These constants are values that are defined and managed from within the repository as instances and can be queried by the Views. The Report Constant allows values to be set or to select a particular instance (e.g. see the Application Reference Model Layers Report Constant).
Finally, we have the Report Parameter class in the repository. The idea with this class is to enable you to define parameters for a selected Report instance and set either a String value or an instance - very much like the Report Constant. In the same way as the Report Constant, you can query for these from within your Views but there is nothing in the Viewer framework that automatically makes use of these. Rather you must query for them.
Within the Viewer XSL, the utility function ‘eas:get_report_by_name()’ will return the Report instance given its name and from there you can easily query to find all the Report Parameters that are related to that Report.
Hope this helps
Jonathan