Sample Importer


This sample demonstrates how to create a custom metadata importer to be used within ArcCatalog. A metadata importer reads information from an external location and writes it to the selected item's metadata. The source location may be any type of file or relational database. This example does not open a file. It writes the string "default title" as the title in the item's metadata. The importers provided by ArcCatalog replace any existing metadata with the new set of metadata defined by the importer. This example instead adds the title to the existing set of metadata; new metadata will be created if it doesn't already exist. The class defining a metadata importer must implement the IMetadataImport interface. After creating a custom importer, you must register it with the ArcCatalog application.

How to use:
  1. Register the dll on your machine.
  2. Run Categories.exe from %ARCHOME%\bin.
  3. Navigate to the 'Metadata Importers' folder. Select the folder and click Add Object.
  4. Navigate to the compiled Importer.dll and click Open.
  5. The Add Objects dialog box appears listing "SampleImporter", which is checked by default. Click OK.
  6. In the Component Categories Manager, you can see that "Importer.SampleImporter" has been added to the list of components in the Metadata Importers category. Click OK.
  7. In ArcCatalog, click a shapefile or another data source in the Catalog tree. Click the Metadata tab and then click the Import Metadata button on the Metadata toolbar. The custom importer appears in the Format dropdown list in thhe Import Metadata dialog box.


Difficulty: Intermediate

Visual Basic
File Description
SampleImporter.cls Class file implementing the IMetadataImport interface.
Importer.vbp The project file for the sample importer.
Importer.dll The compiled project.

Key CoClasses: XmlPropertySet
Key Interfaces: IPropertySet
Key Members: IPropertySet::SetProperty,