edu.ucsb.nceas.metacat
Class EML201DocumentCorrector

java.lang.Object
  extended by 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
EML201DocumentCorrector()
          Default constructor
 
Method Summary
static void main(java.lang.String[] argus)
          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[] argus)
                 throws java.lang.Exception
Runs the job to correct eml201 documents - deleting extral nodes in

Parameters:
argus -
Throws:
java.lang.Exception


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.