Set Synchronized Properties

Description:

This sample implements the ICommand interface and is intended to be used within the ArcCatalog application. You may want to use this sample after importing metadata that was created outside ArcCatalog; the imported metadata won't be updated with the current properties of the data. When you click this command a dialog appears presenting the FGDC metadata elements that can be updated by the Catalog. The check boxes reflect the current status of the metadata; check or uncheck elements to change whether or not they are updated automatically. Elements that are disabled don't exist in the metadata.



The FGDC metadata elements which will be updated have an XML attribute named "Sync" whose value is "TRUE". For example, <networkr Sync="TRUE">, where networkr is the FGDC element containing the current location of the data. When the metadata is "synchronized", the Catalog updates the contents of the Sync="TRUE" elements with the appropriate properties of the data. For example, if the four bounding coordinate elements have Sync="TRUE", the metadata will be updated with the current extent of the geographic features. If the title element has Sync="TRUE", it will be updated with the item's name; the title will change when the item is renamed.



Setting an element's Sync attribute to TRUE does not guarantee that it will be updated by the Catalog. For example, if raster information was mistakenly provided for a shapefile the Catalog would be unable to update that information. Similarly, extent information can't be set for projection files, etc.


How to use:
  1. Register the custom tool with the ArcCatalog application. To do this, start ArcCatalog, click the Tools menu, and click Customize.
  2. In the Customize dialog box, click Add from file. Browse to the compiled SynchUp.dll and click Open. The Add Objects dialog box shows which components were added. Click OK.
  3. Click the Commands tab. Select Metadata Samples in the Categories list. Drag the Set Synchronized Properties command from the Commands list and drop it on any visible toolbar.
  4. Close the Customize dialog box.
  5. Click the Advanced Synchronization command to edit the metadata of the first selected item in the Catalog.

Application:
ArcCatalog

Difficulty: Intermediate


Visual Basic
File Description
clsSynch.cls Class file implementing ICommand interface.
frmSynch.frm Form containing check boxes for elements that can be synchronized.
frmImage.frm Form containing the bitmap used as the button's image.
SynchUp.vbp The project file for the sample button.
SynchUp.dll The compiled project.


Key CoClasses: XmlPropertySet, GxApplication, GxObject, GxView, UID
Key Interfaces: IMetadata, IPropertySet, IXmlPropertySet, IGxApplication, IGxDatabase, IGxDataset, IWorkspaceName
Key Members: IMetadata::Metadata, IMetadata::Synchronize, IPropertySet::GetProperty, IXmlPropertySet::GetPropertiesByAttribute, IXmlPropertySet::SetAttribute, IGxApplication::SelectedObject, IGxObject::ClassID, IUID::Compare, IGxView::Refresh