Project

General

Profile

« Previous | Next » 

Revision 1c7c3662

Added by Alex Theys about 11 years ago

AT: couldn't branch this folder so I am committing to trunk

View differences:

.gitattributes
1 1
* text=auto !eol
2
UseImport/pom.xml -text
3
UseImport/src/main/java/eu/etaxonomy/cdm/UseImport.java -text
4
UseImport/src/main/resources/Matched_UseSummary_referenceIdTaxEd_TaxonName.xls -text
5
UseImport/src/main/resources/UseRecordTerms_UseSummaryId.xls -text
6
UseImport/src/test/java/eu/etaxonomy/cdm/AppTest.java -text
7
UseImport/target/classes/eu/etaxonomy/cdm/UseImport.class -text
8
UseImport/target/classes/toLoad.xlsx -text
2 9
XperCdmIntegration/pom.xml -text
3 10
XperCdmIntegration/src/main/java/eu/etaxonomy/cdm/io/xper/BaseCdm.java -text
4 11
XperCdmIntegration/src/main/java/eu/etaxonomy/cdm/io/xper/CdmXperAdapter.java -text
UseImport/pom.xml
1
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
	<parent>
4
		<artifactId>cdmlib-parent</artifactId>
5
		<groupId>eu.etaxonomy</groupId>
6
		<version>3.0.10-SNAPSHOT</version>
7
		<relativePath>../pom.xml</relativePath>
8
	</parent>
9
	<modelVersion>4.0.0</modelVersion>
10
	<groupId>eu.etaxonomy.cdm</groupId>
11
	<artifactId>UseImport</artifactId>
12
	<packaging>jar</packaging>
13
	<name>UseImport</name>
14
	<url>http://maven.apache.org</url>
15
	<dependencies>
16
		<dependency>
17
			<groupId>eu.etaxonomy</groupId>
18
			<artifactId>cdmlib-io</artifactId>
19
		</dependency>
20
		<dependency>
21
			<groupId>eu.etaxonomy</groupId>
22
			<artifactId>cdmlib-ext</artifactId>
23
		</dependency>
24
		<dependency>
25
			<groupId>eu.etaxonomy</groupId>
26
			<artifactId>cdmlib-persistence</artifactId>
27
		</dependency>
28
		<dependency>
29
			<groupId>eu.etaxonomy</groupId>
30
			<artifactId>cdmlib-model</artifactId>
31
		</dependency>
32
		<dependency>
33
			<groupId>eu.etaxonomy</groupId>
34
			<artifactId>cdmlib-persistence</artifactId>
35
		</dependency>
36
		<dependency>
37
			<groupId>eu.etaxonomy</groupId>
38
			<artifactId>cdmlib-services</artifactId>
39
		</dependency>
40
		<dependency>
41
			<groupId>org.apache.poi</groupId>
42
			<artifactId>poi</artifactId>
43
			<version>3.7</version>
44
		</dependency>
45
		<dependency>
46
			<groupId>junit</groupId>
47
			<artifactId>junit</artifactId>
48
			<version>3.8.1</version>
49
			<scope>test</scope>
50
		</dependency>
51
	</dependencies>
