A Global Resource alias is a reusable reference which represents a file or folder path, or a database connection. Aliases are defined only once and can be reused as many times as necessary in contexts which support them, including across multiple Altova applications. Taking databases as example, if you frequently work with a specific database in more than one Altova application, then it is a good idea to add the database connection as a Global Resource. This way, you wouldn't need to go through all the Database Connection Wizard steps each time when you need to connect to the same database from another Altova application.
File, folder, and database aliases are configurable in their turn, by means of so-called "configurations". Configurations make it possible to easily switch between files, folders and databases that are consumed or produced by Altova applications, which is particularly useful for testing scenarios. For example, you could create a database alias that consists of three separate connections to the same database, each with a different driver kind: (a) ODBC, the default connection kind, (b) JDBC, and (c) ADO.NET. This way, to connect to the database with a specific driver, you would just select the corresponding configuration from the Global Resources drop-down list before running the mapping.
Global Resources drop-down list
Configurations can also help you generate mapping output to variable folders, with a click of a button. For example, you could create a folder alias with two configurations: (a) "Testing", which points to directory C:\Testing and (b) "Production", which points to directory C:\Production. It is then possible to configure a mapping to generate output to either C:\Testing or C:\Production folders, just by selecting the required configuration from the Global Resources drop-down list before running the mapping. This example is discussed in more detail in Example: Generate Output to Variable Folders.
How to create a Global Resource alias
|1.||On the Tools menu, click Global Resources. (Alternatively, click the Global Resource toolbar button.)|
|2.||Click Add and select the resource type you wish to create (file, folder, database).|
|3.||Enter a descriptive name for this alias in the Resource alias text box (for example, "MappingInputFile", "MappingOutputFolder", "DatabaseConnection").|
|4.||Set up the "Default" configuration:|
|a)||If it's a file or folder, browse for the file or folder to which this resource should point by default.|
|b)||If it's a database connection, click Choose Database and follow the Database Connection Wizard to connect to the database . This database connection will be used by default when the mapping runs (unless a different configuration is explicitly selected from the Global Resources drop-down list or supplied as a command line parameter in server execution).|
|5.||Optionally, if the resource should have an additional configuration (for example, a driver kind in case of databases, or an alternative path in case of files or folders), click the Add configuration button, enter a descriptive name (for example "ProductionFolder" or "JDBC_Alternative"), and set it up as follows:|
|a)||If it's a file or folder, browse for the file or folder to which this resource should point as an alternative to the default configuration defined in previous step.|
|b)||If it's a database connection, follow the Database Connection Wizard to connect to the database. This database connection will be used as an alternative to the default one.|
In some cases, it might be more convenient to create a configuration as a copy of the default configuration, and then edit it. In this case, click the Add configuration as a copy of the currently selected configuration button.
|6.||Repeat the previous step for each additional configuration required.|
© 2019 Altova GmbH