Metadata Batch Importer


This sample demonstrates how to create a metadata batch importer to be used within ArcCatalog. A metadata batch importer provides the ability to import many metadata documents to many data sets, or import one metadata document to many data sets, at one time. This sample is written to import only XML documents. To import other document types supported by ArcCatalog, change the code implementing the ImportXML CoClass. This sample implements both the IMetadataImport interface as well as the ICommand interface.

How to use:
  1. Register this sample's dll by compiling the sample or by using Regsvr32.exe.
  2. In the Customize dialog, click on 'Add from file' and select this sample's dll.
  3. Under the Commands tab, select the 'Batch Import Metadata' command from the Metadata Samples category, and drag it on to a toolbar. Dismiss the Customize dialog.
  4. From the ArcCatalog Contents Tab, select the data items to have metadata imported. Click the new "Batch Import Metadata" button. This will open the form. The 'Selected Item' column is populated with these selected items.
  5. Selected items may be removed from the list using the 'Delete Selected Items' button. Items may be added using the 'Add Items' button. This supports data from multiple folders.
  6. Two options for associating import files to the selected item are available. The 'Single File' option allows you to browse to a single file and use it as the import file for all items selected in the list. The other option is to select a folder containing import files. The sample does a string comparison between the import file and the item list and matches those with the same name.
  7. Once the table is complete, the 'Import' button imports the import files to the associated items.


Requires: c:\winnt\system32\msflexgrd.ocx

Difficulty: Intermediate

Visual Basic
File Description
cBatchImport.cls Class file implementing ICommand interface.
modFolderBrowse.bas Module containing code used the browse for folders dialog box.
fCommonDialog.frm Form containing a the common dialog contorl.
frmImage.frm Form containing the icon image.
frmMultiImport.frx Binary data file used to store binary information for the form.
frmMultiImport.frm The interface form where the user interacts.
BatchImport.vbp The project file for the sample batch metadata importer.
BatchImport.dll The compiled project.

Key CoClasses: ImportXML
Key Interfaces: IMetadataImport, ICommand
Key Members: IMetadataImport::Import