HttpCommand and Conga
HttpCommand
uses Conga, Dyalog's TCP/IP utility library, for communications. HttpCommand
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.dll
andconga34ssl64.dll
are 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
conga
workspace.- A namespace named
Conga
which was introduced with Conga version 3.0 and implements behavior that makes it easier to run multiple Conga-based utilities in the same workspace.Conga
is the recommended API version to use. - A namespace named
DRC
which is retained for backward-compatibility with applications which use earlier versions of Conga.DRC
should 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 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, HttpCommand
will attempt find or copy the Conga API and then initialize it. HttpCommand
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
HttpCommand
resides for a namespace named eitherConga
orDRC
, in that order. - Failing that, look in the root namespace
#
for a namespace named eitherConga
orDRC
, in that order.
- First look in the namespace where
- If neither version of the API is found in the current workspace,
HttpCommand
will attempt to copy the API (firstConga
thenDRC
) from theconga
workspace. The API is copied into theHttpCommand
class which means there will be no additional footprint in workspace.HttpCommand
will attempt to copy the API as follows:- If the
DYALOG
environment 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,
HttpCommand
will initialize Conga as follows:- If the
Conga
version of the API is used,HttpCommand
will initialize it with a root name of'HttpCommand'
. - If the
DRC
version of the API is used,HttpCommand
will simply initialize it. AsDRC
does 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
HttpCommand.LDRC
.
Overriding Default Locations
There are two methods to tell HttpCommand
's default behavior, both of which involve setting a shared public field in the HttpCommand
class.
- If you have the
Conga
namespace in your workspace in other than default locations theHttpCommand
will search,HttpCommand.CongaRef
can be used to specify its location.CongaRef
can be an actual reference to the namespace or a character array representing the location. For instance:
HttpCommand.CongaRef←#.Utils.Conga
or
HttpCommand.CongaRef←'#.Utils.Conga'
This can be useful when integratingHttpCommand
into an application that also uses Conga. HttpCommand.CongaPath
can be used to specify the path to the shared library files and optionally the conga workspace. This can be useful when bundlingHttpCommand
in a distributed application. For instance:
HttpCommand.CongaPath←(⊃1 ⎕NPARTS ''),'/conga/'
would tellHttpCommand
to find the shared libraries in the/conga/
subfolder of the current folder. See IntegratingHttpCommand
for more information.
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
conga
workspace in a folder and setCongaPath
to point to that folder. - Put the
Conga
namespace in your workspace (pointingCongaRef
to it if necesssary) and the shared libraries in a folder setCongaPath
to point to that folder.