Tech Tip: Create Your Own Application Audit Filters for Fun and Profit

If you know anything about Teamstudio, you are probably aware of our oldest product that’s still in production, Teamstudio Analyzer. Analyzer started its life as a simple Notes application code analyzer, a tool that would create a detailed breakdown of every element of your Notes application design. Using that breakdown, you could easily dig into an unknown design, search for hard coded server names or store a record of the design for posterity.

At some point in the last 20 years or so, we added an auditing feature to Analyzer. Using this feature, you can create a set of audit filters that lets you easily and quickly test any Notes/Domino database design against a set of standards, flagging up any non-conformities. Simple example: you may have a corporate coding standard that requires any categorized column in a view to use twisties. You can create an audit filter to flag up any columns that don’t match the standard. In fact, Analyzer ships with a set of more than 30 filters you can use out of the box. (One of which covers the example above.)

Using the standard filters is all well and good, but what if you want to create your own set of filters? When you first look at the filter database, it may seem a bit daunting. But it’s really not as hard as it may seem. Here is your handy-dandy, step-by-step guide to creating your own audit filters from scratch.

1. Create a Filter Database

If you don’t already have a filters database, you need to create one. Create a new database based on the template named deanfltr.ntf. That template is provisioned when you install Analyzer. The filters database can reside either on a Domino server or local Notes client.

2. Create a New Filter

Click the Create Filter action button. You'll see a New Filter document:

3. Fill Out Basic Details

The basic idea behind creating a filter is relatively straightforward. You are creating a validation formula to run against a set of elements, and you are defining some criteria to define which elements should be tested by the formula. The UI of the filter form is essentially a wizard to help you build those two elements.

There are a few basic details you need to fill out first. Give your new filter a name. If it wasn’t obvious, the Filter Active field allows you to turn the filter on and off. You can apply a Severity level to the filter, which is really just a way of classifying the non-conformities in a view after you’ve run the audit.

The Filter Class field also allows you to classify the non-conformities in the output, but it also gives you a way of controlling which filters are applied to the audit process. You define the filter classes under the Admin section of the application.

4. Apply To

Click the Apply To dropdown to select the design element type you want the filter to check. This is the primary focus of the test.

While selecting All lets you create filters that apply to all elements within a database design, selecting All Design Elements restricts your filter to first-level elements such as page, form or view. It ignores (doesn’t include as audit targets) sub-elements such as field, hotspot and column.

5. Evaluate Against

With the Apply To field chosen, the form expands to show the Evaluate Against field. At this point you have the choice either to define a new filter, or to select an existing filter to run against the parent or the children of the element. Assuming you’re creating a new filter, then select the Property option.

6. Property and Condition Fields

Select the property you want to test. The list of properties available in the drop down is different depending on what design element type you selected in the Apply To field. Once you select the property, the form shows options for defining a condition to use in the selection step. The condition options you see are based on the Apply To and Property fields selected.

For example, select Form for the Apply To design element and Title for the property. To add a Condition, simply select one of the operations such as “Begins with (no case)”. Then select a Compare value such as Text and then type in the text you want to search for. To test multiple conditions, you click AND or OR to specify the logical operator. When you have selected the elements of a single condition, click the Add Condition button to have the Validation Formula updated to include the test just completed.

Simple example of a filter to search for forms whose title begins with “Another Copy Of”

And that’s it. Honestly, the best way to learn how to do this is to open up a new Filter form and play around with the options (there are many of them!). You can also look at the predefined filters to get a sense of what they are doing and how they work.

If you have any questions about creating filters or just want to chat about how this all works, click below to get in touch. We’re always happy to chat! And, happy auditing!