Importing and exporting methods

Using the MDU’s import/export feature, you can export entries from one SMC and then import them into a different SMC. The export feature writes all the methods in the SMC to an XML file. You can then use the import feature to replace the entire catalog, update and add selected interfaces, or add selected methods. You can perform an import/export from within the MDU (see To import methods from the MDU and To export methods from the MDU) or from the command line, without displaying the MDU user interface (see To import and export methods from the command line).

Import/export can be used to do the following:

To import methods from the MDU

Before importing, you should verify that no one else is using the SMC files you are importing into.

1. Open the SMC that you want to import methods into. You can do this from Main > Catalog Location, or you can restart the MDU and specify the catalog location on the command line.
2. From the methods list, select Utilities > Import Methods.
3. Complete the fields in the Import Details window:

Select mode

Select the type of import desired:

XML file

Type the filename of the XML file that contains the data to import or select Functions > Browse to select it. (On Windows, you can click the drilldown button to select the file.) To import the default methods such as XFPL_REGCLEANUP, choose the defaultsmc.xml file located in your DBLDIR directory.

Log file

Enter a filename for the error log or accept the default name (import_smc.log). If no path is specified, the log will be created in the current working directory on OpenVMS and in the location specified with the TEMP environment variable on Windows and Unix.

4. Select OK or press F3.

If you selected “Replace entire SMC”, the data in the XML file will be imported immediately. See step 7.

If you selected “Update interfaces” or “Add new methods”, a list of items will display. On the Select Interfaces list, an X in the “In SMC” column indicates that the interface is present in the current SMC. If you select this interface for import, the existing interface in the SMC will be deleted and the one in the XML file will be imported.

Note

If you selected “Add new methods”, you’ll see a list of either method names or method IDs, depending on the current toggle view setting. You can press Ctrl+V or select Functions > Toggle View while this list is displayed to switch the display.

5. Press Enter (on Windows, you can also double-click) to mark items on the list for import. An asterisk in the left column indicates an item is selected. To unselect an item, double-click or press Enter again.
6. Once you’ve selected all the items, select OK or press F3 to complete the import.
7. The import function validates the information in the XML file before importing it. If errors are found, you’ll see a message to that effect, a log file will be created, and the SMC will not be updated. Check the log file to see what the problems are, correct them in the XML file, and then re-import.

To export methods from the MDU

If your SMC includes references to repository structures or enumerations, the repository must be present to do an export. This is because the export function reads the structure and enumeration details from the repository.

Upon export, structure sizes in the SMC are checked against the corresponding structures in the repository and the utility returns an error if there are any size discrepancies or if there are missing structures or enumerations. You can use the Verify Catalog utility to update the structure sizes in the SMC. See Verifying repository structure sizes and enumerations for details.

1. Verify that the current SMC is the one that you want to export methods from. You can select Main > Catalog Location to check (or change) the location of the current catalog.
2. From the methods list, select Utilities > Export Methods.
3. At the prompt, type a name for the XML file, and then select Save or press Enter.

To import and export methods from the command line

The mdu -i, -u, and -e options enable you to import and export SMC definitions from the command line without displaying the MDU user interface. Importing from the command line does not offer as many options as does using the MDU user interface: you cannot select individual interfaces or methods for import.

For the MDU command line syntax see Method Definition Utility.