edu.ucsb.nceas.metacat

## Class EML201DocumentCorrector

- java.lang.Object
- - edu.ucsb.nceas.metacat.EML201DocumentCorrector

-     public class EML201DocumentCorrector
      extends java.lang.Object

  Before Metacat 1.8.1 release, Metacat uses the eml201 schema with the tag RELEASE_EML_2_0_1_UPDATE_5. Unfortunately, this tag points at wrong version of eml-resource.xsd. In this schema, the element "references" has an attribute named "system" and the attribute has a default value "document". Metacat will add the attribute system="document" to "references" element even the orginal eml didn't have it (this is another bug and see bug 1601), so this causes metacat generated some invalid eml201 documents. This class provides a path to fix the existed invalid eml201 documents. It will remove the attribute system="document" of the element "references" in xml_nodes and xml_index tables.
  Author:
    tao

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EML201DocumentCorrector()` Default constructor

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `main(java.lang.String[] args)` Runs the job to correct eml201 documents - deleting extral nodes in
    `boolean` | `run()` It will remove the records - attribute system="document" of element "refrence" in both xml_nodes and xml_index table.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EML201DocumentCorrector

          public EML201DocumentCorrector()

      Default constructor

  - ### Method Detail

    - #### run

          public boolean run()

      It will remove the records - attribute system="document" of element "refrence" in both xml_nodes and xml_index table. Since xml_index has a foreign key (nodeid)which references nodeid in xml_nodes table, we should delete records in xml_index table first.

    - #### main

          public static void main(java.lang.String[] args)
                           throws java.lang.Exception

      Runs the job to correct eml201 documents - deleting extral nodes in
      Parameters:
        `argus` -
      Throws:
        `java.lang.Exception`

Copyright © 2023 Regents of the University of California. All Rights Reserved.