Altova Global Resources are portable references to files, folders, or databases. When stored as Global Resources, paths and database connection details become reusable and available across multiple Altova applications. For example, if you frequently need to open the same file in multiple Altova desktop applications, you may find it convenient to define it as a Global Resource. This way, you don't even need to remember the file path because you can select the respective Global Resource from the "Open File" dialog box instead. This also has the advantage that, if the file path ever changes, you will change it in one place only.
A typical usage of Global Resources is to define a database connection once and reuse it across all Altova applications that support Global Resources. For example, you can create a database connection on the machine where a MapForce mapping was designed and then reuse the same connection on the machine where MapForce Server runs the mapping (this may require, in some cases, that both machines have the same database client software installed).
Optionally, you can create multiple variations of the same Global Resource (known as "configurations"). This lets you easily switch file or folder paths (or even databases) depending on your needs. For example, you could create a "database" resource with two configurations: "development" and "production". Taking MapForce Server as example, you could then easily retrieve data from either the development or production database, by indicating the desired configuration as command line parameter at mapping runtime.
You can create Global Resources from the following Altova desktop applications: Altova Authentic, DatabaseSpy, MobileTogether Designer, MapForce, StyleVision, and XMLSpy. On the server side, Global Resources can be consumed by the following Altova server applications: FlowForce Server, MapForce Server, RaptorXML Server, RaptorXML+XBRL Server.
For more information about creating Global Resources, refer to the "Altova Global Resources" chapter of MapForce documentation.
When you compile a mapping to a MapForce Server execution file (.mfx), any Global Resource references used by the mapping are preserved, not resolved. This means that you will need to provide these references on the server side in order to run the mapping successfully. More specifically, in MapForce Server, the following is required to run an .mfx file which uses Global Resources:
1.The Global Resource XML file. On the machine where MapForce is installed, the file is called GlobalResources.xml, and you can find it in the Documents\Altova folder. You can copy this file to the machine where MapForce Server runs, and you can also create multiple such files if necessary.
2.The Global Resource configuration name. Each Global Resource has a default configuration called "Default", but you can create additional configurations if so required. If you created additional configurations, then you must specify the desired configuration name instead of "Default".
In MapForce, the Global Resource file path and the Global Resource configuration name are set or changed from the graphical user interface. In MapForce Server, these are specified at mapping runtime.
•If you run the mapping through the command line interface, set the options --globalresourceconfig and --globalresourcefile after the run command, for example:
C:\Program Files (x86)\Altova\MapForceServer2020\bin\MapForceServer.exe run SomeMapping.mfx --globalresourcefile="C:\Users\me\Documents\Altova\GlobalResources.xml" --globalresourceconfig="Default"
•If you run the mapping through the MapForce Server API, call the method SetOptions two times before calling the Run method. The first call is required to supply the Global Resource XML file path as option, and the second one is required to supply the Global Resource configuration name. For further information, see the MapForce Server API.