Due to the fact that every software is individual and in this context the used tools differ from build-process to build-process phpUnderControl 0.3.6 introduced a new feature that allows to customize the main menu bar. It is a simple placeholder based preprocessor. It extracts custom tabs from an existing phpUnderControl installation and takes them into newer version during the update process.
At the moment only the main.jsp file supports this new preprocessor between each of the predefined tabs. Each phpUnderControl placeholder has the following format <%-- phpUnderControl ([0-9]+) --%> where ([0-9]+) represents a unique number. The following example shows a section from the main.jsp file as it is shipped with phpUnderControl 0.3.6.
...
<cruisecontrol:tab name="log" url="<%=logs_url%>" label="XML Log File" />
<%-- phpUnderControl 4 --%>
<cruisecontrol:tab name="metrics" label="Metrics" >
<%@ include file="metrics.jsp" %>
</cruisecontrol:tab>
<%-- phpUnderControl 5 --%>
<cruisecontrol:tab name="coverage" label="Coverage">
...
</cruisecontrol:tab>
<%-- phpUnderControl 6 --%>
<cruisecontrol:tab name="documentation" label="Documentation">
...
Now I would like to add two more documentation types to my build result. The agile Testdox documentation, generated by PHPUnit and the end user documentation generated from docbook xml files in the source repository.
<%-- phpUnderControl 4 --%>
<cruisecontrol:tab name="metrics" label="Metrics" >
<%@ include file="metrics.jsp" %>
</cruisecontrol:tab>
<%-- begin phpUnderControl 5 --%>
<cruisecontrol:tab name="testdox" label="Testdox">
<cruisecontrol:artifactsLink>
<iframe src="<%= artifacts_url %>/testdox/testdox.html" width="100%" height="550" />
</iframe>
</cruisecontrol:artifactsLink>
</cruisecontrol:tab>
<cruisecontrol:tab name="manual" label="Manual">
<cruisecontrol:artifactsLink>
<iframe src="<%= artifacts_url %>/manual/index.html" width="100%" height="550" />
</iframe>
</cruisecontrol:artifactsLink>
</cruisecontrol:tab>
<%-- end phpUnderControl 5 --%>
<cruisecontrol:tab name="coverage" label="Coverage">
...
</cruisecontrol:tab>
<%-- phpUnderControl 6 --%>
I simply translated the placeholder number 5 into an opening %<-- begin phpUnderControl 5 --%> and a closing <%-- end phpUnderControl 5 --%> placeholder and put my custom tabs between this two comment. And this is what it looks like now.
And the best thing is that you do not need to worry about future updates.