Delete FGDC hints

Created:6/1/2001
Description:

The FGDC Synchronizer provided with ArcCatalog adds hints indicating which elements that are mandatory in the FGDC metadata standard are incomplete. This tip demonstrates how to remove those hints. This may be useful before validating the metadata with the FGDC metadata parser utility, mp, or another application.

NOTE: this macro doesn't verify that the selected object supports metadata, whether it already has metadata, or whether the metadata is writable. For an example of how this is accomplished, look at the function HasWritableMD in the CheckMD module provided with the Metadata Spellchecker sample.


How to use:
Sub DeleteFGDCHints()

    Dim pGxApp As IGxApplication
    Dim pGxView As IGxView
    Dim pMD As IMetadata
    Dim pPS As IPropertySet
    Dim dNow As Date

    Set pGxApp = Application
    Set pMD = pGxApp.SelectedObject
    Set pPS = pMD.Metadata
    
    ' remove hints that would have been added with ArcCatalog 8.1; 
    ' the information is the same as at 8.0, but the word "required"
    ' now appears at the beginning so the elements stand out better
    pPS.RemoveProperty "idinfo/descript/abstract[. = 'REQUIRED: A brief narrative summary of the data set.']"
    pPS.RemoveProperty "idinfo/descript/purpose[. = 'REQUIRED: A summary of the intentions with which the data set was developed.']"
    pPS.RemoveProperty "idinfo/citation/citeinfo/origin[. = 'REQUIRED: The name of an organization or individual that developed the data set.']"
    pPS.RemoveProperty "idinfo/citation/citeinfo/pubdate[. = 'REQUIRED: The date when the data set is published or otherwise made available for release.']"
    pPS.RemoveProperty "idinfo/timeperd/current[. = 'REQUIRED: The basis on which the time period of content information is determined.']"
    pPS.RemoveProperty "idinfo/timeperd/timeinfo/sngdate/caldate[. = 'REQUIRED: The year (and optionally month, or month and day) for which the data set corresponds to the ground.']"
    pPS.RemoveProperty "idinfo/status/progress[. = 'REQUIRED: The state of the data set.']"
    pPS.RemoveProperty "idinfo/status/update[. = 'REQUIRED: The frequency with which changes and additions are made to the data set after the initial data set is completed.']"
    pPS.RemoveProperty "idinfo/spdom/bounding/westbc[. = 'REQUIRED: Western-most coordinate of the limit of coverage expressed in longitude.']"
    pPS.RemoveProperty "idinfo/spdom/bounding/eastbc[. = 'REQUIRED: Eastern-most coordinate of the limit of coverage expressed in longitude.']"
    pPS.RemoveProperty "idinfo/spdom/bounding/northbc[. = 'REQUIRED: Northern-most coordinate of the limit of coverage expressed in latitude.']"
    pPS.RemoveProperty "idinfo/spdom/bounding/southbc[. = 'REQUIRED: Southern-most coordinate of the limit of coverage expressed in latitude.']"
    pPS.RemoveProperty "idinfo/keywords/theme/themekt[. = 'REQUIRED: Reference to a formally registered thesaurus or a similar authoritative source of theme keywords.']"
    pPS.RemoveProperty "idinfo/keywords/theme/themekey[. = 'REQUIRED: Common-use word or phrase used to describe the subject of the data set.']"
    pPS.RemoveProperty "idinfo/accconst[. = 'REQUIRED: Restrictions and legal prerequisites for accessing the data set.']"
    pPS.RemoveProperty "idinfo/useconst[. = 'REQUIRED: Restrictions and legal prerequisites for using the data set after access is granted.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntorgp/cntper[. = 'REQUIRED: The person responsible for the metadata information.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntorgp/cntorg[. = 'REQUIRED: The organization responsible for the metadata information.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntaddr/addrtype[. = 'REQUIRED: The mailing and/or physical address for the organization or individual.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntaddr/city[. = 'REQUIRED: The city of the address.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntaddr/state[. = 'REQUIRED: The state or province of the address.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntaddr/postal[. = 'REQUIRED: The ZIP or other postal code of the address.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntvoice[. = 'REQUIRED: The telephone number by which individuals can speak to the organization or individual.']"
    
    ' remove hints that would have been added with ArcCatalog 8.0
    pPS.RemoveProperty "idinfo/descript/abstract[. = 'A brief narrative summary of the data set.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/descript/purpose[. = 'A summary of the intentions with which the data set was developed.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/citation/citeinfo/origin[. = 'The name of an organization or individual that developed the data set.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/citation/citeinfo/pubdate[. = 'The date when the data set is published or otherwise made available for release.  REQUIRED']"
    pPS.RemoveProperty "idinfo/timeperd/current[. = 'The basis on which the time period of content information is determined.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/timeperd/timeinfo/sngdate/caldate[. = 'The year (and optionally month, or month and day) for which the data set corresponds to the ground.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/status/progress[. = 'The state of the data set.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/status/update[. = 'The frequency with which changes and additions are made to the data set after the initial data set is completed.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/spdom/bounding/westbc[. = 'Western-most coordinate of the limit of coverage expressed in longitude.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/spdom/bounding/eastbc[. = 'Eastern-most coordinate of the limit of coverage expressed in longitude.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/spdom/bounding/northbc[. = 'Northern-most coordinate of the limit of coverage expressed in latitude.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/spdom/bounding/southbc[. = 'Southern-most coordinate of the limit of coverage expressed in latitude.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/keywords/theme/themekt[. = 'Reference to a formally registered thesaurus or a similar authoritative source of theme keywords.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/keywords/theme/themekey[. = 'Common-use word or phrase used to describe the subject of the data set.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/accconst[. = 'Restrictions and legal prerequisites for accessing the data set.  REQUIRED.']"
    pPS.RemoveProperty "idinfo/useconst[. = 'Restrictions and legal prerequisites for using the data set after access is granted.  REQUIRED.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntorgp/cntper[. = 'The person responsible for the metadata information.  REQUIRED.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntorgp/cntorg[. = 'The organization responsible for the metadata information.  REQUIRED.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntaddr/addrtype[. = 'The mailing and/or physical address for the organization or individual.  REQUIRED.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntaddr/city[. = 'The city of the address.  REQUIRED.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntaddr/state[. = 'The state or province of the address.  REQUIRED.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntaddr/postal[. = 'The ZIP or other postal code of the address.  REQUIRED.']"
    pPS.RemoveProperty "metainfo/metc/cntinfo/cntvoice[. = 'The telephone number by which individuals can speak to the organization or individual.  REQUIRED.']"
    
    ' set the time that the metadata was modified, then 
    ' save the changes
    dNow = Now
    pPS.SetProperty "Esri/ModDate", Format(dNow, "yyyymmdd")
    pPS.SetProperty "Esri/ModTime", Format(dNow, "HhNnSs") & "00"
    pMD.Metadata = pPS

    Set pGxView = pGxApp.View
    If TypeOf pGxView Is IGxDocumentationView Then
        pGxView.Refresh
    End If
    
End Sub