52
</project>
UseImport/src/main/java/eu/etaxonomy/cdm/UseImport.java
1
package eu.etaxonomy.cdm;
2

  
3
import java.io.FileInputStream;
4
import java.io.FileNotFoundException;
5
import java.io.IOException;
6
import java.io.InputStream;
7
import java.net.URI;
8
import java.net.URISyntaxException;
9
import java.util.ArrayList;
10
import java.util.HashSet;
11
import java.util.Iterator;
12
import java.util.List;
13
import java.util.Set;
14
import java.util.UUID;
15

  
16
import org.apache.log4j.Logger;
17
import org.apache.poi.hssf.usermodel.HSSFCell;
18
import org.apache.poi.hssf.usermodel.HSSFRow;
19
import org.apache.poi.hssf.usermodel.HSSFSheet;
20
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
21
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
22

  
23
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
24
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
25
import eu.etaxonomy.cdm.api.service.IDescriptionService;
26
import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
27
import eu.etaxonomy.cdm.api.service.IIdentifiableEntityService;
28
import eu.etaxonomy.cdm.api.service.IReferenceService;
29
import eu.etaxonomy.cdm.api.service.ITaxonService;
30
import eu.etaxonomy.cdm.api.service.ITermService;
31
import eu.etaxonomy.cdm.api.service.IVocabularyService;
32
import eu.etaxonomy.cdm.api.service.pager.Pager;
33
import eu.etaxonomy.cdm.common.AccountStore;
34
import eu.etaxonomy.cdm.database.CdmDataSource;
35
import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
36
import eu.etaxonomy.cdm.database.ICdmDataSource;
37
import eu.etaxonomy.cdm.model.agent.Team;
38
import eu.etaxonomy.cdm.model.common.CdmBase;
39
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
40
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
41
import eu.etaxonomy.cdm.model.common.Language;
42
import eu.etaxonomy.cdm.model.common.LanguageString;
43
import eu.etaxonomy.cdm.model.common.Marker;
44
import eu.etaxonomy.cdm.model.common.MarkerType;
45
import eu.etaxonomy.cdm.model.common.TermVocabulary;
46
import eu.etaxonomy.cdm.model.common.TimePeriod;
47
import eu.etaxonomy.cdm.model.description.CategoricalData;
48
import eu.etaxonomy.cdm.model.description.Feature;
49
import eu.etaxonomy.cdm.model.description.FeatureNode;
50
import eu.etaxonomy.cdm.model.description.FeatureTree;
51
import eu.etaxonomy.cdm.model.description.Modifier;
52
import eu.etaxonomy.cdm.model.description.State;
53
import eu.etaxonomy.cdm.model.description.StateData;
54
import eu.etaxonomy.cdm.model.description.TaxonDescription;
55
import eu.etaxonomy.cdm.model.description.TextData;
56
import eu.etaxonomy.cdm.model.reference.IReference;
57
import eu.etaxonomy.cdm.model.reference.Reference;
58
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
59
import eu.etaxonomy.cdm.model.taxon.Synonym;
60
import eu.etaxonomy.cdm.model.taxon.Taxon;
61
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
62
import eu.etaxonomy.cdm.persistence.dao.common.IDefinedTermDao;
63

  
64
public class UseImport {
65
	public static final Logger logger = Logger.getLogger(UseImport.class);
66

  
67
	public void UseImport() {
68

  
69
	}
70

  
71
	public static ICdmDataSource dataSource() {
72
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
73
		String cdmServer = "localhost";
74
		String cdmDB = "palm_use_cdm_db";
75
		String cdmUserName = "root";
76
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
77
	}
78

  
79
	private static ICdmDataSource makeDestination(DatabaseTypeEnum dbType,
80
			String cdmServer, String cdmDB, int port, String cdmUserName,
81
			String pwd) {
82
		// establish connection
83
		pwd = AccountStore.readOrStorePassword(cdmServer, cdmDB, cdmUserName,
84
				pwd);
85
		ICdmDataSource destination;
86
		if (dbType.equals(DatabaseTypeEnum.MySQL)) {
87
			destination = CdmDataSource.NewMySqlInstance(cdmServer, cdmDB,
88
					port, cdmUserName, pwd, null);
89
		} else if (dbType.equals(DatabaseTypeEnum.PostgreSQL)) {
90
			destination = CdmDataSource.NewPostgreSQLInstance(cdmServer, cdmDB,
91
					port, cdmUserName, pwd, null);
92
		} else {
93
			// TODO others
94
			throw new RuntimeException("Unsupported DatabaseType");
95
		}
96
		return destination;
97
	}
98

  
99
	public boolean importFromExcelSS(String xlsPath) {
100
		boolean success = true;
101
		
102
		CdmApplicationController applicationController = CdmApplicationController.NewInstance(dataSource());
103
		ConversationHolder conversation = applicationController.NewConversation();
104
		conversation.startTransaction();
105
		
106
		ITaxonService service = applicationController.getTaxonService();
107
		ITermService termService = applicationController.getTermService();
108
		IDescriptionService descService = applicationController.getDescriptionService();
109
		IReferenceService referenceService = applicationController.getReferenceService();
110
		InputStream inputStream = null;
111
		
112
		try {
113
			inputStream = new FileInputStream(xlsPath);
114

  
115
		} catch (FileNotFoundException e) {
116
			success = false;
117
			System.out.println("File not found in the specified path.");
118
			e.printStackTrace();
119
		}
120

  
121
		POIFSFileSystem fileSystem = null;
122
		
123
		try {
124
			fileSystem = new POIFSFileSystem(inputStream);
125

  
126
			HSSFWorkbook workBook = new HSSFWorkbook(fileSystem);
127
			HSSFSheet sheet = workBook.getSheetAt(0);
128
			Iterator rows = sheet.rowIterator();
129
			// Iterator rows = sheet.rowIterator();
130
			ArrayList<ArrayList<String>> lstUpdates = new ArrayList<ArrayList<String>>();
131
			Set<Integer> lstTaxonIDs = new HashSet<Integer>();
132
			//Set<Integer> lstTaxonIDs;
133
		
134

  
135
			while (rows.hasNext()) {
136

  
137
				HSSFRow row = (HSSFRow) rows.next();
138
				System.out.println("Row No.: " + row.getRowNum());
139
				Iterator cells = row.cellIterator();
140
				ArrayList<String> lstTaxon = new ArrayList<String>();
141
				while (cells.hasNext()) {
142
					HSSFCell cell = (HSSFCell) cells.next();
143
				
144
					int intCellType = cell.getCellType();
145
					switch (intCellType) {
146
						case 0:
147
							int cellValue = (int) cell.getNumericCellValue(); 
148
							lstTaxon.add(Integer.toString(cellValue));
149
							break;
150
						case 1:
151
							lstTaxon.add(cell.getStringCellValue());
152
							break;
153
					}
154
				}
155
				lstUpdates.add(lstTaxon);
156
				lstTaxonIDs.add(Integer.parseInt(lstTaxon.get(0)));	
157
			}
158
			
159
			List<TaxonBase> taxa = service.findTaxaByID(lstTaxonIDs);
160
			for(TaxonBase idTaxa : taxa) {
161
				//System.out.println(idTaxa.getUuid().toString());
162
				System.out.println(idTaxa.getName());
163
			}
164
			
165
			
166
			MarkerType useMarkerType = (MarkerType) termService.find(UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));
167
			Marker useMarker = Marker.NewInstance(useMarkerType, true);
168
			for (ArrayList<String> lstUpdate : lstUpdates) {
169
				System.out.println("-----------------------------------------------: " + lstUpdate.get(1));
170
				String idTaxonToUpdate = lstUpdate.get(1);
171
				TaxonDescription newUseDescription = TaxonDescription.NewInstance();
172
				newUseDescription.addMarker(useMarker);
173
				newUseDescription.setTitleCache(lstUpdate.get(2));
174
				Reference citation = ReferenceFactory.newGeneric();
175
				Team authorTeam = Team.NewInstance();
176
				authorTeam.setTitleCache(lstUpdate.get(3));
177
				citation.setAuthorTeam(authorTeam);
178
				citation.setTitle(lstUpdate.get(4));
179
				
180
				//citation.
181
				TimePeriod year = TimePeriod.NewInstance(Integer.parseInt(lstUpdate.get(5)));
182
				citation.setDatePublished(year);
183
				citation.setTitleCache(lstUpdate.get(6));
184
				//citation.
185
				for(TaxonBase taxon : taxa) {
186
					String taxonUUID = taxon.getUuid().toString(); 
187
					//System.out.println(idTaxonToUpdate + "|" + taxonUUID);
188
					if(idTaxonToUpdate.equals(taxonUUID)) {
189
						logger.info("Processing Taxn " + taxon.getTitleCache() + " with UUID: " + taxon.getUuid());
190
						if(taxon.isInstanceOf(Synonym.class)) {
191
							Taxon bestCandidate = null;
192
							Synonym synonym = CdmBase.deproxy(taxon, Synonym.class);
193
							Set<Taxon> acceptetdCandidates = synonym.getAcceptedTaxa();
194
							if(!acceptetdCandidates.isEmpty()){
195
								bestCandidate = acceptetdCandidates.iterator().next();
196
								if(acceptetdCandidates.size() == 1){
197
									logger.info(acceptetdCandidates.size() + " Accepted taxa found for synonym " + taxon.getTitleCache() + ", using first one: " + bestCandidate.getTitleCache());
198
									Set<TaxonDescription> taxonDescriptions = bestCandidate.getDescriptions();
199
									if(!taxonDescriptions.isEmpty()) {
200
										TaxonDescription firstDescription = taxonDescriptions.iterator().next();
201
										//newUseSummary.addSource(null, null, citation, null);
202
										//firstDescription.addElement(newUseSummary);
203
									}
204
									else {
205
										logger.warn("No description container for: " + bestCandidate.getName());
206
										
207
									}
208
								} else {
209
									logger.info("using accepted Taxon " +  bestCandidate.getTitleCache() + "for synonym " + taxon.getTitleCache());
210
									//List<DescriptionElementBase> descriptionElements = descService.getDescriptionElementsForTaxon((Taxon) bestCandidate, null, null, null, null, null);
211
									Set<TaxonDescription> taxonDescriptions = bestCandidate.getDescriptions();
212
									if(!taxonDescriptions.isEmpty()) {
213
										TaxonDescription firstDescription = taxonDescriptions.iterator().next();
214
										//newUseSummary.addSource(null, null, citation, null);
215
										//firstDescription.addElement(newUseSummary);
216
									}
217
									else {
218
										logger.warn("No description container for: " + bestCandidate.getName());
219
										
220
									}
221
								}
222
							}
223
						}
224
						else {
225
							Taxon taxonAccepted = (Taxon) taxon;
226
							/*Set<TaxonDescription> taxonDescriptions = taxonAccepted.getDescriptions();
227
							if(!taxonDescriptions.isEmpty()) {
228
								TaxonDescription firstDescription = taxonDescriptions.iterator().next();
229
								//newUseSummary.addSource(null, null, citation, null);
230
								//firstDescription.addElement(newUseSummary);
231
							}
232
							else {
233
								logger.warn("No description container for: " + taxonAccepted.getName());
234
							}*/
235
							taxonAccepted.addDescription(newUseDescription);
236
							service.saveOrUpdate(taxonAccepted);
237
							
238
						}
239
					}
240
				}
241
				
242
			}
243
			conversation.commit(false);
244
			
245
		} catch (IOException e) {
246
			success = false;
247
			e.printStackTrace();
248
		}
249

  
250
		return success;
251

  
252
	}
