Contributed by:Justin Pava, Software Release Manager and Connie Anderson, Technical Writer, Laserfiche
Everything that occurs within an organization’s Laserfiche repository can be tracked and used to run reports through Laserfiche Audit Trail. These reports can contain hundreds of entries and information about them. What if a manager is interested in the audit history of a single entry or a group of entries?
In this article, we’ll use an example of a fictional Inspector’s Office to demonstrate how to create a button in the Laserfiche Client that will run an audit report on the selected Laserfiche entries directly from within a Web browser.
Example: Inspector’s Office
As a manager in the Inspector’s Office, one of Mindy Manager’s duties is to keep track of all the ongoing inspections. She likes to keep track of which employees are working on which inspections in order to keep a tab on employee workloads as well as for compliance purposes. One way that Mindy can see which employees worked with which documents is to create an Audit Trail report that she can run with the click of a button on any of the inspection-related documents. This report will let her know who has made any changes to the document or its associated template.
Creating the Audit Trail URL
The first step in creating the custom button is to create the Laserfiche Audit Trail report URL. The root URL is as follows:
Servername refers to the computer where Audit Trail is installed and repositoryname refers to the name of the repository on which you want to run a report (this is case-sensitive).
The URL syntax can be updated to filter by:
- Event Type
- Columns Displayed
- Time Zones
- Entry ID
In Mindy’s case, the filters that we use will be the “Event Type,” “Columns Displayed,” and “Entry ID.”
The events that Mindy is interested in viewing along with their corresponding syntax are:
- Create or modify field value – AUDITEVT_SETPROP_ENTRY
- View document – AUDITEVT_VIEW_DOCUMENT
- Modify page – AUDITEVT_MODIFY_PAGE
- Modify electronic document – AUDITEVT_WRITE_EDOC
The corresponding syntax for all events can be found in this Support Site article.
The columns that Mindy is interested in seeing in her report along with their corresponding syntax are:
- Entry name – entry_name_only
- User name – trustee
- Event time – event_time
- Event type – event_type
A full list of all possible columns and their syntax can be found in this Support Site article.
The Entry ID of the documents or folders that will appear in the report should be that of the currently selected entries. This can be added into the URL using one of the toolbar tokens available in Laserfiche 9. The token that Mindy will use is %(SelectedEntries).
Now that Mindy has all the parts needed to create the Audit Trail report URL, she just has to combine them. Instructions on how to do this can be found in this whitepaper.
Here is what the final URL looks like:
Creating the Custom Button
After Mindy creates the custom Audit Trail report URL, she needs to make the custom button. Here is how to do this directly from the Laserfiche Client.
- Right-click somewhere in the Laserfiche Client toolbar and select “Customize.”
- In the dialog that appears, click the “Custom” button and then click “Add.”
- Next, fill in the “Command” field. The command requires two pieces of information: the Audit Trail report URL that Mindy created earlier and the browser in which she wants to open the report. While Mindy can use any browser, she prefers Mozilla Firefox. The command she creates must therefore specify the path to Firefox and then tell Firefox to open the Audit Trail report URL. Here is what the full command looks like:
C:\Program Files\Mozilla Firefox\firefox.exe "http://localhost/AuditTrail/reportlink.aspx?repo=DemoRepository&dispEvts=AUDITEVT_VIEW_DOCUMENT%2CAUDITEVT_SETPROP_ENTRY%2CAUDITEVT_MODIFY_PAGE%2CAUDITEVT_WRITE_EDOC&entry_id=IN@%(SelectedEntries)&dispCols=entry_name_only%2Ctrustee%2Cevent_time%2Cevent_type"
- Now it is time to choose an icon for the custom button. An icon is necessary for the button to be created. Mindy chooses the Laserfiche Audit Trail icon.
- Once the button has been created, it needs to be added to the toolbar. To do this, simply select the button from the “Commands” tab in the “Customize” dialog and drag it to the toolbar. The custom button is now ready to use.
Mindy can now select one or more inspection documents and click on the “Audit Report” button to generate an Audit Trail report in Firefox.
- Toolbar tokens are only available with Laserfiche 9 or higher. A complete list of toolbar tokens can be found in the online help files.
- In order to run an Audit Trail report via a URL or button, the user must have the appropriate security rights configured in Laserfiche Audit Trail. Information about how to configure these rights can be found in the online help files.
- The button can be configured to open the Audit Trail report in any browser, not only Firefox, by adjusting the first part of the command. Simply specify the path to the browser, then a space, and then the Audit Trail report URL in quotes.
- It is important to use straight quotes, not curly quotes (known as smart quotes in Microsoft Office), for the button command to work properly.
- An administrator can automatically push this toolbar button to other Laserfiche Client workstations with the Client Automation Tools, available in the Laserfiche 9 SDK.