As I mentioned last time, the Standards Tracker packaged application, released for the first time in APEX 4.2.4, is one of my favorite packaged applications. Since this was its first release, there are parts that can be improved (and will be in the next release; I’ve been working on them!), but it’s already a very useful application.
The basic idea is that since APEX applications are all built/driven off of the metadata in the database–and since that metadata is exposed in the APEX Data Dictionary views–we can check that metadata for potential issues. This is extremely useful if you’re maintaining several applications in the same workspace and you want them to all conform to a certain set of standards. Some examples which we use in developing the packaged apps:
- Page items whose template includes help text should have help text defined.
- Page items which have help text defined should use a template that supports help text.
- Page items that are displayed to the user need to have a valid template.
- All page items which use a “Required” template should have the “value required” flag set.
- Buttons should use the “Next” template, which provides a graphical arrow, rather than using a “>” character in the label.
- Interactive Reports should use the “IRR Report Region” template.
You get the idea. Basically, if it’s in the metadata, you can write a query looking for compliance; the Standards Tracker gives you a convenient location to store all of those queries, and reports so you can see what needs to be fixed.
When you install the Standards Tracker it automatically adds any applications in your workspace to its list of applications to test (note that any applications added after the initial install must be manually added, however). It also creates a sample Standard with three tests–the first three bullet points I listed above.
The home page doesn’t show much at this point; you have to click through to the Applications or Standards tabs. The Applications tab shows you all of the tracked applications in an interactive report, complete with a bar graph indicating compliance; clicking on an application takes you to a detail page, where you can edit some of the data about it (most application data is pulled from the metadata, of course) and see a report of its compliance to the standards. The Standards tab is the inverse; it provides you with a list of the standards, and you can click through to get a report of the various applications’ compliance with a specific standard. Same data, different view.
On the detail pages for applications and standards, you can click on the percentage value shown in the Status column for a report of the tests within that standard and the specific application’s compliance with each test; this is useful in identifying what, specifically, needs to be fixed.
One other useful feature is on the Standards Detail page. Clicking on either the “View Application Statuses” button on the right or the arrow button in the Applications report at the bottom of the page will take you to a filterable report of the applications and their compliance. Since we have many applications in our workspace (the sample applications and the productivity ones, as well as the applications we’re still developing), this enables us to quickly drill down to just the applications we need to worry about–say, the sample applications that are releasable or in production which are still not in compliance with a given feature.
I’ll have a post in the future about how to write compliance tests for the Standards Tracker.