Project

General

Profile

1
package edu.ucsb.nceas.metacat.admin.upgrade;
2
/**
3
 *  '$RCSfile$'
4
 *    Purpose: A Class for upgrading the database to version 1.5
5
 *  Copyright: 2000 Regents of the University of California and the
6
 *             National Center for Ecological Analysis and Synthesis
7
 *    Authors: Saurabh Garg
8
 *
9
 *   '$Author: leinfelder $'
10
 *     '$Date: 2011-05-24 16:18:55 -0700 (Tue, 24 May 2011) $'
11
 * '$Revision: 6097 $'
12
 *
13
 * This program is free software; you can redistribute it and/or modify
14
 * it under the terms of the GNU General Public License as published by
15
 * the Free Software Foundation; either version 2 of the License, or
16
 * (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
 */
27

    
28

    
29
import edu.ucsb.nceas.metacat.admin.AdminException;
30
import edu.ucsb.nceas.metacat.properties.PropertyService;
31
import edu.ucsb.nceas.utilities.SortedProperties;
32

    
33
public class Upgrade1_10_0 implements UpgradeUtilityInterface {
34

    
35
    public boolean upgrade() throws AdminException {
36
        boolean success = true;
37
        
38
        // node data datetime
39
        UpgradeNodeDataDatetime dateTimeUpgrade = new UpgradeNodeDataDatetime();
40
        success = dateTimeUpgrade.upgrade();
41
        
42
        // dataone system metadata generation
43
        
44
        
45
    	return success;
46
    }
47
    
48
    public static void main(String [] ags){
49

    
50
        try {
51
        	// set up the properties based on the test/deployed configuration of the workspace
52
        	SortedProperties testProperties = 
53
				new SortedProperties("test/test.properties");
54
			testProperties.load();
55
			String metacatContextDir = testProperties.getProperty("metacat.contextDir");
56
			PropertyService.getInstance(metacatContextDir + "/WEB-INF");
57
			// now run it
58
            Upgrade1_10_0 upgrader = new Upgrade1_10_0();
59
	        upgrader.upgrade();
60
	        
61
        } catch (Exception ex) {
62
            System.out.println("Exception:" + ex.getMessage());
63
            ex.printStackTrace();
64
        }
65
    }
66
}
(2-2/5)