An Introduction
On the mailing list there was a question today about the parts of the dashboard and how they match up with the configuration. So I thought it’s time for me to write down what I know about the parts of the dashboard and how they work.
First, there are four basic levels to the dashboard. These levels are:
- Farm – the areas of the dashboard that do not relate to any build server
- Server – the overall summary of a build server (e.g. an instance of the CC.NET service or console)
- Project – a project on a build server
- Build – an instance of an integration for a project on a build server
Each level has its own set of plug-ins, as would be expected since they show very different information. To show these levels, here is a screen shot of each.
Note: These are running on my development instance of CC.NET, hence they don’t have a proper version number or very many plug-ins installed.
Farm Level View
Server Level View
Project Level View
Build Level View
It is important to know about these levels, because putting a plug-in in the wrong location will put items in an unexpected place!
The Parts of a Page
Every page has four basic parts – and a plug-in only has control over one part. These four parts are:
The header and the footer are both generated by the main page template. These contain common items to every page, such as the name and version of CC.NET, common links, breadcrumbs and when the date/time the page was rendered. These do change slightly depending on the level, but this is outside the control of a plug-in.
The side bar contains a set of links. Again, these vary slightly depending on the level, but they are controlled by the system again. However, these links are defined in the configuration – each plug-in exposes one or more links to add to the side bar. More on this in a little while.
Finally, there is the content area. This is entirely up to the plug-in to populate. The system completely ignores the content area and assumes the plug-in will generate meaningful content. This content is accessed by clicking on one of the links in the side bar.
Overlying these parts onto a farm level view looks like the following:
Where the Config Comes In
Hopefully by now, you will have some ideas of where things fit. But let’s make things perfectly clear and delve into how the configuration relates to the pages.
First, here is the configuration I used to generate the above screen shots:
1: <dashboard>2: <remoteServices>3: <servers>4: <server name="local" url="tcp://localhost:21234/CruiseManager.rem" allowForceBuild="true" allowStartStopBuild="true" backwardsCompatible="false" />5: </servers>6: </remoteServices>7: <plugins>8: <farmPlugins>9: <farmReportFarmPlugin />10: <cctrayDownloadPlugin />11: <administrationPlugin password="********" />12: </farmPlugins>13: <serverPlugins>14: <serverReportServerPlugin />15: </serverPlugins>16: <projectPlugins>17: <projectReportProjectPlugin />18: <viewProjectStatusPlugin />19: <latestBuildReportProjectPlugin />20: <viewAllBuildsProjectPlugin />21: </projectPlugins>22: <buildPlugins>23: <buildReportBuildPlugin>24: <xslFileNames>25: <xslFile>xsl\header.xsl</xslFile>26: <xslFile>xsl\modifications.xsl</xslFile>27: <xslFile>xsl\NCoverSummary.xsl</xslFile>28: </xslFileNames>29: </buildReportBuildPlugin>30: <buildLogBuildPlugin />31: <xslReportBuildPlugin description="NCover Report" actionName="NCoverBuildReport" xslFileName="xsl\NCover.xsl"></xslReportBuildPlugin>32: </buildPlugins>33: <securityPlugins>34: <simpleSecurity />35: </securityPlugins>36: </plugins>37: </dashboard>
Like I said, it is very simple. The part that we are interested in the the <plugins> section. This defines all the plug-ins that can be seen. For the moment, I’m going to ignore the <securityPlugins> as this is specific to 1.5.0 and I’ve already covered it in a previous post.
There are four sections of plug-ins: <farmPlugins>, <serverPlugins>, <projectPlugins> and <buildPlugins>. These map to each level in the dashboard. Within each section there are one or more plug-ins. These plug-ins define the links that appear in the side bar. For example, in the <farmPlugins> section:
- <farmReportFarmPlugin> maps to the “Farm Report” link
- <cctrayDownloadPlugin> maps to the “Download CCTray” link
- <administrationPlugin> maps to the “Administer Dashboard” link
Most plug-ins have these link titles as hard-coded values within them – so they can’t be changed. Clicking on a link will pass control to the plug-in, which generates the content to be displayed (this is actually a simplification, but it will do for this post.)
Normally, there is only one instance of a plug-in per section – having multiple plug-ins generates some unexpected results, so it is recommended against. However, some rules are made to be broken.
Breaking the Rules – <buildPlugins>
The above details cover most plug-ins in the dashboard. However, the one area where the rules get broken is in the <buildPlugins> section. This section defines two special plug-ins – <buildReportBuildPlugin> and <xslReportBuildPlugin> (1.5.0 will be adding a third – <htmlReportPlugin>).
First, the <xslReportBuildPlugin> element. This breaks the rules by allowing multiple instances. It does this because of two properties: description and actionName. The description is the text of the link to appear in the side bar, while the actionName is the command name to be passed to the server. The actionName MUST be unique, otherwise the poor dashboard will get confused!
This plug-in takes in a XSL-T template and transforms the build log for a project into an HTML report (which is the third parameter in the element). This means we don’t need to develop lots and lots of plug-ins (e.g. one for each report), instead we can just write a style sheet and get it to transform the results.
The second rule breaker is <buildReportBuildPlugin>. This is a required plug-in and there can only be one instance of it. The reason it is different is it has an <xslFileNames> section in it. This section is similar to the xslFileName attribute in the <xslReportBuildPlugin>, but it has one major difference. The <xslReportBuildPlugin> generates a link in the side bar, the <xslFileName> element doesn’t. Instead, it’s transform gets merged into one big page – the “Build Report”.
The following picture shows how these relate:
Clicking on an <xslReportBuildPlugin> will generate a completely different content area, one that is not affected by <buildReportBuildPlugin> at all.
Summary
There are four general levels – farm, server, project and build. Each has its own config section and allows a different set of plug-ins.
Within each page, there are four areas – header, footer, sidebar and content. The plug-in generates the content area and defines links to go into the sidebar – everything else is handled by the system.
For the build level, there can be multiple <xslReportBuildPlugin> – each defines a link in the side bar, with custom content. The <xslReportBuildPlugin> section defines the items to appear within the “Build Report” – these do not appear as links within the side.
Hopefully this provides a better understanding of the parts of the dashboard.
Loading...
Be First To Comment
Related Post
Leave Your Comments Below