253
	
254
	private boolean loadUses() {
255
		boolean success = true;
256
		//String xslUseSummaryPathString = "C://workspace//Matched_UseSummary_referenceIdTaxEd_TaxonName.xls";
257
		String xslUseSummaryPathString = "C://workspace//testUseSummaries.xls";
258
		
259
		
260
		//String xslUseSummaryPathString = "//Users//alextheys//Projects//CDM_Trunk//Palm_Use_Data_Extension//UseImport//Matched_UseSummary_referenceIdTaxEd_TaxonName.xls";
261
		
262
		//String xslUseRecordPathString = "C://workspace//UseRecordTerms_UseSummaryId.xls";
263
		String xslUseRecordPathString = "C://workspace//testUseRecords.xls";
264
		
265
		//String xslUseRecordPathString = "C://workspace//test_useRecord.xls";
266
		//String xslUseRecordPathString = "//Users//alextheys//Projects//CDM_Trunk//Palm_Use_Data_Extension//UseImport//UseRecordTerms_UseSummaryId.xls";
267
		
268
		InputStream inputStream = null;
269
		
270
		
271
		CdmApplicationController applicationController = CdmApplicationController.NewInstance(dataSource());
272
		ConversationHolder conversation = applicationController.NewConversation();
273
		conversation.startTransaction();
274
		
275
		ITaxonService taxonService = applicationController.getTaxonService();
276
		ITermService termService = applicationController.getTermService();
277
		IDescriptionService descService = applicationController.getDescriptionService();
278
		IReferenceService referenceService = applicationController.getReferenceService();
279
			
280
		
281
		ArrayList<ArrayList<String>> lstUseSummaries = loadSpreadsheet(xslUseSummaryPathString);
282
		ArrayList<ArrayList<String>> lstUseRecords = loadSpreadsheet(xslUseRecordPathString);
283
		
284
		MarkerType useMarkerType = (MarkerType) termService.find(UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));
