Project

General

Profile

« Previous | Next » 

Revision 3859

Added by Jing Tao almost 16 years ago

Add to cvs headd. Add code to correct invalidated eml 201 doucments.

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
140 140
    public static final String XMLFORMAT = "xml";
141 141
    private static final String CONFIG_DIR = "WEB-INF";
142 142
    private static final String CONFIG_NAME = "metacat.properties";
143
    private static final String FALSE = "false";
144
    private static final String TRUE  = "true";
143 145
    
144 146
    /**
145 147
     * Initialize the servlet by creating appropriate database connections
......
180 182
            //initialize DBConnection pool
181 183
            DBConnectionPool connPool = DBConnectionPool.getInstance();
182 184
            
185
            //check if eml201 document were corrected or not.
186
            // if not, correct eml201 documents.
187
            //Before Metacat 1.8.1, metacat uses tag RELEASE_EML_2_0_1_UPDATE_6 as eml 
188
            //schema, which accidentily points to wrong version of eml-resource.xsd.
189
            String correctedEML201Doc = MetaCatUtil.getOption("eml201_document_corrected");
190
            if (correctedEML201Doc != null && correctedEML201Doc.equals(FALSE))
191
            {
192
            	logMetacat.info("===Start to correct eml201 documents");
193
            	EML201DocumentCorrector correct = new EML201DocumentCorrector();
194
            	boolean success = correct.run();
195
            	if (success)
196
            	{
197
            	     MetaCatUtil.setOption("eml201_document_corrected", TRUE);
198
            	}
199
            	logMetacat.info("====Finish to correct eml201 documents");
200
            }
201
            
202
            
183 203
            // Index the paths specified in the metacat.properties
184 204
            checkIndexPaths();
185 205
            

Also available in: Unified diff