Skip to content

MetadataCollectionToMetadata tool Convert Testkit Metadata files from v2.1 to v3

Sunil Bhaskarla edited this page Jan 9, 2023 · 4 revisions

Use the gov.nist.toolkit.xdstools2.server.MetadataCollectionToMetadata Java class main method tool to upgrade v2.1 metadata files to v3.

The MetadataCollectionToMetadata tool is run from a IJ IDE run configuration with the xdstools2 module as its classpath.

A metadata file used in the TestPlan XML file has these namespaces:

Metadata v2.1 XML namespaces:

<rs:SubmitObjectsRequest xmlns:rs="urn:oasis:names:tc:ebxml-regrep:registry:xsd:2.1">

<rim:LeafRegistryObjectList xmlns:rim="urn:oasis:names:tc:ebxml-regrep:rim:xsd:2.1">

Changing the namespace to v3 is not sufficient, the structures need to be converted. Using this tool, this process is automated except the XML comments from the source file are not preserved. When XML comments are desired to be present in the converted file, use the manual approach. The manual approach involves running this tool against a single metadata file instead of using the bulk parameter input mode. The output of the converted file is kept separately, use this file to compare the differences, and copy the XML comments. Use the ErrorScan tool to identify metadata files with schema errors.

Program arguments manual method

Input metadata file

Example

\myprojects\iheos-toolkit2\xdstools2\src\main\webapp\toolkitx\testkit\tests\16103b\submit\single_doc.xml

Output metadata file

Example

c:\temp\out.txt

Input metadata type

See gov.nist.toolkit.commondatatypes.client.MetadataTypes

Example 1

Output metadata type

See gov.nist.toolkit.commondatatypes.client.MetadataTypes

Example 5

Program arguments - bulk parameter input method

Each metadata is converted and the source file is replaced with the converted contents. The conversion only happens for a specific target case, when the schema validation output contains a specific string. See code for details.

Input file

temp\bulkParameters.txt

Input file Contents

A file containing multiple lines separated by a new line (\n) and each line containing a absolute metadata file path and its input MetadataType integer code, separated by a single space. The end of file may contain a new line.

Example

\myprojects\iheos-toolkit2\xdstools2\src\main\webapp\toolkitx\testkit\tests\16103b\submit\single_doc.xml 1 Where the argument is the absolute path to the metadata file and the input MetadataType integer code

Output is selected by the program and uses a v3 MetadataType code, change this code and other job specific behavior such as tagging the output file with a tracer comment before running the tool.

Clone this wiki locally