The Caché Studio hooks which InterSystems provide are installed by making registry settings on the PC where Studio is installed. This means that they need to be installed on each client PC, rather than on the VC/m server.
Before installing the hooks, look at the files VCmCacheStudioInstall.reg and VCmCacheStudioUninstall.reg. These are text files which update the registry when they are run. You will see they set up /remove registry entries which call different entry points in the VC/m routine %vc620. You may need to edit the .reg files to reflect your Caché configuration name and version.
Four switches are provided which make commonly requested changes to the standard VC/m functionality. Unlike the .reg files, these are settings on the server, so they apply to every user. Each switch has a value of 0 or 1. The switch can be disabled by changing the value or by deleting the global node. A user-friendly interface for enabling and disabling the switches is available:
do setup^%vc620
| ^%vcvc("editCheckOutUserOnly") | When set to 1, this only allows the user who checked out a component to edit it. (When set to 0 or non-existent, any user can edit the component.) |
| ^%vcvc("studio_checkout_message") | When set to 0, this suppresses the information dialog which is given when a component can be edited. (When set to 1 or non-existent, the information dialog is given.) |
| ^%vcvc("studio_not_registered_readonly") | When set to 1, components which are not registered to VC/m are opened read-only. (When set to 0 or non-existent, these components can be edited.) |
| ^%vcvc("notCheckedOutEditable") | When set to 1, components which are not checked out can still be edited. (When set to 0 or non-existent, these components cannot be edited.) |
If you wish to implement something more complex, there is a hook which allows you to run a routine with custom checks. For example, you may wish to allow editing of unregistered routines if they begin with z.
The hook is defined by setting the following global node:
set ^%vcvc("editCheckOutValidation")="label^%routine"
The call must be to an extrinsic function with the following form:
set status=$$label^%routine(currentStatus,.message)
status is an output value with one of the following numeric values:
| 0 | Not available for editing |
| 1 | Editable |
| 2 | Not registered to VC/m |
For example, to allow editing of unregistered routines if they begin with z:
Create this routine:
%vcKB105 ; If a routine is not registered to VC/m, but the name starts ; with z*, then allow editing in Cache Studio. zR(currStat,msg) i +currStat=2 i ctype="R" i $e(cname,1)="z" d q 1 . s msg="Editing is allowed for unregistered"_crlf_"routines which begin with a ""z""." q +currStat
Set up this global node:
set ^%vcvc("editCheckOutValidation")="zR^%vcKB105"
Further information may be obtained from the comments in status^%vc1edt and %vc620.
Last reviewed: Dec 7, 2004
Copyright 1997, 2005 George James Software.