Name

ExternalExport — specify Perl variables to dump to external file

SYNOPSIS

Global: Interchange::Object=Output_name...
Catalog: Object [->key_or_index]...

DESCRIPTION

The directive specifies Perl variables to dump to ExternalFile.

On global level, using the equal sign ("=") it is possible to specify original Perl structure and the resulting "translated" name in the output file. Global elements appear directly under each catalog hash in the output file.

On catalog level, it is not possible to "translate" names, but you can use the notation "->" to dump specific elements from array or hash structures. Catalog elements appear under hash key "external_config" under each catalog hash in the output file.

See the section called “EXAMPLES” for clarification.

DIRECTIVE TYPE AND DEFAULT VALUE

Global directive,
Catalog directive

EXAMPLES

Example: Defining ExternalExport

Here's a complete example and the expected result:

In interchange.cfg:

External yes
ExternalExport Global::Catalog=number_of_catalogs
ExternalFile /tmp/external

In catalog.cfg:

External yes
ExternalExport <<EOD
  CatalogName
  ScratchDefault
  ValuesDefault
  ScratchDir
  SessionDB
  Sess
  sionDatabase
  SessionExpire
  VendRoot
  VendURL
  SecureURL
  Variable->SQLDSN
  Variable->SQLPASS
  Variable->SQLUSER
EOD

After restarting Interchange, file /tmp/external will be created with the following contents (shown here in human-readable format):

{
  'number_of_catalogs' => 4,
  'Catalogs' => {
    'catalog1' => {
      'external_config' => {
        'VendRoot' => '/home/interchange/catalog1',
        'ValuesDefault' => {},
        'CatalogName' => 'catalog1',
        'SessionExpire' => 3600,
        'ScratchDefault' => {
          'mv_no_session_id' => '1',
          'mv_no_count' => '1',
          'mv_add_dot_html' => '1'
        },
        'SessionDB' => '',
        'ScratchDir' => '/home/interchange/catalog1/tmp',
        'VendURL' => 'http://myhost.mydomain.local/cgi-bin/catalog1',
        'SessionDatabase' => '/home/interchange/catalog1/session',
        'SecureURL' => 'http://myhost.mydomain.local/cgi-bin/catalog1',
        'Variable' => {
          'SQLUSER' => 'interch',
          'SQLDSN' => 'dbi:Pg:dbname=catalog1',
          'SQLPASS' => 'interch'
        }
      }
    }
  }
}

NOTES

For discussion and examples of connecting Interchange to external programs, see glossary entry external.

AVAILABILITY

ExternalExport is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

Interchange 5.9.0:

Source: lib/Vend/Config.pm
Line 524

['ExternalExport',   undef,         'Global::Catalog=Catalog'],

Source: lib/Vend/Config.pm
Line 717

['ExternalExport',   undef,            join " ", @External_directives],

AUTHORS

Mike Heins

SEE ALSO

ExternalFile(7ic), External(7ic)

DocBook! Interchange!