Project

General

Profile

« Previous | Next » 

Revision 7169

expose serverLocation parameter to run GenerateSystemMetadata for different replication parters as needed.
https://redmine.dataone.org/issues/2740

View differences:

src/edu/ucsb/nceas/metacat/admin/upgrade/dataone/GenerateSystemMetadata.java
48 48

  
49 49
	private static Log log = LogFactory.getLog(GenerateSystemMetadata.class);
50 50
	
51
	private int serverLocation = 1;
52
	
51 53
    public boolean upgrade() throws AdminException {
52 54
    	
53 55
    	// do this in a thread too so that we don't have to hang the UI (web)
......
96 98
        // do not include ORE or data, but can generate SystemMetadata for ALL records
97 99
        final boolean includeOre = false;
98 100
        final boolean downloadData = false;
99
        int serverLocation = 1;
100 101
        
101 102
        try {
102 103
        	
......
210 211
    	return success;
211 212
    }
212 213
    
213
    public static void main(String [] ags){
214
    public int getServerLocation() {
215
		return serverLocation;
216
	}
214 217

  
218
	public void setServerLocation(int serverLocation) {
219
		this.serverLocation = serverLocation;
220
	}
221

  
222
	public static void main(String [] args){
223

  
215 224
        try {
216 225
        	// set up the properties based on the test/deployed configuration of the workspace
217 226
        	SortedProperties testProperties = 
......
219 228
			testProperties.load();
220 229
			String metacatContextDir = testProperties.getProperty("metacat.contextDir");
221 230
			PropertyService.getInstance(metacatContextDir + "/WEB-INF");
222
			// now run it
231
			
232
			// make an upgrader instance
223 233
            GenerateSystemMetadata upgrader = new GenerateSystemMetadata();
234
            
235
            // set any command line params, like the home server to run this for
236
            if (args.length > 0) {
237
            	String serverLocation = args[0];
238
            	upgrader.setServerLocation(Integer.parseInt(serverLocation));
239
            }
240
            
241
            // now run it
224 242
	        upgrader.upgrade();
225 243
	        
226 244
        } catch (Exception ex) {

Also available in: Unified diff