
| Introduction |
To make this possible, CT Summation has over 800 documented scripting entry points. These entry points, sometimes termed intrinsics, are scripting functions or properties particular to CT Summation and its functionality. Using standard programming constructs available in either JScript or VBScript, both supported by a vast array of technical books and courseware, you can put the desired intrinsics together to create a custom solution.
Organized into an arrangement mimicking the structure of CT Summation, the CT Summation intrinsics have been grouped into an organizing schema called an "Object Model". CT Summation's Object Model, similar to those in Excel and Word, makes it easier to find and use the CT Summation specific functions and properties available for customizing the application.
These pages serve as your map and guidebook through the ever growing CT Summation Scripting Object Model.
Using CT Summation Scripting Object Model Help ![]()
"Introduction", the Outline View's first link, returns you back to this page, while the next link, "View Objects Diagram", opens an overview of CT Summation's Objects and Collections. Further down in the Outline view are links to information about specific CT Summation Collections and Objects.
The CT Summation Scripting Object Model consists of Collections, Objects, Properties and Methods.
The "Application" object is the root object to which all other Collections and Objects are attached. The Application object exposes general Properties and Methods associated with the entire application, such as CT Summation version, application directory, and window dimensions.
The names of other Collections and Objects generally correspond to their associated view name within the user interface (such as "Explorer" and "CaseOrg"), or a user interface's view type ("Transcript" or "Notes"). A few other Objects are named based on the environment information they interact with (such as "CurrentCase", "Permission", and "Defaults").
The Context View
Click an Outline View Collection or Object link to display a description of its purpose as well as a listing of its Properties and Methods within the Context view (the right pane of this window).
The upper portion of the Context view contains navigation arrows for navigating Back and Forth within the Context pane's browsed pages' history. Beneath the navigation arrows is the name of the current object, the object's type (such as "object", "collection" or "property", as well as the complete object hierarchy used to access the object.
When the Context pane contains either "collection" or "object" information the object's Properties and Methods are displayed in the central portion of the page. Each of the displayed Properties and Methods are themselves links to additional pages with detailed information about the intrinsic's purpose, usage, and parameters (and some practical example code as well).
to top
You can update your local copy of the Scripting Help Reference and even view it in a standalone browser by downloading form here: download
[version: 2003.08.12 - 1.4MB]
After downloading, either extract the zip file's contents into a new directory, or update your CT Summation installed files by extracting to the <SW
appdir> \ html \ help \ scripting folder. Remember to maintain directory structure when extracting the files.
Note: This download link is updated from time to time with updates and corrections to CT Summation Scripting Object Model Help.
to top
In writing CT Summation we've used the script entry points extensively so that lots of the CT Summation components are available to you via scripting. It is even possible to write full-blown Visual Basic apps that plug into CT Summation and extend it by using the Scripting Object Model (we'll also briefly touch on this below). As a matter of fact, that's how companion and remote database columnar views are implemented in CT Summation itself.
Scripts will typically be saved with a .vs extension if written in VBScript and .js if written in JScript, although you can also execute script directly from the Script Editor. Besides using Html or Visual Basic to embed application extensions, there are 2 typical ways to include scripts:
You can also add a script as a top-level item. This makes it easy for users to get to common functions. The item will have the script bitmap but can have whatever label you wish to associate with it.
As mentioned, double clicking executes the script. If you have the Edit Scripts right granted, then you can view or edit the script by right clicking on one and choosing Item Properties.
These files end in .mxs and have names associated with their location (tran.mxs and corerow.mxs, for the two mentioned above). These files are located in one of the Script folders. There is one of these folders for (1) each user in a case, (2) All Users in a case, (3) the user's general profile, and (4) the All Users profile. The mxs file is looked for in these folders in this order and if found in one of these is used to add menu items to the context menu. This lets you customize script extensions on a very specific (user/case) to a very general case (everyone). Just remember that only the first of the found files is used. By the way, there is a very useful intrinsic named LocateFile that we use to look in these locations in the given order.
To add or edit one of the menu extension scripts, choose Scripts | Context Menu Scripts from the application menu. If you have Edit Scripts rights, then you can see the names of the mxs files in the various locations by pressing the buttons on the bottom of the load file dialog. Choosing one of the files brings up Notepad to let you edit it. If you want to create a new one that you do not see, simply enter its name (e.g., explorer.mxs) as the File Name and you will be prompted to create it. You can keep the file open in Notepad, edit it, save it and then bring up the context menu to test changes immediately. Although for most items you'll usually execute a script file (which once connected to the mxs file you can keep in the CT Summation script editor, change and save to also test immediately).
The format of an mxs file is one menu item per line. Comments can be used by starting the line with a semi-colon. Each menu line has two parts. The first part is the label to be used in the menu. This is separated from the second part, the script to execute, by a comma. If you wish to use a comma in the menu item label you can enclose this first part in double quotes. Up to 10 such lines will be processed for each context menu. To do anything of any complexity takes more than a line of script so you will most often use the line of script in the menu item to find and execute a script file. Assuming you wanted the menu label to be "Show Image Detail" and the script code to do this is in one of your script folders in the file "ImageData.js", then this would be the line in the mxs file:
The code after the comma tells us to Locate the ImageData.js file in a Script folder and run this file. The code in the mxs file must be VBScript but
the executed file can be in JScript as the example above shows.
In the above example, the line Count UDL Items is always added to the context menu. The second line executes the explorer_menu.vs script, which should use the AddContextMenuItem method to add items to the context menu being created. Scripts containing this method can be run but will only affect the context menu when the mxs file processor is building a new menu.
If the following script were contained in explorer_menu.vs, it would add the line Transcript to the Case Explorer context menu only if the user brings up the menu over a Transcript or Transcript Folder item. Also, if the user is over the Transcript Folder item, the menu item is disabled.
The script uses the CaseTree object's CurItem property (CurrentCase.Explorer is synonymous with CaseTree) to look at the Type of the item that the user clicked over to bring up the context menu. The type for Transcripts is 6 and for the Transcript Folder is 5. (For a list of the Case Explorer item type click here). By calling AddContextMenuItem a new item will be appended to the current context menu being created. The first 2 arguments are just as you would enter them in the mxs file: the context menu item description and the script to execute if it is chosen. There is an optional 3rd argument that can be set to False if you wish to show the item but have it grayed out and disabled.
If your script throws an error when the mxs file is being created, normally this error will not be shown. This is to protect the user from confusing behavior that could stop context menus from being displayed. However, during testing of your mxs extension script you can have errors displayed if the Ctrl and Shift keys are held down as the context menu is being requested. That is, if you hold the Ctrl and Shift keys down, right click to bring up a context menu, and the Script in the associated mxs file causes an error, then you will see this error displayed on the screen. If you do not hold down these keys and an error exists, then the most likely result will be that your intended additions to the menu will not occur.
Be careful not to have these scripts that you use to add a menu item do anything but check the state of the program and call AddContextMenuItem. They should not attempt to perform any actions while the context menu is being built. Of course, the scripts that are executed when a context menu item is selected can use all of the CT Summation Scripting object model.
There are 5 additional arguments in CreateHtmlView that you can use to further control the properties and appearance of your Html User Interface to CT Summation. By default, HTML views that you create will not be kept the next time you open CT Summation, but you can change this by using the subtype argument of CreateHtmlView.
Inside the HTML code, your script blocks can reference the CT Summation object model by using the window.external object. By convention we use the object name "sw" to refer to CT Summation inside the HTML page. You need not do the same, but knowing this will allow you to more easily read the HTML code we write. To set this up, we include the line (if in a JScript block)
or (if in a VBScript block)
as one of the first lines in the first script block of the HTML page. Subsequently, we just use this object. So, the code connected to the Load Transcripts image in the standard home page is simply onclick="sw.loadTran()" as the attribute for the img tag. Alternatively, you could use the protocol prefix to send the script to CT Summation. This would change the above to onclick="summ:loadTran". We tend to use the first method since most of the time the HTML code references a function defined in the HTML script that itself uses several CT Summation methods and properties.
CT Summation embeds the Internet Explorer browser so your page can rely on all the object mode functionality of IE without having to write HTML suitable for other browsers. However, it is a good idea to test to see if the HTML page is running inside CT Summation. This is useful in case a user happens to double click on a file intended to run within CT Summation. If your HTML page determines this it can give an explanatory message without the user running into confusing error messages.
To see if you are running inside CT Summation, first test for the browser type. If it is not IE then you know you cannot be, next you can run code similar to the following:
Most of the time you would simply give a message and not let the user continue if we are not in CT Summation. You could, however, write pages that provide additional functionality when in CT Summation.
The above method of determining that you are in CT Summation uses client-side code. We use a different technique with some of our CT CaseVault litigation support repository pages. This uses server-side code to see that the page will be sent into a browser embedded inside CT Summation. We add to the user agent HTTP header the string SummationScript: followed by an Object Model version number. You can inspect this in ASP (Active Server Page) code and create page elements that call into CT Summation if the string is found. This is what the header looks like from a sample ASP page:
HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0; SummationScript:1.00)
We mention this technique in passing, but the client-side use is more useful in general.
HTML can be used to create user interfaces for specific types of queries or to provide easy access to common functions of the program. It can also be used to create formatted reports from your data. Samples of both of these uses of HTML can be found on the our web-site at www.ctsummation.com/scripting/samples
Although there are many benefits to using a simple scripting language, the programming environment for scripting is very limited and offers programmers very little support. Additionally, script code is readable by anyone with Notepad, and most programmers prefer to not share their coding secrets and practices with competitors.
Connecting to CT Summation product from a standalone Visual Basic application is just as easy as it is from either CT Summation's script window or an HTML view. Once you've connected to the CT Summation object you have full access to CT Summation's Scripting Object Model.
Visual Basic supplies programmers with an easy one-line method for connecting from one application to another running applications using the GetObject function: GetObject([pathname] [, class]) .
The following is an example of how easily applications can connect to CT Summation and its Object Model using GetObject.
GetObject Example:
The GetObject function syntax has these parts:
The class argument uses the syntax appname.objectype and has these parts:
to top
The sample code in "Connecting to CT Summation from VB Applications" (above) explains how one connects an application to CT Summation, but doesn't discuss the easiest ways to embed a compiled application within a CT Summation view. The following explains the available processes. Microsoft's Visual Studio programming environment allows programmers to create various ActiveX Components such as ActiveX EXE Server (EXE), ActiveX DLL (DLL), ActiveX Control (OCX) and ActiveX Document (VBD). The following documents creating seamless integration between CT Summation and VBD, OCX and DLL applications.
Opening New Views Within CT Summation product
The Views collection's CreateHTMLView method syntax:
As you can see, opening the view containing your application in CT Summation is simple. The question remaining for you is:
Please refer to the following link (or your MSDN) for specific information on creating ActiveX Documents:
Hosting ActiveX Documents within a CT Summation View
HTML and ActiveX Controls
Instantiating an OCX from HTML:
The following example is a text-book example for connecting script to Excel using a combination of JavaScript and VBScript commands:
Downloading/Updating CT Summation Scripting Object Model Help ![]()
Creating Scripts ![]()
There are also several places where a script with a specific name can be run to customize a process, such as after a Case is opened.
Case Explorer Scripts ![]()
Context Menu Scripts ![]()
; Test the Case Explorer context menu
"Count UDL Items", msg "UDL Items: " & CaseTree.UDLCount
Script "explorer_menu.vs"
' Called by Explorer.mxs when the case explorer context menu is loaded.
' Puts in a line if the item clicked on is a transcript or transcript folder,
' disables the command if it is a folder, otherwise nothing is added here.
' The 3rd parm (enable) is optional and is TRUE by default.
t = CaseTree.CurItem.Type
If t = 6 Or t = 5 Then
enable = t = 6 ' disable if type is not 6 (transcript)
AddContextMenuItem "Transcript", "msg CaseTree.CurItem", enable
End If
Context Menu Files ![]()
HTML and the CT Summation Object Model ![]()
Views.CreateHtmlView(url, "Floating", "Database Search Example")
inSummation = true;
sw = window.external; // safe to assign our CT Summation var
}
else{
inSummation = false;
}
Connecting to CT Summation from VB Applications ![]()
Private Sub BUTTON_CLICK()
Call ProcessSummationSummaries
End Sub
Sub ProcessSummationSummaries()
Dim SWObj As Object
Dim strSummary As String
Dim intRow As Long
'get pointer to the CT Summation SOM and use pointer to force coreDb to move
through the rows and return the rows' SUMMARY field contents.
On Error GoTo errExit
Set SWObj = GetObject(, "summation.Application")
If SWObj.db.recordcount > 0 Then
'get started on first row
SWObj.db.MoveFirst
Do While Not (SWObj.db.EOF)
'get summary field's text as string
strSummary = GetSummary(SWObj)
'do something with summary string
'go to next row
SWObj.db.MoveNext
Loop
End If
GoTo ExitFunction
errExit::
'process error state
ExitFunction::
'cleanup
Set SWObj = Nothing
End Sub
Private Function GetSummary(ByRef SWObj As Object) As String
Dim varSummary As Variant
On Error GoTo errExit
varSummary = SWObj.db.Fields("Summary").Value
If IsNull(varSummary) Then
GetSummary = ""
Else
GetSummary = CStr(varSummary)
End If
GoTo ExitFunction
errExit::
'process error state
ExitFunction::
'cleanup
End Function
GetObject Syntax
Part
Description
pathname
Optional; String. Full path and name of the file containing the object to retrieve. If pathname is omitted, class is required.
class
Optional; String. Class of the object.
Part
Description
appname
Required; String. Name of the application providing the object.
objectype
Required; String. Type or class of object to create.
Embedding VB Applications in CT Summation ![]()
The challenge of creating the appearance of seamless integration between your application and CT Summation begins with embedding your application within a CT Summation View. To do so you'll need to access CT Summation's Views Collection's methods and properties. The Views collection's "CreateHTMLView" method opens new views within CT Summation and hosts files and applications using Microsoft's Browser Control. (The Browser Control has the ability to host many types of data including MSWord, and PDF, however the following text documents only the loading of HTML and Visual Basic Documents into a CT Summation view.)
Views.CreateHtmlView(Url as String, DockState as String, Optional Caption as String, Optional TabLabel as String)
Url - a fully pathed file specification, or http reference
DockState - controls whether the new view is a "TABBED", "DOCKED" or "FLOATING" view.
Caption - controls the title bar caption for the view
TabLabel - controls the text string displayed on the new view's TAB when the view is tabbed
(There are additional optional parameters which are not documented here. Please refer to the Scripting Object Model's description of the Views collection as well as the View object for additional information)
ActiveX Documents ("VBD Applications")
ActiveX Documents hosted in CT Summation HTML views present end users with the appearance of seamless integration between the custom applications and the main CT Summation app. Microsoft describes ActiveX Documents the following way:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconwhatisactivexdocument.asp
(Please note: ActiveX Documents are not included in Microsoft's ".NET" strategy.)
To enable your users to launch your application in CT Summation View, you will need to send them a script which they can drag from an e-mail into their CaseExplorer tree.
The following examples assume the programmer of "Whiz Lit Support Tools", has compiled a program called "WhizApp" as an ActiveX Document and placed it within a CT Summation 3rd party add-on folder. The WhizApp application is started via a CT Summation script and has a public subroutine ("MainRoutine") which may either run automatically with the document's onLoad event, or could be called from within the launching script.
The script to launch a view containing the VBD could use the very simple CT Summation CreateHTMLView command to open the hosting view window:
Views.CreateHtmlView("C:\iBlaze\Add Ons\WhizApp\WhizApp.VBD", "TABBED", "WhizApp Litigation Support Tools", "WhizApp")
'Nothing else to do - MainRoutine will run automatically onLoad.
Instead of being hardwired to work with "C:\iBlaze", the script could instead be more supportive of a variety of CT Summation install directories:
strWhizAppPath=locatefile("Add Ons\WhizApp\WhizzApp.VBD")
Call Views.CreateHtmlView(strWhizAppPath, "TABBED", "WhizApp Litigation Support Tools", "WhizApp")
' Nothing else to do here - MainRoutine will run automatically onLoad.It's also possible that you'd want your script to interact with the view after it has opened. If that is the case then you'll need to both keep track of the new view's ViewID as well as know when the VBD has finished loading and is able to accept commands from the script. When the document has completely loaded you will need to have access to your application's public interface in order to call MainRoutine from the initial script. For this you'll need to use the "Views.CreateHtmlViewAndWait" method instead of the simpler CreateHtmlView method. You will also need to use the Views collection to access the newly opened View object, as well as use the View object's OBJECT property to obtain a pointer to your VBD's public interface:
strWhizAppPath= locatefile("HTML\WhizApp\WhizApp.VBD")
intViewID= Views.CreateHtmlViewAndWait(strWhizAppPath, "TABBED", "WhizApp Litigation Support Tools", "WhizApp")
Set objWhizApp= Views(intViewID).Object
'set some variables here, then call the VBD's "MainRoutine" subroutine.
Call objWhizApp.MainRoutine(Input1, Input2)
If you already have existing code encapsulated in an OCX or DLL, you can avoid recompiling your application as a VBD and instead use CT Summation's Views object to host an HTML document which instantiates your OCX via script.
An HTML Application embedded within CT Summation can be designed in such a way that all of the application's logic code is held within an embedded .OCX or .CAB file, and its interface designed with a very modern, easily customizable HTML interface. Using HTML as the interface for your application opens up a variety of options not available when hosting an ActiveX Document within CT Summation:
Within an HTML Browser Control environment, scripters must connect to their compiled objects using JavaScript's ActiveXObject command. The following code snippet demonstrates making a connection to an Excel object by combining VBScript with a JavaScript routine. (Note: The proliferation of viruses and demand for enhanced browser security has required Microsoft to limit the availability of VBSCript's GetObject command from within HTML.)
ActiveXObject Syntax:
var NewObject=new ActiveXObject(objectClassID)
The Class ID ("objectClassID ") reference to your object will vary depending on its registry name. For example:
"excel.application"
is the class ID for Microsoft Excel,
and "prjPersistRecords.SWDBTools" is the class ID for SWDBTools.OCX (the OCX used by CT Summation to Briefcase records).
<script language="javascript">
function connectToObject(strObjectName)
{
var ObjT = new ActiveXObject(strObjectName);
return ObjT
}
</script>
<script language=vbscript>
.
.
.
Set objExcel=connectToObject("excel.application")
.
.
.
</script>
Connecting to the CT Summation Object Model from within an Embedded View
From within your HTML script code you might need to connect to the CT Summation Object Model. To connect to CT Summation you may use either of the following two options:
Connecting to CT Summation from an embedded CT Summation HTML view via the simple Window.External object is the easiest way to go, and uses only a simple single-line syntax:
Set SWObj=window.external.
You can also connect to CT Summation from an embedded CT Summation HTML view via JavaScript's ActiveXObject command, but it isn't the recommended method:
var SWObj = new ActiveXObject("Summation.Application");
(Connecting an OCX, DLL or VBD application to CT Summation's API is documented above in the section titled "Connecting to CT Summation from VB Applications".)
| Case Tree Item Type Name | Item Type Number | |
|---|---|---|
| Case Name (Top of Tree) | 0 | |
| Case Tools (Root of Bottom Tree) | 1 | |
| Core DB (searchable item) | 33 | |
| Transcript Folder | 5 | |
| Transcript | 6 | |
| Transcript Notes | 37 | |
| OcrBase | 7 | |
| OcrBase Notes | 38 | |
| Transcript Groups Folder | 100 | |
| Transcript Link (in Tran Groups Folder) | 101 | |
| Document Collection Folder | 110 | |
| Personal Collection Folder | 113 | |
| Companion Database | 112 | |
| Remote Database | 35 | |
| Briefcase | 111 | |
| CT CaseVault Transcript Repository | 114 | |
| Core DB Views Folder (non-searchable) | 102 | |
| Core DB Form View | 2 | |
| Core DB Column View | 3 | |
| Image View | 10 | |
| Realtime | 36 | |
| Case Organizer Folder | 108 | |
| Case Organizer Tab | 109 | |
| Searches Folder | 22 | |
| Search Item | 23 | |
| Script Folder | 27 | |
| Script | 28 | |
| Layout Folder | 25 | |
| Layout | 26 | |
| Slideshow Folder | 31 | |
| Slide | 32 |