Configuring Style Files

To set up your driver, you must create or modify several style files:

You must modify the gateway definition file (style.vgw) to include either your gateway’s DDA specification file or the DDA specification itself. For more information, see Gateway Definition File.


You can create a separate DDA specification (*.vgw) file if you do not include the actual specification in the gateway definition file. For more information, seeDDA Specification File.


You can create a gateway field (*.gfl) file, which also involves modifying the style.xfl file, to include standard gateway fields, such as ACL caching information. For more information, see Gateway Field File.


You can create a type parameter (*.prm) file to specify behaviors, such as the syntax to use for keys or whether access rights should be cached. For more information, see, Type Parameter File.


You can create a configuration (*.cfg) file to specify any gateway-specific configuration information. For more information, see Gateway Configuration File.


Gateway files have the name vgwdda.*, where dda is the mnemonic you associate with your gateway; for example, ‘fsys’ in vgwfsys.vgw for the Verity file system gateway DDA specification or ‘http’ in vgwhttp.prm for the Verity HTTP gateway parameter file. These files are located in the common/styles subdirectory of the directory in which you installed K2 Developer.

The following sections describe these files in more detail. For complete documentation on style files, refer to the Verity Collection Reference.

Gateway Definition File

The gateway definition file (style.vgw) specifies the gateways whose repositories are available to be viewed or indexed. You can include the name of your gateway’s DDA specification file in the gateway definition file. For example, the default style.vgw file includes the file system gateway with the following statement:

$include vgwfsys.vgw

You can also include the DDA specification itself in your gateway definition file. The following section describes the contents.

DDA Specification File

The DDA specification (*.vgw) file contains the connection specification that the Verity engine uses to determine the gateway driver to load for a particular protocol. For more information about connection specifications, see the “DDA Specification” appendix of the Verity Developer’s Kit Programming Reference. The following lines from the sample driver, vgwsamp, show the dda line that specifies the driver:

# DDA spec.for loading Verity Sample Gateway shared object
protocols: samp
dda: vgwsamp
dda: "vgwsamp -nosec"

The dda: tag identifies the connection specification. At a minimum, it specifies the driver’s filename without any extension, vgwsamp in this example, which is used as the entry point function name if one is not specified. The driver name can be fully qualified with a protocol, path, and suffix. Arguments, which are passed to the driver’s initialization callback function, follow the driver name and are separated by white space; for example, -nosec in this example. If you want security and caching behavior, the DDA specification file should include the type parameter file. For more information, see Type Parameter File.

Gateway Field File

A gateway field (*.gfl) file specifies the internal fields to be returned from the gateway; typically, these fields are used to cache access rights for documents in the gateway’s repository. The gateway field file should include the gateway’s type parameter (*.prm) file to specify caching behavior. For more information, see Type Parameter File.

After you create your gateway field file, you must include it from the style.xfl file; for example, the default style.xfl file includes the file system gateway fields with the following statement:

$include vgwfsys.gfl

Type Parameter File

A type parameter (*.prm) file specifies behaviors to associate with a gateway. Typically, all gateway style files include the type parameter file, which defines conditions that represent requested behaviors. The style files that include a type parameter file use the conditions to determine which of their components are included. For example, the vgwsamp.prm file contains the following line that defines a behavior that allows caching of the ACL when indexing a collection associated with the repository:


The vgwsamp.gfl uses the behavior to determine whether to create an internal field to hold the access control list:

$include vgwsamp.prm

data-table: _g1
   varwidth: _VgwSampAccessCache  _gz

varwidth: VgwDocKey _gv
varwidth: VgwViewURL _gv

The vgwsamp.vgw file uses the behavior to determine whether to populate the collection with the external field during indexing:

$include vgwsamp.prm

# Copy Access Rights Cache information into the DDD.
# This allows faster access rights checking during searches.
copy: _VgwAccessValue _VgwSampAccessCache

Gateway Configuration File

A gateway configuration (*.cfg) file allows you to include configuration information about your gateway. The contents of this file are specific to your gateway. Typically, the configuration information contains control information that your gateway uses to map the repository’s schema or data structures from the repository to the tokens used to return document content and other information to the Verity engine.

You can locate this file using the configDirectory member of the VgwSessionNewArgRec structure, which is available to your gateway driver’s VgwSessionNewFnc function.