Altova MapForce 2024 Professional Edition

Folders as Global Resources

Home Prev Top Next

This topic explains how to use folders as global resources. There are situations in which you may need to generate the same output in different directories. To make this possible, we will create a folder alias with two configurations:

 

1.The Default configuration will generate the output in C:\Test.

2.The Production configuration will generate the output in C:\Production.

 

To create and configure the folder alias, take the steps below.

 

Step 1: Create a global resource

First, we need to create a folder alias. Follow the instructions below:

 

1.Click the ic-globrec toolbar button (Manage Global Resource). Alternatively, go to the Tools menu and click Global Resources.

2.Click Add | Folder and enter a name in the Resource alias text box. In this example, we call our default configuration OutputDirectory.

3.Click the Browse button near the text field Settings for configuration "Default" and select C:\Test. Make sure this folder already exists on your operating system.

4.Click glob-addic and enter a name of the second configuration. In this example, we call our second configuration ProductionDirectory.

5.Click Browse and select the C:\Production folder. Make sure that this folder already exists on your operating system.

 

Step 2: Use the global resource in the mapping

The next step is to make the mapping use the folder alias we have just created. Take the steps below:

 

1.Open the Tutorial\Tut-ExpReport.mfd mapping.

2.Double-click the header of the target component to open the Component Settings dialog box.

3.Click Global Resources and then click Save.

4.Save the output XML file as Output.xml. The output XML file path has now become altova://folder_resource/OutputDirectory/Output.xml, which indicates that the path is defined as a global resource.

 

Step 3: Run the mapping with the desired configuration

You can now switch between the output folders before running the mapping:

 

To use C:\Test as the output directory, select the menu item Tools | Active Configuration | Default.

To use C:\Production as the output directory, select the menu item Tools | Active Configuration | ProductionDirectory.

 

By default, the mapping output is written as a temporary file unless you explicitly configure MapForce to write output to permanent files. To configure MapForce so that it generates permanent files, do the following:

 

1.Go to the Tools menu and click Options.

2.In the General section, select the option Write directly to final output files.

 

© 2017-2023 Altova GmbH