Project

General

Profile

« Previous | Next » 

Revision cbd8fc9c

Added by Andreas Müller almost 12 years ago

refactor Erms import to include export to PESI

View differences:

cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/ErmsActivator.java
54 54
	//ignore null
55 55
	static final boolean ignoreNull = true;
56 56
	
57
	static final boolean includeExport = true;
58
	
57 59
// ***************** ALL ************************************************//
58 60
	
59 61
	//references
......
81 83
//	
82 84
	
83 85
	
84
	/**
85
	 * @param args
86
	 */
87
	public static void main(String[] args) {
86
	private void doImport(Source source, ICdmDataSource destination, DbSchemaValidation hbm2dll){
88 87
		System.out.println("Start import from ("+ ermsSource.getDatabase() + ") ...");
89 88
		
90 89
		//make ERMS Source
91
		Source source = ermsSource;
92
		ICdmDataSource destination = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination;
93 90
		
94 91
		ErmsImportConfigurator config = ErmsImportConfigurator.NewInstance(source,  destination);
95 92
		
......
124 121
		}
125 122
		System.out.println("End import from ("+ source.getDatabase() + ")...");
126 123
	}
124
	
125
	/**
126
	 * @param args
127
	 */
128
	public static void main(String[] args) {
129
		ICdmDataSource cdmDB = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination;
130
		ErmsActivator ermsImport = new ErmsActivator();
131
		ermsImport.doImport(ermsSource, cdmDB, hbm2dll);
132
		
133
		if (includeExport){
134
			PesiExportActivatorERMS ermsExport = new PesiExportActivatorERMS();
135
			ermsExport.doExport(cdmDB);
136
		}
137
	}
127 138

  
128 139
}

Also available in: Unified diff