Summary
Publishes metadata to a metadata catalog such as an ArcIMS Metadata Service.
The Metadata Publisher tool retrieves the source item's metadata, then a copy of this metadata document is passed to the Publisher specified in the tool. If the source item is a stand-alone XML file, a copy of the file itself will be passed to the Publisher. The Publisher uses information from the tool parameters and from the metadata document to create a request to publish the document to the specified metadata catalog.
Usage
This topic describes how the current version of ArcGIS for Desktop can be used with a Metadata Service hosted by a previous version of ArcIMS.
A publisher is provided with ArcGIS for Desktop that supports publishing ArcGIS metadata to an ArcIMS Metadata Service. This publisher, named arcimsmd.xml, can be found in the <ArcGIS Installation Location>\Metadata\Publisher folder.
This publisher uses the contents of the metadata to construct an appropriate ArcXML PUBLISH_METADATA request. FGDC metadata content is checked first. If appropriate information isn't found, the publisher then checks ArcGIS metadata content. The metadata will be published even if it does not contain the information required by the ArcIMS Metadata Explorer application.
Documents in an ArcIMS Metadata Service are uniqely identified using a GUID. When you publish a document to an ArcIMS Metadata Service, if the document doesn't already have a GUID in the <rootElement>/Esri/PublishedDocID element one will be generated and stored in that location if you have write access to the metadata. This identifier ensures that when the document is later updated and republished, the existing copy on the server is replaced.
If you publish metadata using a custom model that removes private information before publishing and if the Source Metadata item did not previously have a unique identifier, the identifier created by this tool will be saved to the model's intermediate data but not to the original item.
To avoid this problem, you can add a unique identifier to an item's metadata before it is published using the XSLT Transformation tool with the add unique identifier.xslt file provided in the <ArcGIS Installation Location>\Metadata\Stylesheets\gpTools folder. This operation is safeāif the metadata already has a unique identifier the existing identifier will remain untouched. Be sure to save the version of the metadata containing the new identifier with the original ArcGIS item; otherwise, the next time its metadata is published the ArcIMS Metadata Service will have two documents describing the same item with two different identifiers.
If you publish metadata to an ArcIMS Metadata Service you must provide credentials for a user who has been given permission to publish documents to that service. If you have trouble publishing, connect to ArcIMS server in the Catalog window with the same credentials. If you have permission to publish documents with those credentials the Metadata Service's icon will show a hand holding a pencil .
This tool will not publish metadata associated with some ArcGIS items such as map, globe, and scene documents; layer files; text files; Excel files; file types; ArcIMS services; and geoprocessing tools. Publishing these items will produce an Unsupported source error message.
If the metadata document does not consist of well-formed XML and the metadata is published with this tool, the tool will produce an Unsupported source error message.
The Source Metadata parameter has a complex data type. If you use this tool in a model, create a variable for the Source Metadata parameter in ModelBuilder by right-clicking the tool and choosing Make Variable > From Parameter > Source Metadata.
When using this tool in ModelBuilder, the Output Metadata parameter is derived from the Source Metadata parameter.
Syntax
MDPublisher_conversion (source, publisher, {url}, {service}, {user}, {password})
Parameter | Explanation | Data Type |
source | The item whose metadata will be published, or a stand-alone XML file that will be published. | Data Element; Layer |
publisher | An XML file that defines how the metadata will be published. | File |
url (Optional) | The URL of a Web Service that hosts the metadata catalog, if appropriate. For example, the URL of an ArcIMS Server that provides a Metadata Service. | String |
service (Optional) | The name of the service to which you want to publish, if appropriate. For example, for an ArcIMS Metadata Service this is the case-sensitive name of the Metadata Service. | String |
user (Optional) | The name used to access the metadata catalog when publishing documents, if appropriate. For example, when publishing documents to an ArcIMS Metadata Service you must log in to the service using a name that has been granted metadata_publisher privileges or a higher privilege. | String |
password (Optional) | The password you used to access the metadata catalog when publishing documents, if appropriate. For example, when publishing documents to an ArcIMS Metadata Service, this is the password required to log in with the specified User Name. | String |
Code sample
Publish an ArcGIS item's metadata to an ArcIMS Metadata Service
An ArcGIS item's metadata is published to an ArcIMS Metadata Service. This sample won't complete successfully unless a valid ArcIMS Metadata Service is identified and a valid User Name and Password with sufficient privileges are provided.
import arcpy
from arcpy import env
env.workspace = "C:/data/data.gdb"
#set local variables
dir = arcpy.GetInstallInfo("desktop")["InstallDir"]
pub = dir + "Metadata/Publisher/arcimsmd.xml"
arcpy.MDPublisher_conversion("locations", pub, "http://myserver", "Metadata",
"myUsername", "myPassword")
Environments
Licensing information
- ArcGIS for Desktop Basic: Yes
- ArcGIS for Desktop Standard: Yes
- ArcGIS for Desktop Advanced: Yes