Jarvis and Conga
Jarvis uses Conga, Dyalog's TCP/IP utility library, for communications. In general most of Jarvis' default Conga-related settings can be left unchanged. The most likely setting you will want to change is the port number.
Jarvis requires Conga version 3.0 or later. Conga consists of two elements:
- Two shared library files whose names begin with "conga" and are found in the Dyalog installation folder. The names of the files varies based on the platform they are running on and the specific version of Conga; for instance
conga34_64.dllandconga34ssl64.dllare the shared library files for Conga version 3.4 for the 64-bit version of Dyalog for Windows. - An APL-based API to communicate with the shared libraries. There are two versions of the API both of which are available in the
congaworkspace.- A namespace named
Congawhich was introduced with Conga version 3.0 and implements behavior that makes it easier to run multiple Conga-based utilities in the same workspace.Congais the recommended API version to use. - A namespace named
DRCwhich is retained for backward-compatibility with applications which use earlier versions of Conga.DRCshould only be used in an application where backward compatibility is necessary.
- A namespace named
The Conga API looks for a matching version of the shared libraries; as such the version of the API and the shared libraries must be the same. For more information on Conga please refer to the Conga User Guide.
Default Behavior
When first run, Jarvis will attempt to find or copy the Conga API and then initialize it. Jarvis will attempt to use the Conga version of the API in preference to the DRC version. In general, all of this is transparent to the user.
- Look in the current workspace for the Conga API:
- First look in the namespace where
Jarvisresides for a namespace named eitherCongaorDRC, in that order. - Failing that, look in the root namespace
#for a namespace named eitherCongaorDRC, in that order.
- First look in the namespace where
- If neither version of the API is found in the current workspace,
Jarviswill attempt to copy the API (firstCongathenDRC) from thecongaworkspace. The API is copied into theJarvisclass which means there will be no additional footprint in workspace.Jarviswill attempt to copy the API as follows:- If the
DYALOGenvironment variable exists, use its folder. Otherwise use the folder from the command line used to start Dyalog. - If that fails, then attempt to copy from the "current" folder as determined by
⊃1 ⎕NPARTS ''
- If the
- If the API was found or successfully copied,
Jarviswill initialize Conga as follows:- If the
Congaversion of the API is used,Jarviswill initialize it with a root name of'Jarvis'. - If the
DRCversion of the API is used,Jarviswill simply initialize it. AsDRCdoes not support multiple roots, care should be taken if other Conga-using utilities also reside in the workspace.
- If the
- If the API was successfully initialized, a reference to the API root can be found in the shared
LDRCfield.
Overriding Default Locations
There are two methods to tell Jarvis's default behavior, both of which involve setting a shared public field in the Jarvis class.
- If you have the
Conganamespace in your workspace in other than default locations theJarviswill search,Jarvis.CongaRefcan be used to specify its location.CongaRefcan be an actual reference to the namespace or a character array representing the location. For instance:
Jarvis.CongaRef←#.Utils.Congaor
Jarvis.CongaRef←'#.Utils.Conga'
This can be useful when integratingJarvisinto an application that also uses Conga. Jarvis.CongaPathcan be used to specify the path to the shared library files and optionally the conga workspace. This can be useful when bundlingJarvisin a distributed application. For instance:
Jarvis.CongaPath←(⊃1 ⎕NPARTS ''),'/conga/'would tellJarvisto find the shared libraries in the/conga/subfolder of the current folder.
Using Other Versions of Conga
If you need to use a version of Conga other than the one in the Dyalog installation folder, there are two ways to accomplish this:
- Put the shared libraries and the
congaworkspace in a folder and setJarvis.CongaPathto point to that folder. - Put the
Conganamespace in your workspace (pointingJarvis.CongaRefto it if necessary) and the shared libraries in a folder setJarvis.CongaPathto point to that folder.
Multiple Conga-using Components
Conga is used by several Dyalog utilities and packages including Jarvis, HttpCommand, isolate, EWC, and DFS (Dyalog File Server). You might also use it in your application. When you have multiple Conga-using components in your application it is recommended to have a single instance of the Conga namespace which loads the Conga shared libraries once. Each component should then create their own Conga root.