mdTranslator

Architecture

Response Hash

The response hash object is constructed by mdTranslator and available to reader and writer during its run. This is the object returned to the user at the completion of the run. The reader and writer fill in object as they process the metadata content.

responseObj =  {
    readerFormat: nil,
    readerStructurePass: nil,
    readerStructureMessages: [],
    readerRequested: nil,
    readerVersionRequested: nil,
    readerVersionUsed: nil,
    readerValidationLevel: nil,
    readerValidationPass: nil,
    readerValidationMessages: [],
    readerExecutionPass: nil,
    readerExecutionMessages: [],
    writerName: nil,
    writerVersion: nil,
    writerFormat: nil,
    writerPass: nil,
    writerMessages: [],
    writerOutput: nil,
    writerShowTags: false,
    writerMissingIdCount: '_000',
    translatorVersion: nil
}

readerFormat: string - the anticipated format of the input file, parsing by the reader will proceed assuming this format. Set by reader.

readerStructurePass: boolean - 'true' if input file structure is determined to be valid. Set by the reader.

readerStructureMessages: string[] - an array of quoted string messages. If readerStructurePass is 'false', set one or more messages to assist the user in fixing file structure problems. Set by reader.

readerRequested: string - name of the reader requested by the user. Set from the translate parameter list.

readerVersionRequested: string version of the reader requested by the input file, set by reader.

readerVersionUsed: string - version of the reader the reader method decided to use in processing the input file. Set by reader. Default 'normal'.

readerValidationLevel: string - validation level requested to be applied to the input file. Set from the parameter list.

readerValidationPass: string - 'true' if the input file passes the level of validation requested. Set by reader.

readerValidationMessages: string[] - an array of quoted string messages. If readerValidationPass is 'false', set one or more messages to assist user fixing file schema validation problems. Set by reader.

readerExecutionPass: boolean - 'true' if the reader completes the import of the input file into the internal object without errors. Set by the reader.

readerExecutionMessages: string[] - an array of quoted string messages. If readerExecutionPass is 'false', set one or more messages to assist user in fixing file data problems. Set by reader.

writerName: string - name of the writer requested by the user, set from the translate parameter list. if nil, no write was requested and only validation of the input file will be performed.

writerVersion: string - current version of the writer requested. Set by writer.

writerFormat: string - format of the output from the writer. Set by writer.

writerPass: boolean - 'true' if the writer completes the creation of the output file without errors. Set by writer.

writerMessages: string[] - an array of quoted string messages. If writerPass is 'false', set one or more messages to assist user in fixing file data problems. Set by writer.

writerOutput: string - output file returned from the writer. Set by writer.

writerShowTags: Boolean If 'true' tags are indluced in the XML output for empty elements.

writerMissingIdCount: string counter for creating unique elements IDs for ISO elements that require an ID but one was not provide in the input metadata file.

translatorVersion: string current version of the mdTranslator.