com.esri.arcgis.geoprocessing.tools.conversiontools
Class ESRITranslator
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.conversiontools.ESRITranslator
- All Implemented Interfaces:
- GPTool
public class ESRITranslator
- extends AbstractGPTool
Uses the ArcGIS metadata translation engine to export metadata content from ArcGIS to a stand-alone metadata XML file. The exported metadata will be formatted to satisfy the metadata standard associated with the specified translation.
The ESRI Metadata Translator tool is contained in the Conversion Tools tool box.
Usage tips:
- When metadata is translated to the ArcGIS metadata format using a "to ESRI-ISO" translation the original document is included in the resulting metadata as an enclosure. You can access the original document from the Metadata Properties dialog box in ArcCatalog.
- The metadata content validation messages provided by this tool account for detailed conditions documented in the metadata standard that can't be tested using XML Schema validation. For example, in ISO 19115-based metadata the value of the metadata hierarchy level element determines if a topic category is required or not; this condition can't be tested using an XML Schema.A topic category is required if the item contains spatial data. If the item is identified as spatial data but a topic category is missing, the validation error reported is Validation failed: em:Resource($a) --> es:not(em:Dataset($a)); em:identificationInfo($a, $b), em:topicCategory($b, $c), em:lookupCodeName($c, gmxRes:MD_TopicCategoryCode). This statement means that the item has to either not be a dataset or a valid topic category code must be provided, and in this case neither is true.
- The output files produced by this tool can't be stored in a geodatabase. If the environment is set to a geodatabase the output files will be stored in a different location, as described below.
- 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, pointing to Make VariableFrom ParameterSource Metadata.
- Each Translator references files containing validation rules. The message Starting validation indicates validation is beginning using the rules in the specified file. The validation rules defined in ISO19139_min_schema.txt cover the minimum mandatory requirements for ISO metadata, and the rules defined in ESRI-ISO_schema.txt address the remaining metadata elements.These rules identify if mandatory elements have been provided, if conditional elements are required and provided, and if the value provided in a metadata element is of the correct data type. Validation rules can't detect cardinality issues such as only one purpose element is allowed but two have been provided. Any validation issues found are reported as warnings in the tool's messages. For example, a metadata contact is required in ISO metadata. The following warning indicates complete metadata contact information hasn't been provided: Validation failed: em:Metadata($a) --> em:contact($a, $b), em:CI_ResponsibleParty($b). That is, a metadata contact hasn't been provided at all, or the contact information provided doesn't follow the rules for contacts defined in the CI_ResponsibleParty information class in the ISO 19115 metadata standard.After validation the translator generates the output metadata XML file. Cardinality rules are tested at this time. If more than the expected number of elements exist, none of them will be written to the output metadata XML file. Some validation issues prevent the translator from generating valid output XML and will also reported as warnings in this phase. For example, if a valid metadata contacts hasn't been provided this information can't be included in the output: Error [InvalidForSome]: for-some clause: em:contact(v:Metadata, v:Object) . That is, one or more contact elements could not be added to the MD_Metadata element in the output XML file; this message is a warning even though it begins with the word error.
- The Translator XML files that configure a translation are provided with ArcGIS Desktop in the install location in the Metadata\Translator folder. If you open one of these files in an XML editor you'll see the translator element has an attribute stopOnErrors. This attribute can have one of three values: yes, no, any. When including this tool in a model, you may prefer to copy one of the default Translators and change the stopOnErrors value to produce the desired behavior.
Constructor Summary |
ESRITranslator()
Creates the ESRI Metadata Translator tool with defaults. |
ESRITranslator(Object source,
Object translator)
Creates the ESRI Metadata Translator tool with the required parameters. |
ESRITranslator
public ESRITranslator()
- Creates the ESRI Metadata Translator tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
ESRITranslator
public ESRITranslator(Object source,
Object translator)
- Creates the ESRI Metadata Translator tool with the required parameters.
Initializes the array of tool parameters with the values as specified for the required parameters and with the default values for the other parameters.
- Parameters:
source
- the item whose metadata will be converted, or a stand-alone XML file that will be converted.translator
- an XML file that defines the conversion that will be performed. the translator files provided with ArcGIS Desktop can be found in the \Metadata\Translator folder. The following conversions are supported: a translator file must be specified. This tool does not have a default value for this parameter.
getSource
public Object getSource()
- Returns the Source Metadata parameter of this tool .
This parameter is the item whose metadata will be converted, or a stand-alone XML file that will be converted.
This is a required parameter.
- Returns:
- the Source Metadata
setSource
public void setSource(Object source)
- Sets the Source Metadata parameter of this tool .
This parameter is the item whose metadata will be converted, or a stand-alone XML file that will be converted.
This is a required parameter.
- Parameters:
source
- the item whose metadata will be converted, or a stand-alone XML file that will be converted.
getTranslator
public Object getTranslator()
- Returns the Translation parameter of this tool .
This parameter is an XML file that defines the conversion that will be performed. the translator files provided with ArcGIS Desktop can be found in the \Metadata\Translator folder. The following conversions are supported: a translator file must be specified. This tool does not have a default value for this parameter.
This is a required parameter.
- Returns:
- the Translation
setTranslator
public void setTranslator(Object translator)
- Sets the Translation parameter of this tool .
This parameter is an XML file that defines the conversion that will be performed. the translator files provided with ArcGIS Desktop can be found in the \Metadata\Translator folder. The following conversions are supported: a translator file must be specified. This tool does not have a default value for this parameter.
This is a required parameter.
- Parameters:
translator
- an XML file that defines the conversion that will be performed. the translator files provided with ArcGIS Desktop can be found in the \Metadata\Translator folder. The following conversions are supported: a translator file must be specified. This tool does not have a default value for this parameter.
getOutput
public Object getOutput()
- Returns the Output File parameter of this tool .
This parameter is a stand-alone XML file that will be created containing the converted metadata. to check for problems in the metadata using the ESRI Metadata Translator's translation engine and not produce a output XML file, provide # instead of a file name.
This is an optional parameter.
- Returns:
- the Output File
setOutput
public void setOutput(Object output)
- Sets the Output File parameter of this tool .
This parameter is a stand-alone XML file that will be created containing the converted metadata. to check for problems in the metadata using the ESRI Metadata Translator's translation engine and not produce a output XML file, provide # instead of a file name.
This is an optional parameter.
- Parameters:
output
- a stand-alone XML file that will be created containing the converted metadata. to check for problems in the metadata using the ESRI Metadata Translator's translation engine and not produce a output XML file, provide # instead of a file name.
getLogfile
public Object getLogfile()
- Returns the Log File parameter of this tool .
This parameter is a text file that will be created listing the warnings and errors that occurred during the conversion process. to export metadata without producing a log file, provide # instead of a file name.
This is an optional parameter.
- Returns:
- the Log File
setLogfile
public void setLogfile(Object logfile)
- Sets the Log File parameter of this tool .
This parameter is a text file that will be created listing the warnings and errors that occurred during the conversion process. to export metadata without producing a log file, provide # instead of a file name.
This is an optional parameter.
- Parameters:
logfile
- a text file that will be created listing the warnings and errors that occurred during the conversion process. to export metadata without producing a log file, provide # instead of a file name.
getToolName
public String getToolName()
- Returns the name of this tool.
- Returns:
- the tool name
getToolboxName
public String getToolboxName()
- Returns the name of the tool box containing this tool.
- Returns:
- the tool box name
getToolboxAlias
public String getToolboxAlias()
- Returns the alias of the tool box containing this tool.
- Returns:
- the tool box alias