Auto Includes

CDF supports adding the results of CDA queries to the context. The default configuration file will take any CDA file within the solution:/cdf/include/ folder hierarchy and include all queries therein, with their default parameters, in any dashboard whose path, relative to the solution root, is within the same path as the CDA file, relative to solution:/cdf/include/.

As an example, if you have a CDA file in solution:/cdf/include/aFolder/myQueries.cda, then the dashboard solution:/aFolder/myDashboard.wcdf would include all queries from myQueries.cda, as would a dashboard located at solution:/aFolder/anotherFolder/myOtherDashboard.wcdf. A dashboard located at solution:/someOtherFolder/myThirdDashboard.wcdf, however, wouldn't include those queries. Partial matches will also work, without the full solution path

This is specially useful for dashboards that need constant data input, for instance an indication of when was the last time a specific etl worked.

Rule Format

The auto-include rules follow the following template, where all the Patterns are understood as regular expressions:

			<autoinclude>
			  <cda>cdaPattern</cda>
			  <ids>idPattern</ids>
			  <dashboards>
				<include>includePattern</include>
				<include>includePattern_2</include>
				<exclude>excludePattern</include>
				...
				<include>includePattern_n</include>
			  </dashboards>
			</autoinclude>	
		
		

Such a block should be interpreted as follows:

Default Rule

The default rule for auto-inclusion serves as a good example of what can be achieved with the rule format. Be aware that this will only work if CDA is also present in the system

			<autoinclude>
			  <cda><![CDATA[cdf/includes/(.*)/(.*?)\.cda]]></cda>
			  <ids>.*</ids>
			  <dashboards>
				<include><![CDATA[/$1/.*\.wcdf]]></include>
				<include><![CDATA[/$1/.*\.xcdf]]></include>
				<include><![CDATA[/$1/.*\.cdfde]]></include>
			  </dashboards>
			</autoinclude>	
		

Note that most of the patterns are wrapped in <![CDATA[ ]]> blocks, obviating the need for escaping any reserved XML characters within the regexps. As you can see, the cda element defines that this rule will match any CDA file whose path looks like /solution/cdf/includes/(.*)/(.*?)\.cda — this will match all files within /solution/cdf/includes/ that have at least one more folder in the path, and end with the .cda extension. The two capture groups will capture the file path, and the (extension-less) filename.

The include patterns all specifiy paths starting with /$1/ (the path capture group), meaning, the path begins the same as the previously matched CDA file's, and ending with .*\.wcdf (or cdfde/xcdf), so matching all paths that start the same as the CDA file, but possibly having more folders in the path . The three rules differ only in the file extension they allow (covering CDF and CDE dashboards). The ids pattern specifies a loose pattern — any id matches, so once a match has been made between a dashboard and a CDA file, all queries in that CDA will be inserted into the dashboard's context.