Manage Function Libraries
In MapForce, you can import and use the following kinds of libraries in a mapping:
•Any mapping design files (*.mfd) that contain user-defined functions (UDFs). This specifically refers to mapping files that contain UDFs created with MapForce, using the MapForce built-in functions and components as building blocks. For further information, see Creating User-Defined Functions.
•Custom XSLT files that contain functions. This refers to XSLT functions written outside of MapForce that qualify for import into MapForce as described in Importing Custom XSLT Functions.
•Custom XQuery 1.0 files that contain functions. This refers to XQuery functions written outside of MapForce that qualify for import into MapForce as described in Importing Custom XQuery 1.0 Functions.
•Java .class files and .NET .dll libraries which qualify for import into MapForce as described in Importing Custom Java and .NET Libraries.
|Note:||You can import custom external libraries of functions either directly (no configuration required) or by configuring a MFF (MapForce Function File) recognized by MapForce. If you use the latter approach, you can also import C++ libraries, in addition to Java classes and .NET assemblies. Note that libraries imported via .mff files must meet the prerequisites mentioned in Referencing Java, C# and C++ Libraries Manually.|
Manage Libraries window
You can view and manage all libraries used by a mapping file from the Manage Libraries window. This includes UDFs and custom libraries.
By default, the Manage Libraries window is not visible. To display it, do one of the following:
•In the View menu, click Manage Libraries.
•Click Add/Remove Libraries at the bottom of the Libraries window.
You can choose to view UDFs and libraries only for the mapping document that is currently active or for all open mapping documents. To view imported functions and libraries for all of the currently open mapping documents, right-click inside the window and select Show Open Documents from the context menu.
To display the path of the open mapping document instead of the name, right-click inside the window and select Show File Paths from the context menu.
Data displayed in the Manage Libraries window is organized as a tree hierarchy as follows:
•Any currently open mapping documents are displayed as top-level entries. Each entry has two branches: User-Defined Functions and Own Library Imports.
oThe User-Defined Functions branch displays any UDFs contained in that document.
oThe Own Library Imports branch displays libraries imported locally into the current mapping document. The term "libraries" means other mapping documents (.mfd files that contain user-defined functions) or custom external libraries written in XSLT 1.0, XSLT 2.0, XQuery 1.0*, Java*, C#*, or .mff files mentioned previously. Note that the Own Library Imports structure could be several levels deep, since any mapping document may import any other mapping document as a library.
•The Global Library Imports entry encloses any custom libraries that you have imported globally at application level. Again, in case of .mfd files, the structure could be several levels deep, for the reasons mentioned above.
* These languages are supported only in MapForce Professional or Enterprise edition.
|Note:||The XSLT, XQuery, C#, and Java libraries may have dependencies of their own. Such dependencies are not displayed in the Libraries window.|
Context menu commands
You can quickly perform various operations against objects in the Manage Libraries window by right-clicking an object and selecting one of the following context menu options:
Opens the mapping.
Opens a dialog box where you can browse for a custom library of functions.
Own Library Imports
Locate Function in Libraries Window
Changes focus to the Libraries window, and selects the function.
Cut, Copy, Delete
These standard Windows commands are applicable only to MapForce user-defined functions. You cannot copy-paste functions from external XSLT files or other library kinds.
Lets you paste a user-defined function that was previously copied to clipboard into the current library.
Opens a dialog box where you can set or change options for the current library.
Show All Open Documents
When this option is switched on, the Manage Libraries window will display all currently open mappings. This is typically useful if you need to copy-paste functions between mappings. Otherwise, only the mapping that is currently in focus is shown.
Show File Paths
When this option is switched on, objects in the Manage Libraries window are displayed with their full path. Otherwise, only the object name is shown.