Class EML201DocumentCorrector

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

public class EML201DocumentCorrector extends 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
    Description
    Default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(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 Details

    • EML201DocumentCorrector

      public EML201DocumentCorrector()
      Default constructor
  • Method Details

    • 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(String[] args) throws Exception
      Runs the job to correct eml201 documents - deleting extral nodes in
      Parameters:
      argus -
      Throws:
      Exception