docs.intersystems.com
Home  /  Application Development: Analytics Options  /  Implementing InterSystems IRIS Business Intelligence  /  Other Development Work


Implementing InterSystems IRIS Business Intelligence
Other Development Work
[Back]  [Next] 
InterSystems: The power behind what matters   
Search:  


Depending on the users’ needs and the business requirements, you may have to do some or all of the following additional development work:
Also see Accessing the Samples Shown in This Book,” in the first chapter.
Adding Paper Sizes
When users print a dashboard widget to a PDF file, the system provides a default set of paper sizes, and the user can choose among them. To extend this set of sizes, add nodes as needed to the ^DeepSee.PaperSizes global, as follows:
Node Value
^DeepSee.PaperSizes(n) where n is an integer
$LISTBUILD(sizename,dimensions) where sizename is the name of the size and dimensions specifies the dimensions. dimensions must have one of the following forms:
There must be exactly one space between height and the unit name.
For example:
Set ^DeepSee.PaperSizes(1) = $LB("My Sticker","100x100 mm")
The new size is immediately available.
Auditing User Activity
You can execute custom code, such as writing to an audit log, every time a user executes a query or accesses a dashboard.
To add custom code to execute when users execute a query, perform the following one-time setup steps:
Similarly, to add custom code to execute when users access a dashboard:
Audit Code Requirements and Options
When you define audit code for either scenario, make sure that the code does not write any output to the current device. Also make sure that it does not kill any % variables required by InterSystems IRIS™.
Your code can use the following variables:
Typically, audit code writes output to a file or to a global.
Note that %dsQueryText, %dsCubeName, and %dsResultSet are only available to audit routines using ^DeepSee.AuditQueryCode, while %dsDashboard is only available to routines using ^DeepSee.AuditCode.
Example
The following shows a simple example audit routine. It has one subroutine for use with ^DeepSee.AuditQueryCode and another subroutine for use with ^DeepSee.AuditCode:
 ; this is the routine DeepSeeAudit
 quit
 
dashboard 
 set auditentry="At "_$ZDT($H,3)_", " _$USERNAME_" accessed dashboard: "_%dsDashboard
 set ^MyBIAuditLog($INCREMENT(^MyBIAuditLog))=auditentry
 quit

query
 set auditentry="At "_$ZDT($H,3)_", " _$USERNAME_" ran query: "_%dsQueryText
 set ^MyBIAuditLog($INCREMENT(^MyBIAuditLog))=auditentry
 quit
To use this routine, we would enter the following two lines in the Terminal:
SAMPLES>set ^DeepSee.AuditQueryCode="do query^DeepSeeAudit"
 
SAMPLES>set ^DeepSee.AuditCode="do dashboard^DeepSeeAudit"
To see the audit log, we can use ZWRITE. The following shows example results (with line breaks added for readability):
SAMPLES>zw ^MyBIAuditLog
^MyBIAuditLog=2
^MyBIAuditLog(1)="At 2014-06-20 16:26:38, SamSmith accessed dashboard: User Defined Listing.dashboard"
^MyBIAuditLog(2)="At 2014-06-20 16:26:38, SamSmith ran query: SELECT NON EMPTY {[MEASURES].[AMOUNT SOLD],
[MEASURES].[UNITS SOLD]} ON 0,NON EMPTY [DATEOFSALE].[ACTUAL].[YEARSOLD].MEMBERS ON 1 FROM [HOLEFOODS]"
Defining Server Initialization Code
To define server initialization code:
This code is called by the %RunServerInitCode() method of %DeepSee.Utils. This method is called whenever an InterSystems IRIS Business Intelligence session is created or when a background agent starts.