DeepSee Implementation Guide
Other Development Work
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Depending on the users’ needs and the business requirements, you may have to do some or all of the following additional development work:

Adding Paper Sizes
When users print a dashboard widget to a PDF file, DeepSee 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 Zen or DeepSee.
Your code can use the following variables:
Typically, audit code writes output to a file or to a global.
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 ^MyDeepSeeAuditLog($INCREMENT(^MyDeepSeeAuditLog))=auditentry
 quit

query
 set auditentry="At "_$ZDT($H,3)_", " _$USERNAME_" ran query: "_%dsQueryText
 set ^MyDeepSeeAuditLog($INCREMENT(^MyDeepSeeAuditLog))=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 ^MyDeepSeeAuditLog
^MyDeepSeeAuditLog=2
^MyDeepSeeAuditLog(1)="At 2014-06-20 16:26:38, SamSmith accessed dashboard: User Defined Listing.dashboard"
^MyDeepSeeAuditLog(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 a DeepSee session is created or when a background agent starts.