285
		Feature featureUseRecord = (Feature) termService.find(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
286
		Feature featureUseSummary = (Feature) termService.find(UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279"));
287
		Pager<DefinedTermBase>  notAvailModPager = (Pager<DefinedTermBase> ) termService.findByTitle(Modifier.class, "N/A", null, null, null, null, null, null);
288
		Pager<DefinedTermBase>  notAvailStatePager = (Pager<DefinedTermBase> ) termService.findByTitle(State.class, "N/A", null, null, null, null, null, null);
289
		Modifier notAvailMod = (Modifier) notAvailModPager.getRecords().get(0);
290
		State notAvailState = (State) notAvailStatePager.getRecords().get(0);
291
		
292
		int i = 0;
293
		int j = 0;
294
		try {
295
			for (ArrayList<String> lstUseSummary : lstUseSummaries) {
296
				i++;
297
				String idTaxonToUpdate = lstUseSummary.get(3);
298
				TaxonBase taxon = taxonService.find(UUID.fromString(idTaxonToUpdate));
299
				if (taxon != null) {
300
					TaxonDescription newUseDescription = TaxonDescription.NewInstance();
301
					Marker useMarker = Marker.NewInstance(useMarkerType, true);
302
					newUseDescription.addMarker(useMarker);
303
					Reference useReference = null;
304
					Pager<Reference> reference = referenceService.findByTitle(Reference.class, lstUseSummary.get(5), null, null, null, null, null, null);
305
					if(reference.getCount() == 0) {
306
						System.out.println("Reference title: " + lstUseSummary.get(5) + " not found.");
307
					} else if(reference.getCount() > 0 ) {
308
						useReference = reference.getRecords().get(0);
309
					}
310
					IdentifiableSource source =IdentifiableSource.NewInstance(useReference, null);
311
					source.setOriginalNameString(taxon.getName().toString());
312
					newUseDescription.addSource(source);
313
					TextData useSummary = TextData.NewInstance(featureUseSummary);
314
					LanguageString languageString = LanguageString.NewInstance(lstUseSummary.get(1), Language.ENGLISH());
315
					useSummary.putText(languageString);
316
					descService.saveDescriptionElement(useSummary);
317
					newUseDescription.addElement(useSummary);
318
					for (ArrayList<String> lstUseRecord : lstUseRecords) {
319
						j++;
320
						//System.out.println("Processing UseSummary#: " + i + " ID:" + lstUseSummary.get(0) + "UseRecord: " + lstUseRecord.get(1));
321
						if(lstUseSummary.get(0).equals(lstUseRecord.get(0))) {
322
							CategoricalData useRecord = CategoricalData.NewInstance();
323
							useRecord.setFeature(featureUseRecord);
324
							String modifyingText = "";
325
							if(lstUseRecord.get(3) != null && lstUseRecord.get(3).length() > 0) {
326
								Pager<DefinedTermBase> useCategoryPager = termService.findByTitle(State.class, lstUseRecord.get(3), null, null, null, null, null, null);
327
								State useCategory = null;
328
								if(useCategoryPager.getCount() > 0) {
329
									useCategory = (State) useCategoryPager.getRecords().get(0);
330
								} else {
331
									useCategory = notAvailState;
332
								}
333
								StateData stateCatData = StateData.NewInstance(useCategory);
334
								stateCatData.setState(useCategory);
335
								stateCatData.putModifyingText(Language.ENGLISH(), "Use Category");
336
								modifyingText += useCategory.toString() + ";";
337
								useRecord.addState(stateCatData);
338
								
339
								 
340
								//useRecord.addState(stateData);
341
							} else {
342
								State useCategory = notAvailState;
343
								StateData stateCatData = StateData.NewInstance(useCategory);
344
								stateCatData.setState(useCategory);
345
								stateCatData.putModifyingText(Language.ENGLISH(), "Use Category");
346
								modifyingText += useCategory.toString() + ";";
347
								useRecord.addState(stateCatData);
348
								
349
							}
350
							
351
							if(lstUseRecord.get(4) != null && lstUseRecord.get(4).length() > 0) {
352
								Pager<DefinedTermBase> useSubCategoryPager = termService.findByTitle(State.class, lstUseRecord.get(4), null, null, null, null, null, null);
353
								State useSubCategory = null;
354
								if(useSubCategoryPager.getCount() > 0) {
355
									useSubCategory = (State) useSubCategoryPager.getRecords().get(0);
356
								
357
								} else {
358
									useSubCategory = notAvailState;
359
								}
360
								StateData stateSubCatData = StateData.NewInstance(useSubCategory);
361
								stateSubCatData.setState(useSubCategory);
362
								stateSubCatData.putModifyingText(Language.ENGLISH(), "Use SubCategory");
363
								modifyingText += useSubCategory.toString() + ";";
364
								useRecord.addState(stateSubCatData);
365
								
366
							}
367
							else {
368
								State useSubCategory = notAvailState;
369
								StateData stateSubCatData = StateData.NewInstance(useSubCategory);
370
								stateSubCatData.setState(useSubCategory);
371
								stateSubCatData.putModifyingText(Language.ENGLISH(), "Use SubCategory");
372
								modifyingText += useSubCategory.toString() + ";";
373
								useRecord.addState(stateSubCatData);
374
								
375
							}
376
							if(lstUseRecord.get(5) != null && lstUseRecord.get(5).length() > 0) {
377
								Pager<DefinedTermBase> countryPager = termService.findByTitle(Modifier.class, lstUseRecord.get(5), null, null, null, null, null, null);
378
								Modifier country = null;
379
								if(countryPager.getCount() > 0) {
380
									country = (Modifier) countryPager.getRecords().get(0);
381
								} else {
382
									country = notAvailMod;
383
								}
384
								modifyingText += country.toString() + ";";
385
								useRecord.addModifier(country);
386
							} else {
387
								Modifier country = notAvailMod;
388
								modifyingText += country.toString() + ";";
389
								useRecord.addModifier(country);
390
							}
391
							
392
							if(lstUseRecord.get(6) != null && lstUseRecord.get(6).length() > 0) {
393
								Pager<DefinedTermBase> plantPartPager = termService.findByTitle(Modifier.class, lstUseRecord.get(6), null, null, null, null, null, null);
394
								Modifier plantPart = null;
395
								if(plantPartPager.getCount() > 0) {
396
									plantPart = (Modifier) plantPartPager.getRecords().get(0);
397
								} else {
398
									plantPart = notAvailMod;
399
								}
400
								modifyingText += plantPart.toString() + ";";
401
								useRecord.addModifier(plantPart);
402
							}else {
403
								Modifier plantPart = notAvailMod;
404
								modifyingText += plantPart.toString() + ";";
405
								useRecord.addModifier(plantPart);
406
							}
407
							if(lstUseRecord.get(7) != null && lstUseRecord.get(7).length() > 0) {
408
								Pager<DefinedTermBase> humanGroupPager = termService.findByTitle(Modifier.class, lstUseRecord.get(7), null, null, null, null, null, null);
409
								Modifier humanGroup = null;
410
								if(humanGroupPager.getCount() > 0) {
411
									humanGroup = (Modifier) humanGroupPager.getRecords().get(0);
412
								} else {
413
									humanGroup = notAvailMod;
414
								}
415
								modifyingText += humanGroup.toString() + ";";
416
								useRecord.addModifier(humanGroup);
417
							} else {
418
								Modifier humanGroup = notAvailMod;
419
								modifyingText += humanGroup.toString() + ";";
420
								useRecord.addModifier(humanGroup);
421
							}
422
							if(lstUseRecord.get(8) != null && lstUseRecord.get(8).length() > 0) {
423
								Pager<DefinedTermBase> ethnicGroupPager = termService.findByTitle(Modifier.class, lstUseRecord.get(8), null, null, null, null, null, null);
424
								Modifier ethnicGroup = null;
425
								if(ethnicGroupPager.getCount() > 0) {
426
									ethnicGroup = (Modifier) ethnicGroupPager.getRecords().get(0);
427
									modifyingText += ethnicGroup.toString() + ";";
428
								} else {
429
									ethnicGroup = notAvailMod;
430
								}
431
								useRecord.addModifier(ethnicGroup);
432
							}
433
							else {
434
								Modifier ethnicGroup = notAvailMod;
435
								modifyingText += ethnicGroup.toString() + ";";
436
								useRecord.addModifier(ethnicGroup);
437
							}
438
							useRecord.putModifyingText(Language.ENGLISH(), modifyingText);
439
							descService.saveDescriptionElement(useRecord);
440
							newUseDescription.addElement(useRecord);
441
						}
442
					}
443
					
444
					
445
					
446
					if (taxon.isInstanceOf(Synonym.class)){
447
						Taxon bestCandidate = null;
448
						Synonym synonym = CdmBase.deproxy(taxon, Synonym.class);
449
						Set<Taxon> acceptetdCandidates = synonym.getAcceptedTaxa();
450
						if(!acceptetdCandidates.isEmpty()){
451
							bestCandidate = acceptetdCandidates.iterator().next();
452
							if(acceptetdCandidates.size() == 1){
453
								logger.info(acceptetdCandidates.size() + " Accepted taxa found for synonym " + taxon.getTitleCache() + ", using first one: " + bestCandidate.getTitleCache());
454
								bestCandidate.addDescription(newUseDescription);
455
								taxonService.saveOrUpdate(bestCandidate);
456
								conversation.commit();
457
							}
458
							else {
459
								logger.info("using accepted Taxon " +  bestCandidate.getTitleCache() + "for synonym " + taxon.getTitleCache());
460
								bestCandidate.addDescription(newUseDescription);
461
								taxonService.saveOrUpdate(bestCandidate);
462
								conversation.commit();
463
							}
464
						}
465
					} else {
466
						Taxon taxonAccepted = (Taxon) taxon;
467
						taxonAccepted.addDescription(newUseDescription);
468
						taxonService.saveOrUpdate(taxonAccepted);
469
						conversation.commit();
470
					}
471
				}
472
				else {
473
					System.out.println("Processing UseSummary#: " + i + " ID:" + lstUseSummary.get(0));
474
				}
475
			}
476
			
477
			conversation.close();
478
			applicationController.close();
479
		
480
		} catch (Exception e) {
481
			success = false;
482
			e.printStackTrace();
483
		}
484
		return success;
485
		
486
	}
487
	
488
	//Completed and tested!
489
	private boolean loadTerms() {
490
		boolean success = true;
491
		
492
		String xslPathString = "C://workspace//terms.xls";
493
		//String xslPathString = "//Users//alextheys//Projects//CDM_Trunk//Palm_Use_Data_Extension//UseImport//terms.xls";
494
		
495
		CdmApplicationController applicationController = CdmApplicationController.NewInstance(dataSource());
496
		ConversationHolder conversation = applicationController.NewConversation();
497
		conversation.startTransaction();
498
		
499
		ITaxonService service = applicationController.getTaxonService();
500
		ITermService termService = applicationController.getTermService();
501
		IVocabularyService vocabularyService = applicationController.getVocabularyService();
502
		IReferenceService referenceService = applicationController.getReferenceService();	
503
		
504
		TermVocabulary<State> stateVocabulary =  (TermVocabulary<State>) vocabularyService.find(UUID.fromString("67430d7c-fd43-4e9d-af5e-d0dca3f74931")); 
505
		TermVocabulary<Modifier> countryVocabulary = (TermVocabulary<Modifier>) vocabularyService.find(UUID.fromString("116c51f1-e63a-46f7-a258-e1149a42868b"));  
506
		TermVocabulary<Modifier> plantPartVocabulary = (TermVocabulary<Modifier>) vocabularyService.find(UUID.fromString("369914fe-d54b-4063-99ce-abc81d30ad35"));  
507
		TermVocabulary<Modifier> humanGroupVocabulary =  (TermVocabulary<Modifier>) vocabularyService.find(UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc"));
508
		
509
		IDescriptionService descService = applicationController.getDescriptionService();
510
		InputStream inputStream = null;
511
		
512
		try {
513
			inputStream = new FileInputStream(xslPathString);
514

  
515
		} catch (FileNotFoundException e) {
516
			success = false;
517
			System.out.println("File not found in the specified path.");
518
			e.printStackTrace();
519
		}
520

  
521
		POIFSFileSystem fileSystem = null;
522
		
523
		try {
524
			fileSystem = new POIFSFileSystem(inputStream);
525

  
526
			HSSFWorkbook workBook = new HSSFWorkbook(fileSystem);
527
			HSSFSheet sheet = workBook.getSheetAt(0);
528
			Iterator rows = sheet.rowIterator();
529

  
530
			ArrayList<ArrayList<String>> lstUpdates = new ArrayList<ArrayList<String>>();
531
		
532
			while (rows.hasNext()) {
533

  
534
				HSSFRow row = (HSSFRow) rows.next();
535
				System.out.println("Row No.: " + row.getRowNum());
536
				Iterator cells = row.cellIterator();
537
				ArrayList<String> lstTerms = new ArrayList<String>();
538
				while (cells.hasNext()) {
539
					HSSFCell cell = (HSSFCell) cells.next();
540
				
541
					int intCellType = cell.getCellType();
542
					switch (intCellType) {
543
						case 0:
544
							int cellValue = (int) cell.getNumericCellValue(); 
545
							lstTerms.add(Integer.toString(cellValue));
546
							break;
547
						case 1:
548
							lstTerms.add(cell.getStringCellValue());
549
							break;
550
					}
551
				}
552
				lstUpdates.add(lstTerms);
553
				//lstTaxonIDs.add(Integer.parseInt(lstTaxon.get(0)));	
554
			}
555
			for (ArrayList<String> lstUpdate : lstUpdates) {
556
				int termType = Integer.parseInt(lstUpdate.get(0)); 
557
				switch (termType) {
558
				//Case 0 = UseCategory
559
				case 0:
560
					Pager<State> useCategoryPager = termService.findByRepresentationText(lstUpdate.get(1), State.class, null, null);
561
					State useCategory = null;
562
					State useSubCat = null;
563
					if (useCategoryPager.getCount()>0) {
564
						useCategory = useCategoryPager.getRecords().get(0);
565
					}
566
					if(useCategory == null) {
567
						useCategory = State.NewInstance(lstUpdate.get(1), lstUpdate.get(1), null);
568
					}
569
					//State useCategory = (State) termService.
570
					if(lstUpdate.size() > 2) {
571
						useSubCat = State.NewInstance(lstUpdate.get(2), lstUpdate.get(2), null);
572
						useCategory.addIncludes(useSubCat);
573
					}
574
					stateVocabulary.addTerm(useCategory);
575
					vocabularyService.saveOrUpdate(stateVocabulary);
576
					conversation.commit(true);
577
					break;
578
				
579
				//case 1: = HumanGroup
580
				case 1:
581
					Pager<Modifier> humanGroupPager = termService.findByRepresentationText(lstUpdate.get(1), Modifier.class, null, null);
582
					
583
					Modifier humanGroup = null;
584
					Modifier ethnicGroup = null;
585
					if(humanGroupPager.getCount()>0) {
586
						humanGroup = humanGroupPager.getRecords().get(0);
587
					}
588
					
589
					if(humanGroup == null) {
590
						humanGroup = Modifier.NewInstance(lstUpdate.get(1), lstUpdate.get(1), null);
591
					}
592
					
593
					if(lstUpdate.size() >2) {
594
						ethnicGroup = Modifier.NewInstance(lstUpdate.get(2), lstUpdate.get(2), null);
595
						humanGroup.addIncludes(ethnicGroup);
596
					}
597
					humanGroupVocabulary.addTerm(humanGroup);
598
					vocabularyService.saveOrUpdate(humanGroupVocabulary);
599
					conversation.commit(true);
600
					break;
601
				
602
				//case 2: = Country
603
				case 2:
604
					Pager<Modifier> countryPager = termService.findByRepresentationText(lstUpdate.get(1), Modifier.class, null, null);
605
					Modifier country = null;
606
					
607
					if(countryPager.getCount()>0) {
608
						country = countryPager.getRecords().get(0);
609
					}
610
					
611
					if(country == null) {
612
						country = Modifier.NewInstance(lstUpdate.get(1), lstUpdate.get(1), null);
613
						countryVocabulary.addTerm(country);
614
						vocabularyService.saveOrUpdate(countryVocabulary);
615
					}
616
					conversation.commit(true);
617
					break;
618
				
619
				//case 3: //plantPart
620
				case 3:
621
					Pager<Modifier> plantPartPager = termService.findByRepresentationText(lstUpdate.get(1), Modifier.class, null, null);
622
					Modifier plantPart = null;
623
					
624
					if(plantPartPager.getCount()>0) {
625
						plantPart = plantPartPager.getRecords().get(0);
626
					}
627
					
628
					if(plantPart == null) {
629
						plantPart = Modifier.NewInstance(lstUpdate.get(1), lstUpdate.get(1), null);
630
						plantPartVocabulary.addTerm(plantPart);
631
						vocabularyService.saveOrUpdate(plantPartVocabulary);
632
					}
633
					conversation.commit(true);
634
					break;
635
					
636
				}
637
			}
638
			conversation.close();	
639
			applicationController.close();
640
			
641
		} catch (IOException e) {
642
			success = false;
643
			e.printStackTrace();
644
		}
645
		return success;
646
		
647
	}
648
	
649
	private ArrayList<ArrayList<String>> loadSpreadsheet(String xslPathString) {
650
		ArrayList<ArrayList<String>> lstUpdates = new ArrayList<ArrayList<String>>();
651
		InputStream inputStream = null;
652
		
653
		try {
654
			inputStream = new FileInputStream(xslPathString);
655

  
656
		} catch (FileNotFoundException e) {
657
			System.out.println("File not found in the specified path.");
658
			e.printStackTrace();
659
		}
660
		
661
		POIFSFileSystem fileSystem = null;
662
		
663
		try {
664
			fileSystem = new POIFSFileSystem(inputStream);
665

  
666
			HSSFWorkbook workBook = new HSSFWorkbook(fileSystem);
667
			HSSFSheet sheet = workBook.getSheetAt(0);
668
			Iterator rows = sheet.rowIterator();
669
			// Iterator rows = sheet.rowIterator();
670
			//Set<Integer> lstTaxonIDs;
671
		
672

  
673
			while (rows.hasNext()) {
674

  
675
				HSSFRow row = (HSSFRow) rows.next();
676
				System.out.println("Row No.: " + row.getRowNum());
677
				Iterator cells = row.cellIterator();
678
				ArrayList<String> lstTerms = new ArrayList<String>();
679
				while (cells.hasNext()) {
680
					HSSFCell cell = (HSSFCell) cells.next();
681
				
682
					int intCellType = cell.getCellType();
683
					switch (intCellType) {
684
						case 0:
685
							int cellValue = (int) cell.getNumericCellValue(); 
686
							lstTerms.add(Integer.toString(cellValue));
687
							break;
688
						case 1:
689
							lstTerms.add(cell.getStringCellValue());
690
							break;
691
					}
692
				}
693
				lstUpdates.add(lstTerms);
694
				//lstTaxonIDs.add(Integer.parseInt(lstTaxon.get(0)));	
695
			}
696
		} catch (IOException e) {
697
			e.printStackTrace();
698
		}
699
		return lstUpdates;
700
	}
701
	
702
	
703
	private boolean setupNecessaryItems() {
704
		boolean success = false;
705
		CdmApplicationController applicationController = CdmApplicationController.NewInstance(dataSource());
706
		ConversationHolder conversation = applicationController.NewConversation();
707
		
708
		
709
		ITaxonService service = applicationController.getTaxonService();
710
		ITermService termService = applicationController.getTermService();
711
		IVocabularyService vocabularyService = applicationController.getVocabularyService();
712
		IFeatureTreeService featureTreeService = applicationController.getFeatureTreeService();
713
		
714
		MarkerType existingMarkertype = (MarkerType)termService.find(UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));
715
		Feature featureUseRecord = (Feature) termService.find(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
716
		Feature featureUseSummary = (Feature) termService.find(UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279"));
717
		TermVocabulary<State> stateVocabulary =  (TermVocabulary<State>) vocabularyService.find(UUID.fromString("67430d7c-fd43-4e9d-af5e-d0dca3f74931")); 
718
		TermVocabulary<Modifier> countryVocabulary = (TermVocabulary<Modifier>) vocabularyService.find(UUID.fromString("116c51f1-e63a-46f7-a258-e1149a42868b"));  
719
		TermVocabulary<Modifier> plantPartVocabulary = (TermVocabulary<Modifier>) vocabularyService.find(UUID.fromString("369914fe-d54b-4063-99ce-abc81d30ad35"));  
720
		TermVocabulary<Modifier> humanGroupVocabulary =  (TermVocabulary<Modifier>) vocabularyService.find(UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc"));
721
		Pager<DefinedTermBase>  notAvailModPager = (Pager<DefinedTermBase> ) termService.findByTitle(Modifier.class, "N/A", null, null, null, null, null, null);
722
		Pager<DefinedTermBase>  notAvailStatePager = (Pager<DefinedTermBase> ) termService.findByTitle(State.class, "N/A", null, null, null, null, null, null);
723
		
724
		conversation.startTransaction();
725
		if (existingMarkertype == null) {
726
			existingMarkertype = MarkerType.NewInstance("use", "use", null);
727
			existingMarkertype.setUuid( UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));
728
			TermVocabulary<MarkerType> markerTypeVocabulary = (TermVocabulary<MarkerType>)vocabularyService.find((UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305")));
729
			markerTypeVocabulary.addTerm(existingMarkertype);
730
			vocabularyService.saveOrUpdate(markerTypeVocabulary);
731
			conversation.commit(true);
732
		}
733
		if (stateVocabulary == null) {
734
			
735
			URI termSourceUri = null;
736
			try {
737
				termSourceUri = new URI("eu.etaxonomy.cdm.model.description.State");
738
			} catch (URISyntaxException e) {
739
				e.printStackTrace();
740
			}
741
			stateVocabulary = TermVocabulary.NewInstance("Use Category", "Use Category", null, termSourceUri);
742
			stateVocabulary.setUuid(UUID.fromString("67430d7c-fd43-4e9d-af5e-d0dca3f74931"));
743
			vocabularyService.saveOrUpdate(stateVocabulary);
744
			conversation.commit(true);
745
		}
746
		if (countryVocabulary == null) {
747
			URI termSourceUri = null;
748
			try {
749
				termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");
750
			} catch (URISyntaxException e) {
751
				e.printStackTrace();
752
			}
753
			countryVocabulary = TermVocabulary.NewInstance("Country", "Country", null, termSourceUri);
754
			countryVocabulary.setUuid(UUID.fromString("116c51f1-e63a-46f7-a258-e1149a42868b"));
755
			
756
			vocabularyService.saveOrUpdate(countryVocabulary);
757
			conversation.commit(true);
758
		}
759
		if (plantPartVocabulary == null) {
760
			URI termSourceUri = null;
761
			try {
762
				termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");
763
			} catch (URISyntaxException e) {
764
				e.printStackTrace();
765
			}
766
			plantPartVocabulary = TermVocabulary.NewInstance("Plant Part", "Plant Part", null, termSourceUri);
767
			plantPartVocabulary.setUuid(UUID.fromString("369914fe-d54b-4063-99ce-abc81d30ad35"));
768
			vocabularyService.saveOrUpdate(plantPartVocabulary);
769
			conversation.commit(true);
770
		}
771
		if (humanGroupVocabulary == null) {
772
			URI termSourceUri = null;
773
			try {
774
				termSourceUri = new URI("eu.etaxonomy.cdm.model.description.Modifier");
775
			} catch (URISyntaxException e) {
776
				e.printStackTrace();
777
			}
778
			humanGroupVocabulary = TermVocabulary.NewInstance("Human Group", "Human Group", null, termSourceUri);
779
			humanGroupVocabulary.setUuid(UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc"));
780
			vocabularyService.saveOrUpdate(humanGroupVocabulary);
781
			conversation.commit(true);
782
		}
783
		if(featureUseRecord == null|| featureUseSummary == null) {
784
			TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)vocabularyService.find((UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8")));
785
			FeatureTree palmWebFeatureTree = featureTreeService.find(UUID.fromString("72ccce05-7cc8-4dab-8e47-bf3f5fd848a0"));
786
			//List<FeatureTree> featureTrees = CdmStore.getService(IFeatureTreeService.class).list(FeatureTree.class, null, null, null, null);
787
			
788
			if (featureUseRecord == null ) {
789
				featureUseRecord = Feature.NewInstance("Use Record", "Use Record", null);
790
				featureUseRecord.setUuid(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
791
				featureUseRecord.isSupportsCategoricalData();
792
				featureUseRecord.setSupportsCategoricalData(true);
793
				featureVocabulary.addTerm(featureUseRecord);
794
				FeatureNode useRecFeatureNode = FeatureNode.NewInstance(featureUseRecord);
795
				palmWebFeatureTree.getRoot().addChild(useRecFeatureNode);
796
			}
797
			if (featureUseSummary == null) {
798
				featureUseSummary = Feature.NewInstance("Use", "Use", null);
799
				featureUseSummary.setUuid(UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279"));
800
				featureUseSummary.isSupportsTextData();
801
				featureUseSummary.setSupportsTextData(true);
802
				//TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)CdmStore.getService(IVocabularyService.class).find((UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8")));
803
				featureVocabulary.addTerm(featureUseSummary);
804
				FeatureNode useSumFeatureNode = FeatureNode.NewInstance(featureUseSummary);
805
				palmWebFeatureTree.getRoot().addChild(useSumFeatureNode);
806
			}
807
			
808
			vocabularyService.saveOrUpdate(featureVocabulary);
809
			featureTreeService.saveOrUpdate(palmWebFeatureTree);
810
			conversation.commit(true);
811
			
812
		}
813
		if(notAvailModPager.getCount() == 0) {
814
			Modifier notAvailMod = Modifier.NewInstance("N/A", "N/A", null);
815
			termService.saveOrUpdate(notAvailMod);
816
			conversation.commit(true);
817
		}
818
		
819
		if(notAvailStatePager.getCount() == 0) {
820
			State notAvailState = State.NewInstance("N/A", "N/A", null);
821
			termService.saveOrUpdate(notAvailState);
822
			conversation.commit(true);
823
		}
824
		/*if(featureUseRecord == null) {
825
			featureUseRecord = Feature.NewInstance("Use Record", "Use Record", null);
826
			featureUseRecord.setUuid(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
827
			featureUseRecord.isSupportsCategoricalData();
828
			featureUseRecord.setSupportsCategoricalData(true);
829
			//TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)vocabularyService.find((UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8")));
830
			featureVocabulary.addTerm(featureUseRecord);
831
			FeatureTree palmWebFeatureTree = featureTreeService.find(UUID.fromString("72ccce05-7cc8-4dab-8e47-bf3f5fd848a0"));
832
			FeatureNode useRecFeatureNode = FeatureNode.NewInstance(featureUseRecord);
833
			palmWebFeatureTree.getRoot().addChild(useRecFeatureNode);
834
			vocabularyService.saveOrUpdate(featureVocabulary);
835
			featureTreeService.saveOrUpdate(palmWebFeatureTree);
836
			conversation.commit(true);
837
			
838
		}
839
		if(featureUseSummary == null) {
840
			featureUseSummary = Feature.NewInstance("Use Summary", "Use Summary", null);
841
			featureUseSummary.setUuid(UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279"));
842
			featureUseSummary.isSupportsTextData();
843
			featureUseSummary.setSupportsTextData(true);
844
			//TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)vocabularyService.find((UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8")));
845
			featureVocabulary.addTerm(featureUseSummary);
846
			FeatureTree palmWebFeatureTree = featureTreeService.find(UUID.fromString("72ccce05-7cc8-4dab-8e47-bf3f5fd848a0"));
847
			FeatureNode useRecFeatureNode = FeatureNode.NewInstance(featureUseSummary);
848
			palmWebFeatureTree.getRoot().addChild(useRecFeatureNode);
849
			vocabularyService.saveOrUpdate(featureVocabulary);
850
			featureTreeService.saveOrUpdate(palmWebFeatureTree);
851
			conversation.commit(true);
852
		}*/
853
		
854
		conversation.close();
855
		applicationController.close();
856
		
857
		return success;
858
	}
859

  
860
	public static void main(String[] args) {
861
		UseImport uiImport = new UseImport();
862
		// String xlsPath = ".//toload.xlsx";
863
		//String xlsPath = "C://workspace//CDM Trunk//UseImport//src//main//java//eu//etaxonomy//cdm//toLoad2.xls";
864
		
865
		uiImport.setupNecessaryItems();
866
		uiImport.loadTerms();
867
		uiImport.loadUses();
868
		//String xlsPath = "C://workspace//toLoad3.xls";
869
		//uiImport.importFromExcelSS(xlsPath);
870

  
871
	}
872
}
UseImport/src/test/java/eu/etaxonomy/cdm/AppTest.java
1
package eu.etaxonomy.cdm;
2

  
3
import junit.framework.Test;
4
import junit.framework.TestCase;
5
import junit.framework.TestSuite;
6

  
7
/**
8
 * Unit test for simple App.
9
 */
10
public class AppTest 
11
    extends TestCase
12
{
13
    /**
14
     * Create the test case
15
     *
16
     * @param testName name of the test case
17
     */
18
    public AppTest( String testName )
19
    {
20
        super( testName );
21
    }
22

  
23
    /**
24
     * @return the suite of tests being tested
25
     */
26
    public static Test suite()
27
    {
28
        return new TestSuite( AppTest.class );
29
    }
30

  
31
    /**
32
     * Rigourous Test :-)
33
     */
34
    public void testApp()
35
    {
36
        assertTrue( true );
37
    }
38
}
app-import/src/main/java/eu/etaxonomy/cdm/app/common/CdmDestinations.java
47 47
		DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
48 48
		String cdmServer = "localhost";
49 49
		String cdmDB = "palmae_2011_07_17"; 
50
		String cdmUserName = "edit";
50
		String cdmUserName = "root";
51 51
		return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null);
52 52
	}
53 53
	
app-import/src/main/java/eu/etaxonomy/cdm/app/excelImport/taxa/UseSummaryActivator.java
32 32
public class UseSummaryActivator {
33 33
	private static final Logger logger = Logger.getLogger(UseSummaryActivator.class);
34 34
    
35
	private static String fileName = new String("C:\\tmp\\temp\\UseSummary.xls");
35
	private static String fileName = new String("C:\\tmp\\temp\\NormalExplicit.xls");
36 36
	private static DbSchemaValidation dbSchemaValidation = DbSchemaValidation.VALIDATE;
37 37

  
38 38
	private static final ICdmDataSource destinationDb = CdmDestinations.cdm_test_useSummary();

Also available in: Unified diff