1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.app.wp6.palmae;
|
11
|
|
12
|
import java.io.FileInputStream;
|
13
|
import java.io.FileNotFoundException;
|
14
|
import java.io.IOException;
|
15
|
import java.io.InputStream;
|
16
|
import java.net.URI;
|
17
|
import java.net.URISyntaxException;
|
18
|
import java.util.ArrayList;
|
19
|
import java.util.HashSet;
|
20
|
import java.util.Iterator;
|
21
|
import java.util.List;
|
22
|
import java.util.Set;
|
23
|
import java.util.UUID;
|
24
|
|
25
|
import org.apache.log4j.Logger;
|
26
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
27
|
import org.apache.poi.ss.usermodel.Cell;
|
28
|
import org.apache.poi.ss.usermodel.CellType;
|
29
|
import org.apache.poi.ss.usermodel.Row;
|
30
|
import org.apache.poi.ss.usermodel.Sheet;
|
31
|
import org.apache.poi.ss.usermodel.Workbook;
|
32
|
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
33
|
|
34
|
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
|
35
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
36
|
import eu.etaxonomy.cdm.api.service.IDescriptionService;
|
37
|
import eu.etaxonomy.cdm.api.service.IReferenceService;
|
38
|
import eu.etaxonomy.cdm.api.service.ITaxonService;
|
39
|
import eu.etaxonomy.cdm.api.service.ITermService;
|
40
|
import eu.etaxonomy.cdm.api.service.ITermTreeService;
|
41
|
import eu.etaxonomy.cdm.api.service.IVocabularyService;
|
42
|
import eu.etaxonomy.cdm.api.service.pager.Pager;
|
43
|
import eu.etaxonomy.cdm.config.AccountStore;
|
44
|
import eu.etaxonomy.cdm.database.CdmDataSource;
|
45
|
import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
|
46
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
47
|
import eu.etaxonomy.cdm.model.agent.Team;
|
48
|
import eu.etaxonomy.cdm.model.common.CdmBase;
|
49
|
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
|
50
|
import eu.etaxonomy.cdm.model.common.Language;
|
51
|
import eu.etaxonomy.cdm.model.common.LanguageString;
|
52
|
import eu.etaxonomy.cdm.model.common.Marker;
|
53
|
import eu.etaxonomy.cdm.model.common.MarkerType;
|
54
|
import eu.etaxonomy.cdm.model.common.VerbatimTimePeriod;
|
55
|
import eu.etaxonomy.cdm.model.description.CategoricalData;
|
56
|
import eu.etaxonomy.cdm.model.description.Feature;
|
57
|
import eu.etaxonomy.cdm.model.description.State;
|
58
|
import eu.etaxonomy.cdm.model.description.StateData;
|
59
|
import eu.etaxonomy.cdm.model.description.TaxonDescription;
|
60
|
import eu.etaxonomy.cdm.model.description.TextData;
|
61
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
62
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
63
|
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
|
64
|
import eu.etaxonomy.cdm.model.taxon.Synonym;
|
65
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
66
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
67
|
import eu.etaxonomy.cdm.model.term.DefinedTerm;
|
68
|
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
|
69
|
import eu.etaxonomy.cdm.model.term.TermTree;
|
70
|
import eu.etaxonomy.cdm.model.term.TermType;
|
71
|
import eu.etaxonomy.cdm.model.term.TermVocabulary;
|
72
|
|
73
|
public class UseImport {
|
74
|
public static final Logger logger = Logger.getLogger(UseImport.class);
|
75
|
|
76
|
public static ICdmDataSource dataSource() {
|
77
|
DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL;
|
78
|
String cdmServer = "localhost";
|
79
|
String cdmDB = "palm_use_cdm_db";
|
80
|
String cdmUserName = "root";
|
81
|
String cdmPWD = "root";
|
82
|
return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, cdmPWD);
|
83
|
}
|
84
|
|
85
|
private static ICdmDataSource makeDestination(DatabaseTypeEnum dbType,
|
86
|
String cdmServer, String cdmDB, int port, String cdmUserName,
|
87
|
String pwd) {
|
88
|
// establish connection
|
89
|
pwd = AccountStore.readOrStorePassword(cdmServer, cdmDB, cdmUserName,
|
90
|
pwd);
|
91
|
ICdmDataSource destination;
|
92
|
if (dbType.equals(DatabaseTypeEnum.MySQL)) {
|
93
|
destination = CdmDataSource.NewMySqlInstance(cdmServer, cdmDB,
|
94
|
port, cdmUserName, pwd);
|
95
|
} else if (dbType.equals(DatabaseTypeEnum.PostgreSQL)) {
|
96
|
destination = CdmDataSource.NewPostgreSQLInstance(cdmServer, cdmDB,
|
97
|
port, cdmUserName, pwd);
|
98
|
} else {
|
99
|
// TODO others
|
100
|
throw new RuntimeException("Unsupported DatabaseType");
|
101
|
}
|
102
|
return destination;
|
103
|
}
|
104
|
|
105
|
public boolean importFromExcelSS(String xlsPath) throws InvalidFormatException {
|
106
|
boolean success = true;
|
107
|
|
108
|
CdmApplicationController applicationController = CdmApplicationController.NewInstance(dataSource());
|
109
|
ConversationHolder conversation = applicationController.NewConversation();
|
110
|
conversation.startTransaction();
|
111
|
|
112
|
ITaxonService service = applicationController.getTaxonService();
|
113
|
ITermService termService = applicationController.getTermService();
|
114
|
IDescriptionService descService = applicationController.getDescriptionService();
|
115
|
IReferenceService referenceService = applicationController.getReferenceService();
|
116
|
InputStream inputStream = null;
|
117
|
|
118
|
try {
|
119
|
inputStream = new FileInputStream(xlsPath);
|
120
|
|
121
|
} catch (FileNotFoundException e) {
|
122
|
success = false;
|
123
|
System.out.println("File not found in the specified path.");
|
124
|
e.printStackTrace();
|
125
|
}
|
126
|
|
127
|
// POIFSFileSystem fileSystem = null;
|
128
|
|
129
|
try {
|
130
|
// fileSystem = new POIFSFileSystem(inputStream);
|
131
|
//
|
132
|
// HSSFWorkbook workBook = new HSSFWorkbook(fileSystem);
|
133
|
Workbook workBook = WorkbookFactory.create(inputStream);
|
134
|
|
135
|
|
136
|
Sheet sheet = workBook.getSheetAt(0);
|
137
|
Iterator<Row> rows = sheet.rowIterator();
|
138
|
// Iterator rows = sheet.rowIterator();
|
139
|
ArrayList<ArrayList<String>> lstUpdates = new ArrayList<ArrayList<String>>();
|
140
|
Set<Integer> lstTaxonIDs = new HashSet<Integer>();
|
141
|
//Set<Integer> lstTaxonIDs;
|
142
|
|
143
|
|
144
|
while (rows.hasNext()) {
|
145
|
|
146
|
Row row = rows.next();
|
147
|
System.out.println("Row No.: " + row.getRowNum());
|
148
|
Iterator<Cell> cells = row.cellIterator();
|
149
|
ArrayList<String> lstTaxon = new ArrayList<>();
|
150
|
while (cells.hasNext()) {
|
151
|
Cell cell = cells.next();
|
152
|
|
153
|
CellType cellType = cell.getCellType();
|
154
|
switch (cellType) {
|
155
|
case NUMERIC:
|
156
|
int cellValue = (int) cell.getNumericCellValue();
|
157
|
lstTaxon.add(Integer.toString(cellValue));
|
158
|
break;
|
159
|
case STRING:
|
160
|
lstTaxon.add(cell.getStringCellValue());
|
161
|
break;
|
162
|
default:
|
163
|
throw new RuntimeException("CellType not yet handled: " + cellType);
|
164
|
}
|
165
|
}
|
166
|
lstUpdates.add(lstTaxon);
|
167
|
lstTaxonIDs.add(Integer.parseInt(lstTaxon.get(0)));
|
168
|
}
|
169
|
|
170
|
List<TaxonBase> taxa = service.findTaxaByID(lstTaxonIDs);
|
171
|
for(TaxonBase idTaxa : taxa) {
|
172
|
//System.out.println(idTaxa.getUuid().toString());
|
173
|
System.out.println(idTaxa.getName());
|
174
|
}
|
175
|
|
176
|
|
177
|
MarkerType useMarkerType = (MarkerType) termService.find(UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));
|
178
|
Marker useMarker = Marker.NewInstance(useMarkerType, true);
|
179
|
for (ArrayList<String> lstUpdate : lstUpdates) {
|
180
|
System.out.println("-----------------------------------------------: " + lstUpdate.get(1));
|
181
|
String idTaxonToUpdate = lstUpdate.get(1);
|
182
|
TaxonDescription newUseDescription = TaxonDescription.NewInstance();
|
183
|
newUseDescription.addMarker(useMarker);
|
184
|
newUseDescription.setTitleCache(lstUpdate.get(2));
|
185
|
Reference citation = ReferenceFactory.newGeneric();
|
186
|
Team authorTeam = Team.NewInstance();
|
187
|
authorTeam.setTitleCache(lstUpdate.get(3));
|
188
|
citation.setAuthorship(authorTeam);
|
189
|
citation.setTitle(lstUpdate.get(4));
|
190
|
|
191
|
//citation.
|
192
|
VerbatimTimePeriod year = VerbatimTimePeriod.NewVerbatimInstance(Integer.parseInt(lstUpdate.get(5)));
|
193
|
citation.setDatePublished(year);
|
194
|
citation.setTitleCache(lstUpdate.get(6), true);
|
195
|
//citation.
|
196
|
for(TaxonBase taxon : taxa) {
|
197
|
String taxonUUID = taxon.getUuid().toString();
|
198
|
//System.out.println(idTaxonToUpdate + "|" + taxonUUID);
|
199
|
if(idTaxonToUpdate.equals(taxonUUID)) {
|
200
|
logger.info("Processing Taxn " + taxon.getTitleCache() + " with UUID: " + taxon.getUuid());
|
201
|
if(taxon.isInstanceOf(Synonym.class)) {
|
202
|
Synonym synonym = CdmBase.deproxy(taxon, Synonym.class);
|
203
|
Taxon acceptetdTaxon = synonym.getAcceptedTaxon();
|
204
|
if(acceptetdTaxon != null){
|
205
|
Set<TaxonDescription> taxonDescriptions = acceptetdTaxon.getDescriptions();
|
206
|
if(!taxonDescriptions.isEmpty()) {
|
207
|
TaxonDescription firstDescription = taxonDescriptions.iterator().next();
|
208
|
//newUseSummary.addSource(null, null, citation, null);
|
209
|
//firstDescription.addElement(newUseSummary);
|
210
|
}
|
211
|
else {
|
212
|
logger.warn("No description container for: " + acceptetdTaxon.getName());
|
213
|
}
|
214
|
}
|
215
|
}
|
216
|
else {
|
217
|
Taxon taxonAccepted = (Taxon) taxon;
|
218
|
/*Set<TaxonDescription> taxonDescriptions = taxonAccepted.getDescriptions();
|
219
|
if(!taxonDescriptions.isEmpty()) {
|
220
|
TaxonDescription firstDescription = taxonDescriptions.iterator().next();
|
221
|
//newUseSummary.addSource(null, null, citation, null);
|
222
|
//firstDescription.addElement(newUseSummary);
|
223
|
}
|
224
|
else {
|
225
|
logger.warn("No description container for: " + taxonAccepted.getName());
|
226
|
}*/
|
227
|
taxonAccepted.addDescription(newUseDescription);
|
228
|
service.saveOrUpdate(taxonAccepted);
|
229
|
|
230
|
}
|
231
|
}
|
232
|
}
|
233
|
|
234
|
}
|
235
|
conversation.commit(false);
|
236
|
|
237
|
} catch (IOException e) {
|
238
|
success = false;
|
239
|
e.printStackTrace();
|
240
|
}
|
241
|
|
242
|
return success;
|
243
|
|
244
|
}
|
245
|
|
246
|
private boolean loadUses() throws InvalidFormatException {
|
247
|
boolean success = true;
|
248
|
//String xslUseSummaryPathString = "C://workspace//Matched_UseSummary_referenceIdTaxEd_TaxonName.xls";
|
249
|
//String xslUseSummaryPathString = "C://workspace//testUseSummaries.xls";
|
250
|
|
251
|
|
252
|
String xslUseSummaryPathString = "//Users//alextheys//Projects//CDM_Trunk//Palm_Use_Data_Extension//CDMLib-apps//cdmlib-apps//UseImport//src//main//resources//Matched_UseSummary_referenceIdTaxEd_TaxonName.xls";
|
253
|
|
254
|
//String xslUseRecordPathString = "C://workspace//UseRecordTerms_UseSummaryId.xls";
|
255
|
//String xslUseRecordPathString = "C://workspace//testUseRecords.xls";
|
256
|
//String xslUseRecordPathString = "C://workspace//test_useRecord.xls";
|
257
|
String xslUseRecordPathString = "//Users//alextheys//Projects//CDM_Trunk//Palm_Use_Data_Extension//CDMLib-apps//cdmlib-apps//UseImport//src//main//resources//UseRecordTerms_UseSummaryId.xls";
|
258
|
|
259
|
InputStream inputStream = null;
|
260
|
|
261
|
|
262
|
CdmApplicationController applicationController = CdmApplicationController.NewInstance(dataSource());
|
263
|
ConversationHolder conversation = applicationController.NewConversation();
|
264
|
conversation.startTransaction();
|
265
|
|
266
|
ITaxonService taxonService = applicationController.getTaxonService();
|
267
|
ITermService termService = applicationController.getTermService();
|
268
|
IDescriptionService descService = applicationController.getDescriptionService();
|
269
|
IReferenceService referenceService = applicationController.getReferenceService();
|
270
|
|
271
|
|
272
|
ArrayList<ArrayList<String>> lstUseSummaries = loadSpreadsheet(xslUseSummaryPathString);
|
273
|
ArrayList<ArrayList<String>> lstUseRecords = loadSpreadsheet(xslUseRecordPathString);
|
274
|
|
275
|
MarkerType useMarkerType = (MarkerType) termService.find(UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));
|
276
|
Feature featureUseRecord = (Feature) termService.find(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
|
277
|
Feature featureUseSummary = (Feature) termService.find(UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279"));
|
278
|
Pager<DefinedTerm> notAvailModPager = termService.findByTitle(DefinedTerm.class, "N/A", null, null, null, null, null, null);
|
279
|
Pager<State> notAvailStatePager = termService.findByTitle(State.class, "N/A", null, null, null, null, null, null);
|
280
|
DefinedTerm notAvailMod = notAvailModPager.getRecords().get(0);
|
281
|
State notAvailState = notAvailStatePager.getRecords().get(0);
|
282
|
|
283
|
int i = 0;
|
284
|
int j = 0;
|
285
|
try {
|
286
|
for (ArrayList<String> lstUseSummary : lstUseSummaries) {
|
287
|
i++;
|
288
|
String idTaxonToUpdate = lstUseSummary.get(3);
|
289
|
TaxonBase<?> taxon = taxonService.find(UUID.fromString(idTaxonToUpdate));
|
290
|
if (taxon != null) {
|
291
|
TaxonDescription newUseDescription = TaxonDescription.NewInstance();
|
292
|
Marker useMarker = Marker.NewInstance(useMarkerType, true);
|
293
|
newUseDescription.addMarker(useMarker);
|
294
|
Reference useReference = null;
|
295
|
Pager<Reference> reference = referenceService.findByTitle(Reference.class, lstUseSummary.get(5), null, null, null, null, null, null);
|
296
|
if(reference.getCount() == 0) {
|
297
|
System.out.println("Reference title: " + lstUseSummary.get(5) + " not found.");
|
298
|
} else if(reference.getCount() > 0 ) {
|
299
|
useReference = reference.getRecords().get(0);
|
300
|
}
|
301
|
IdentifiableSource source =IdentifiableSource.NewPrimarySourceInstance(useReference, null); //is type correct?
|
302
|
source.setOriginalNameString(taxon.getName().toString());
|
303
|
newUseDescription.addSource(source);
|
304
|
TextData useSummary = TextData.NewInstance(featureUseSummary);
|
305
|
LanguageString languageString = LanguageString.NewInstance(lstUseSummary.get(1), Language.ENGLISH());
|
306
|
useSummary.putText(languageString);
|
307
|
descService.saveDescriptionElement(useSummary);
|
308
|
newUseDescription.addElement(useSummary);
|
309
|
for (ArrayList<String> lstUseRecord : lstUseRecords) {
|
310
|
j++;
|
311
|
//System.out.println("Processing UseSummary#: " + i + " ID:" + lstUseSummary.get(0) + "UseRecord: " + lstUseRecord.get(1));
|
312
|
if(lstUseSummary.get(0).equals(lstUseRecord.get(0))) {
|
313
|
CategoricalData useRecord = CategoricalData.NewInstance();
|
314
|
useRecord.setFeature(featureUseRecord);
|
315
|
String modifyingText = "";
|
316
|
if(lstUseRecord.get(3) != null && lstUseRecord.get(3).length() > 0) {
|
317
|
Pager<State> useCategoryPager = termService.findByTitle(State.class, lstUseRecord.get(3), null, null, null, null, null, null);
|
318
|
State useCategory = null;
|
319
|
if(useCategoryPager.getCount() > 0) {
|
320
|
useCategory = useCategoryPager.getRecords().get(0);
|
321
|
} else {
|
322
|
useCategory = notAvailState;
|
323
|
}
|
324
|
StateData stateCatData = StateData.NewInstance(useCategory);
|
325
|
stateCatData.setState(useCategory);
|
326
|
stateCatData.putModifyingText(Language.ENGLISH(), "Use Category");
|
327
|
modifyingText += useCategory.toString() + ";";
|
328
|
useRecord.addStateData(stateCatData);
|
329
|
|
330
|
|
331
|
//useRecord.addState(stateData);
|
332
|
} else {
|
333
|
State useCategory = notAvailState;
|
334
|
StateData stateCatData = StateData.NewInstance(useCategory);
|
335
|
stateCatData.setState(useCategory);
|
336
|
stateCatData.putModifyingText(Language.ENGLISH(), "Use Category");
|
337
|
modifyingText += useCategory.toString() + ";";
|
338
|
useRecord.addStateData(stateCatData);
|
339
|
|
340
|
}
|
341
|
|
342
|
if(lstUseRecord.get(4) != null && lstUseRecord.get(4).length() > 0) {
|
343
|
Pager<State> useSubCategoryPager = termService.findByTitle(State.class, lstUseRecord.get(4), null, null, null, null, null, null);
|
344
|
State useSubCategory = null;
|
345
|
if(useSubCategoryPager.getCount() > 0) {
|
346
|
useSubCategory = useSubCategoryPager.getRecords().get(0);
|
347
|
|
348
|
} else {
|
349
|
useSubCategory = notAvailState;
|
350
|
}
|
351
|
StateData stateSubCatData = StateData.NewInstance(useSubCategory);
|
352
|
stateSubCatData.setState(useSubCategory);
|
353
|
stateSubCatData.putModifyingText(Language.ENGLISH(), "Use SubCategory");
|
354
|
modifyingText += useSubCategory.toString() + ";";
|
355
|
useRecord.addStateData(stateSubCatData);
|
356
|
|
357
|
}
|
358
|
else {
|
359
|
State useSubCategory = notAvailState;
|
360
|
StateData stateSubCatData = StateData.NewInstance(useSubCategory);
|
361
|
stateSubCatData.setState(useSubCategory);
|
362
|
stateSubCatData.putModifyingText(Language.ENGLISH(), "Use SubCategory");
|
363
|
modifyingText += useSubCategory.toString() + ";";
|
364
|
useRecord.addStateData(stateSubCatData);
|
365
|
|
366
|
}
|
367
|
if(lstUseRecord.get(5) != null && lstUseRecord.get(5).length() > 0) {
|
368
|
Pager<DefinedTerm> countryPager = termService.findByTitle(DefinedTerm.class, lstUseRecord.get(5), null, null, null, null, null, null);
|
369
|
DefinedTerm country = null;
|
370
|
if(countryPager.getCount() > 0) {
|
371
|
country = countryPager.getRecords().get(0);
|
372
|
} else {
|
373
|
country = notAvailMod;
|
374
|
}
|
375
|
modifyingText += country.toString() + ";";
|
376
|
useRecord.addModifier(country);
|
377
|
} else {
|
378
|
DefinedTerm country = notAvailMod;
|
379
|
modifyingText += country.toString() + ";";
|
380
|
useRecord.addModifier(country);
|
381
|
}
|
382
|
|
383
|
if(lstUseRecord.get(6) != null && lstUseRecord.get(6).length() > 0) {
|
384
|
Pager<DefinedTerm> plantPartPager = termService.findByTitle(DefinedTerm.class, lstUseRecord.get(6), null, null, null, null, null, null);
|
385
|
DefinedTerm plantPart = null;
|
386
|
if(plantPartPager.getCount() > 0) {
|
387
|
plantPart = plantPartPager.getRecords().get(0);
|
388
|
} else {
|
389
|
plantPart = notAvailMod;
|
390
|
}
|
391
|
modifyingText += plantPart.toString() + ";";
|
392
|
useRecord.addModifier(plantPart);
|
393
|
}else {
|
394
|
DefinedTerm plantPart = notAvailMod;
|
395
|
modifyingText += plantPart.toString() + ";";
|
396
|
useRecord.addModifier(plantPart);
|
397
|
}
|
398
|
if(lstUseRecord.get(7) != null && lstUseRecord.get(7).length() > 0) {
|
399
|
Pager<DefinedTerm> humanGroupPager = termService.findByTitle(DefinedTerm.class, lstUseRecord.get(7), null, null, null, null, null, null);
|
400
|
DefinedTerm humanGroup = null;
|
401
|
if(humanGroupPager.getCount() > 0) {
|
402
|
humanGroup = humanGroupPager.getRecords().get(0);
|
403
|
} else {
|
404
|
humanGroup = notAvailMod;
|
405
|
}
|
406
|
modifyingText += humanGroup.toString() + ";";
|
407
|
useRecord.addModifier(humanGroup);
|
408
|
} else {
|
409
|
DefinedTerm humanGroup = notAvailMod;
|
410
|
modifyingText += humanGroup.toString() + ";";
|
411
|
useRecord.addModifier(humanGroup);
|
412
|
}
|
413
|
if(lstUseRecord.get(8) != null && lstUseRecord.get(8).length() > 0) {
|
414
|
Pager<DefinedTerm> ethnicGroupPager = termService.findByTitle(DefinedTerm.class, lstUseRecord.get(8), null, null, null, null, null, null);
|
415
|
DefinedTerm ethnicGroup = null;
|
416
|
if(ethnicGroupPager.getCount() > 0) {
|
417
|
ethnicGroup = ethnicGroupPager.getRecords().get(0);
|
418
|
modifyingText += ethnicGroup.toString() + ";";
|
419
|
} else {
|
420
|
ethnicGroup = notAvailMod;
|
421
|
}
|
422
|
useRecord.addModifier(ethnicGroup);
|
423
|
}
|
424
|
else {
|
425
|
DefinedTerm ethnicGroup = notAvailMod;
|
426
|
modifyingText += ethnicGroup.toString() + ";";
|
427
|
useRecord.addModifier(ethnicGroup);
|
428
|
}
|
429
|
useRecord.putModifyingText(Language.ENGLISH(), modifyingText);
|
430
|
descService.saveDescriptionElement(useRecord);
|
431
|
newUseDescription.addElement(useRecord);
|
432
|
}
|
433
|
}
|
434
|
|
435
|
|
436
|
|
437
|
if (taxon.isInstanceOf(Synonym.class)){
|
438
|
Taxon bestCandidate = null;
|
439
|
Synonym synonym = CdmBase.deproxy(taxon, Synonym.class);
|
440
|
Taxon acceptedTaxon = synonym.getAcceptedTaxon();
|
441
|
if(acceptedTaxon != null){
|
442
|
acceptedTaxon.addDescription(newUseDescription);
|
443
|
taxonService.saveOrUpdate(bestCandidate);
|
444
|
conversation.commit();
|
445
|
}
|
446
|
} else {
|
447
|
Taxon taxonAccepted = (Taxon) taxon;
|
448
|
taxonAccepted.addDescription(newUseDescription);
|
449
|
taxonService.saveOrUpdate(taxonAccepted);
|
450
|
conversation.commit();
|
451
|
}
|
452
|
}
|
453
|
else {
|
454
|
System.out.println("Processing UseSummary#: " + i + " ID:" + lstUseSummary.get(0));
|
455
|
}
|
456
|
}
|
457
|
|
458
|
conversation.close();
|
459
|
applicationController.close();
|
460
|
|
461
|
} catch (Exception e) {
|
462
|
success = false;
|
463
|
e.printStackTrace();
|
464
|
}
|
465
|
return success;
|
466
|
|
467
|
}
|
468
|
|
469
|
//Completed and tested!
|
470
|
private boolean loadTerms() throws InvalidFormatException {
|
471
|
boolean success = true;
|
472
|
|
473
|
//String xslPathString = "C://workspace//terms.xls";
|
474
|
String xslPathString = "//Users//alextheys//Projects//CDM_Trunk//Palm_Use_Data_Extension//CDMLib-apps//cdmlib-apps//UseImport//src//main//resources//terms.xls";
|
475
|
|
476
|
CdmApplicationController applicationController = CdmApplicationController.NewInstance(dataSource());
|
477
|
ConversationHolder conversation = applicationController.NewConversation();
|
478
|
conversation.startTransaction();
|
479
|
|
480
|
ITaxonService service = applicationController.getTaxonService();
|
481
|
ITermService termService = applicationController.getTermService();
|
482
|
IVocabularyService vocabularyService = applicationController.getVocabularyService();
|
483
|
IReferenceService referenceService = applicationController.getReferenceService();
|
484
|
|
485
|
TermVocabulary<State> stateVocabulary = vocabularyService.find(UUID.fromString("67430d7c-fd43-4e9d-af5e-d0dca3f74931"));
|
486
|
TermVocabulary<DefinedTermBase<?>> countryVocabulary = vocabularyService.find(UUID.fromString("116c51f1-e63a-46f7-a258-e1149a42868b"));
|
487
|
TermVocabulary<DefinedTerm> plantPartVocabulary = vocabularyService.find(UUID.fromString("369914fe-d54b-4063-99ce-abc81d30ad35"));
|
488
|
TermVocabulary<DefinedTerm> humanGroupVocabulary = vocabularyService.find(UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc"));
|
489
|
|
490
|
IDescriptionService descService = applicationController.getDescriptionService();
|
491
|
InputStream inputStream = null;
|
492
|
|
493
|
try {
|
494
|
inputStream = new FileInputStream(xslPathString);
|
495
|
|
496
|
} catch (FileNotFoundException e) {
|
497
|
success = false;
|
498
|
System.out.println("File not found in the specified path.");
|
499
|
e.printStackTrace();
|
500
|
}
|
501
|
|
502
|
|
503
|
try {
|
504
|
// POIFSFileSystem fileSystem = new POIFSFileSystem(inputStream);
|
505
|
// HSSFWorkbook workBook = new HSSFWorkbook(fileSystem);
|
506
|
|
507
|
Workbook workBook = WorkbookFactory.create(inputStream);
|
508
|
|
509
|
|
510
|
Sheet sheet = workBook.getSheetAt(0);
|
511
|
Iterator<Row> rows = sheet.rowIterator();
|
512
|
|
513
|
ArrayList<ArrayList<String>> lstUpdates = new ArrayList<ArrayList<String>>();
|
514
|
|
515
|
while (rows.hasNext()) {
|
516
|
|
517
|
Row row = rows.next();
|
518
|
System.out.println("Row No.: " + row.getRowNum());
|
519
|
Iterator<Cell> cells = row.cellIterator();
|
520
|
ArrayList<String> lstTerms = new ArrayList<String>();
|
521
|
while (cells.hasNext()) {
|
522
|
Cell cell = cells.next();
|
523
|
|
524
|
CellType cellType = cell.getCellType();
|
525
|
switch (cellType) {
|
526
|
case NUMERIC:
|
527
|
int cellValue = (int) cell.getNumericCellValue();
|
528
|
lstTerms.add(Integer.toString(cellValue));
|
529
|
break;
|
530
|
case STRING:
|
531
|
lstTerms.add(cell.getStringCellValue());
|
532
|
break;
|
533
|
default:
|
534
|
throw new RuntimeException("CellType not yet handled: " + cellType);
|
535
|
}
|
536
|
}
|
537
|
lstUpdates.add(lstTerms);
|
538
|
//lstTaxonIDs.add(Integer.parseInt(lstTaxon.get(0)));
|
539
|
}
|
540
|
for (ArrayList<String> lstUpdate : lstUpdates) {
|
541
|
int termType = Integer.parseInt(lstUpdate.get(0));
|
542
|
switch (termType) {
|
543
|
//Case 0 = UseCategory
|
544
|
case 0:
|
545
|
Pager<State> useCategoryPager = termService.findByRepresentationText(lstUpdate.get(1), State.class, null, null);
|
546
|
State useCategory = null;
|
547
|
State useSubCat = null;
|
548
|
if (useCategoryPager.getCount()>0) {
|
549
|
useCategory = useCategoryPager.getRecords().get(0);
|
550
|
}
|
551
|
if(useCategory == null) {
|
552
|
useCategory = State.NewInstance(lstUpdate.get(1), lstUpdate.get(1), null);
|
553
|
}
|
554
|
//State useCategory = (State) termService.
|
555
|
if(lstUpdate.size() > 2) {
|
556
|
useSubCat = State.NewInstance(lstUpdate.get(2), lstUpdate.get(2), null);
|
557
|
useCategory.addIncludes(useSubCat);
|
558
|
}
|
559
|
stateVocabulary.addTerm(useCategory);
|
560
|
vocabularyService.saveOrUpdate(stateVocabulary);
|
561
|
conversation.commit(true);
|
562
|
break;
|
563
|
|
564
|
//case 1: = HumanGroup
|
565
|
case 1:
|
566
|
Pager<DefinedTerm> humanGroupPager = termService.findByRepresentationText(lstUpdate.get(1), DefinedTerm.class, null, null);
|
567
|
|
568
|
DefinedTerm humanGroup = null;
|
569
|
DefinedTerm ethnicGroup = null;
|
570
|
if(humanGroupPager.getCount()>0) {
|
571
|
humanGroup = humanGroupPager.getRecords().get(0);
|
572
|
}
|
573
|
|
574
|
if(humanGroup == null) {
|
575
|
humanGroup = DefinedTerm.NewModifierInstance(lstUpdate.get(1), lstUpdate.get(1), null);
|
576
|
}
|
577
|
|
578
|
if(lstUpdate.size() >2) {
|
579
|
ethnicGroup = DefinedTerm.NewModifierInstance(lstUpdate.get(2), lstUpdate.get(2), null);
|
580
|
humanGroup.addIncludes(ethnicGroup);
|
581
|
}
|
582
|
humanGroupVocabulary.addTerm(humanGroup);
|
583
|
vocabularyService.saveOrUpdate(humanGroupVocabulary);
|
584
|
conversation.commit(true);
|
585
|
break;
|
586
|
|
587
|
//case 2: = Country
|
588
|
case 2:
|
589
|
Pager<DefinedTerm> countryPager = termService.findByRepresentationText(lstUpdate.get(1), DefinedTerm.class, null, null);
|
590
|
DefinedTermBase country = null;
|
591
|
|
592
|
if(countryPager.getCount()>0) {
|
593
|
country = countryPager.getRecords().get(0);
|
594
|
}
|
595
|
|
596
|
if(country == null) {
|
597
|
country = NamedArea.NewInstance(lstUpdate.get(1), lstUpdate.get(1), null);
|
598
|
countryVocabulary.addTerm(country);
|
599
|
vocabularyService.saveOrUpdate(countryVocabulary);
|
600
|
}
|
601
|
conversation.commit(true);
|
602
|
break;
|
603
|
|
604
|
//case 3: //plantPart
|
605
|
case 3:
|
606
|
Pager<DefinedTerm> plantPartPager = termService.findByRepresentationText(lstUpdate.get(1), DefinedTerm.class, null, null);
|
607
|
DefinedTerm plantPart = null;
|
608
|
|
609
|
if(plantPartPager.getCount()>0) {
|
610
|
plantPart = plantPartPager.getRecords().get(0);
|
611
|
}
|
612
|
|
613
|
if(plantPart == null) {
|
614
|
plantPart = DefinedTerm.NewModifierInstance(lstUpdate.get(1), lstUpdate.get(1), null);
|
615
|
plantPartVocabulary.addTerm(plantPart);
|
616
|
vocabularyService.saveOrUpdate(plantPartVocabulary);
|
617
|
}
|
618
|
conversation.commit(true);
|
619
|
break;
|
620
|
|
621
|
}
|
622
|
}
|
623
|
conversation.close();
|
624
|
applicationController.close();
|
625
|
|
626
|
} catch (IOException e) {
|
627
|
success = false;
|
628
|
e.printStackTrace();
|
629
|
}
|
630
|
return success;
|
631
|
|
632
|
}
|
633
|
|
634
|
private ArrayList<ArrayList<String>> loadSpreadsheet(String xslPathString) throws InvalidFormatException {
|
635
|
ArrayList<ArrayList<String>> lstUpdates = new ArrayList<ArrayList<String>>();
|
636
|
InputStream inputStream = null;
|
637
|
|
638
|
try {
|
639
|
inputStream = new FileInputStream(xslPathString);
|
640
|
|
641
|
} catch (FileNotFoundException e) {
|
642
|
System.out.println("File not found in the specified path.");
|
643
|
e.printStackTrace();
|
644
|
}
|
645
|
|
646
|
try {
|
647
|
// POIFSFileSystem fileSystem = new POIFSFileSystem(inputStream);
|
648
|
// HSSFWorkbook workBook = new HSSFWorkbook(fileSystem);
|
649
|
|
650
|
Workbook workBook = WorkbookFactory.create(inputStream);
|
651
|
|
652
|
|
653
|
Sheet sheet = workBook.getSheetAt(0);
|
654
|
Iterator<Row> rows = sheet.rowIterator();
|
655
|
// Iterator rows = sheet.rowIterator();
|
656
|
//Set<Integer> lstTaxonIDs;
|
657
|
|
658
|
|
659
|
while (rows.hasNext()) {
|
660
|
|
661
|
Row row = rows.next();
|
662
|
System.out.println("Row No.: " + row.getRowNum());
|
663
|
Iterator<Cell> cells = row.cellIterator();
|
664
|
ArrayList<String> lstTerms = new ArrayList<String>();
|
665
|
while (cells.hasNext()) {
|
666
|
Cell cell = cells.next();
|
667
|
|
668
|
CellType cellType = cell.getCellType();
|
669
|
switch (cellType) {
|
670
|
case NUMERIC:
|
671
|
int cellValue = (int) cell.getNumericCellValue();
|
672
|
lstTerms.add(Integer.toString(cellValue));
|
673
|
break;
|
674
|
case STRING:
|
675
|
lstTerms.add(cell.getStringCellValue());
|
676
|
break;
|
677
|
default:
|
678
|
throw new RuntimeException("CellType not yet handled: " + cellType);
|
679
|
}
|
680
|
}
|
681
|
lstUpdates.add(lstTerms);
|
682
|
//lstTaxonIDs.add(Integer.parseInt(lstTaxon.get(0)));
|
683
|
}
|
684
|
} catch (IOException e) {
|
685
|
e.printStackTrace();
|
686
|
}
|
687
|
return lstUpdates;
|
688
|
}
|
689
|
|
690
|
|
691
|
private boolean setupNecessaryItems() {
|
692
|
boolean success = false;
|
693
|
CdmApplicationController applicationController = CdmApplicationController.NewInstance(dataSource());
|
694
|
ConversationHolder conversation = applicationController.NewConversation();
|
695
|
|
696
|
|
697
|
ITaxonService service = applicationController.getTaxonService();
|
698
|
ITermService termService = applicationController.getTermService();
|
699
|
IVocabularyService vocabularyService = applicationController.getVocabularyService();
|
700
|
ITermTreeService featureTreeService = applicationController.getTermTreeService();
|
701
|
|
702
|
MarkerType existingMarkertype = (MarkerType)termService.find(UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));
|
703
|
Feature featureUseRecord = (Feature) termService.find(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
|
704
|
Feature featureUseSummary = (Feature) termService.find(UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279"));
|
705
|
TermVocabulary<State> stateVocabulary = vocabularyService.find(UUID.fromString("67430d7c-fd43-4e9d-af5e-d0dca3f74931"));
|
706
|
TermVocabulary<NamedArea> countryVocabulary = vocabularyService.find(UUID.fromString("116c51f1-e63a-46f7-a258-e1149a42868b"));
|
707
|
TermVocabulary<DefinedTerm> plantPartVocabulary = vocabularyService.find(UUID.fromString("369914fe-d54b-4063-99ce-abc81d30ad35"));
|
708
|
TermVocabulary<DefinedTerm> humanGroupVocabulary = vocabularyService.find(UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc"));
|
709
|
Pager<DefinedTerm> notAvailModPager = termService.findByTitle(DefinedTerm.class, "N/A", null, null, null, null, null, null);
|
710
|
Pager<State> notAvailStatePager = termService.findByTitle(State.class, "N/A", null, null, null, null, null, null);
|
711
|
|
712
|
conversation.startTransaction();
|
713
|
if (existingMarkertype == null) {
|
714
|
existingMarkertype = MarkerType.NewInstance("use", "use", null);
|
715
|
existingMarkertype.setUuid( UUID.fromString("2e6e42d9-e92a-41f4-899b-03c0ac64f039"));
|
716
|
TermVocabulary<MarkerType> markerTypeVocabulary = vocabularyService.find((UUID.fromString("19dffff7-e142-429c-a420-5d28e4ebe305")));
|
717
|
markerTypeVocabulary.addTerm(existingMarkertype);
|
718
|
vocabularyService.saveOrUpdate(markerTypeVocabulary);
|
719
|
conversation.commit(true);
|
720
|
}
|
721
|
if (stateVocabulary == null) {
|
722
|
|
723
|
URI termSourceUri = null;
|
724
|
try {
|
725
|
termSourceUri = new URI("eu.etaxonomy.cdm.model.description.State");
|
726
|
} catch (URISyntaxException e) {
|
727
|
e.printStackTrace();
|
728
|
}
|
729
|
stateVocabulary = TermVocabulary.NewInstance(TermType.State,
|
730
|
State.class, "Use Category", "Use Category", null, termSourceUri);
|
731
|
stateVocabulary.setUuid(UUID.fromString("67430d7c-fd43-4e9d-af5e-d0dca3f74931"));
|
732
|
vocabularyService.saveOrUpdate(stateVocabulary);
|
733
|
conversation.commit(true);
|
734
|
}
|
735
|
if (countryVocabulary == null) {
|
736
|
URI termSourceUri = null;
|
737
|
try {
|
738
|
termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");
|
739
|
} catch (URISyntaxException e) {
|
740
|
e.printStackTrace();
|
741
|
}
|
742
|
countryVocabulary = TermVocabulary.NewInstance(TermType.NamedArea,
|
743
|
NamedArea.class, "Country", "Country", null, termSourceUri);
|
744
|
countryVocabulary.setUuid(UUID.fromString("116c51f1-e63a-46f7-a258-e1149a42868b"));
|
745
|
|
746
|
vocabularyService.saveOrUpdate(countryVocabulary);
|
747
|
conversation.commit(true);
|
748
|
}
|
749
|
if (plantPartVocabulary == null) {
|
750
|
URI termSourceUri = null;
|
751
|
try {
|
752
|
termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");
|
753
|
} catch (URISyntaxException e) {
|
754
|
e.printStackTrace();
|
755
|
}
|
756
|
plantPartVocabulary = TermVocabulary.NewInstance(TermType.Modifier, DefinedTerm.class,
|
757
|
"Plant Part", "Plant Part", null, termSourceUri);
|
758
|
plantPartVocabulary.setUuid(UUID.fromString("369914fe-d54b-4063-99ce-abc81d30ad35"));
|
759
|
vocabularyService.saveOrUpdate(plantPartVocabulary);
|
760
|
conversation.commit(true);
|
761
|
}
|
762
|
if (humanGroupVocabulary == null) {
|
763
|
URI termSourceUri = null;
|
764
|
try {
|
765
|
termSourceUri = new URI("eu.etaxonomy.cdm.model.description.DefinedTerm");
|
766
|
} catch (URISyntaxException e) {
|
767
|
e.printStackTrace();
|
768
|
}
|
769
|
humanGroupVocabulary = TermVocabulary.NewInstance(TermType.Modifier,
|
770
|
DefinedTerm.class, "Human Group", "Human Group", null, termSourceUri);
|
771
|
humanGroupVocabulary.setUuid(UUID.fromString("ca46cea5-bdf7-438d-9cd8-e2793d2178dc"));
|
772
|
vocabularyService.saveOrUpdate(humanGroupVocabulary);
|
773
|
conversation.commit(true);
|
774
|
}
|
775
|
if(featureUseRecord == null|| featureUseSummary == null) {
|
776
|
TermVocabulary<Feature> featureVocabulary = vocabularyService.find((UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8")));
|
777
|
TermTree<Feature> palmWebFeatureTree = featureTreeService.find(UUID.fromString("72ccce05-7cc8-4dab-8e47-bf3f5fd848a0"));
|
778
|
//List<FeatureTree> featureTrees = CdmStore.getService(IFeatureTreeService.class).list(FeatureTree.class, null, null, null, null);
|
779
|
|
780
|
if (featureUseRecord == null ) {
|
781
|
featureUseRecord = Feature.NewInstance("Use Record", "Use Record", null);
|
782
|
featureUseRecord.setUuid(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
|
783
|
featureUseRecord.isSupportsCategoricalData();
|
784
|
featureUseRecord.setSupportsCategoricalData(true);
|
785
|
featureVocabulary.addTerm(featureUseRecord);
|
786
|
palmWebFeatureTree.getRoot().addChild(featureUseRecord);
|
787
|
}
|
788
|
if (featureUseSummary == null) {
|
789
|
featureUseSummary = Feature.NewInstance("Use", "Use", null);
|
790
|
featureUseSummary.setUuid(UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279"));
|
791
|
featureUseSummary.isSupportsTextData();
|
792
|
featureUseSummary.setSupportsTextData(true);
|
793
|
//TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)CdmStore.getService(IVocabularyService.class).find((UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8")));
|
794
|
featureVocabulary.addTerm(featureUseSummary);
|
795
|
palmWebFeatureTree.getRoot().addChild(featureUseSummary);
|
796
|
}
|
797
|
|
798
|
vocabularyService.saveOrUpdate(featureVocabulary);
|
799
|
featureTreeService.saveOrUpdate(palmWebFeatureTree);
|
800
|
conversation.commit(true);
|
801
|
|
802
|
}
|
803
|
if(notAvailModPager.getCount() == 0) {
|
804
|
DefinedTerm notAvailMod = DefinedTerm.NewInstance(TermType.Modifier, "N/A", "N/A", null);
|
805
|
termService.saveOrUpdate(notAvailMod);
|
806
|
conversation.commit(true);
|
807
|
}
|
808
|
|
809
|
if(notAvailStatePager.getCount() == 0) {
|
810
|
State notAvailState = State.NewInstance("N/A", "N/A", null);
|
811
|
termService.saveOrUpdate(notAvailState);
|
812
|
conversation.commit(true);
|
813
|
}
|
814
|
/*if(featureUseRecord == null) {
|
815
|
featureUseRecord = Feature.NewInstance("Use Record", "Use Record", null);
|
816
|
featureUseRecord.setUuid(UUID.fromString("8125a59d-b4d5-4485-89ea-67306297b599"));
|
817
|
featureUseRecord.isSupportsCategoricalData();
|
818
|
featureUseRecord.setSupportsCategoricalData(true);
|
819
|
//TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)vocabularyService.find((UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8")));
|
820
|
featureVocabulary.addTerm(featureUseRecord);
|
821
|
FeatureTree palmWebFeatureTree = featureTreeService.find(UUID.fromString("72ccce05-7cc8-4dab-8e47-bf3f5fd848a0"));
|
822
|
FeatureNode useRecFeatureNode = FeatureNode.NewInstance(featureUseRecord);
|
823
|
palmWebFeatureTree.getRoot().addChild(useRecFeatureNode);
|
824
|
vocabularyService.saveOrUpdate(featureVocabulary);
|
825
|
featureTreeService.saveOrUpdate(palmWebFeatureTree);
|
826
|
conversation.commit(true);
|
827
|
|
828
|
}
|
829
|
if(featureUseSummary == null) {
|
830
|
featureUseSummary = Feature.NewInstance("Use Summary", "Use Summary", null);
|
831
|
featureUseSummary.setUuid(UUID.fromString("6acb0348-c070-4512-a37c-67bcac016279"));
|
832
|
featureUseSummary.isSupportsTextData();
|
833
|
featureUseSummary.setSupportsTextData(true);
|
834
|
//TermVocabulary<Feature> featureVocabulary = (TermVocabulary<Feature>)vocabularyService.find((UUID.fromString("b187d555-f06f-4d65-9e53-da7c93f8eaa8")));
|
835
|
featureVocabulary.addTerm(featureUseSummary);
|
836
|
FeatureTree palmWebFeatureTree = featureTreeService.find(UUID.fromString("72ccce05-7cc8-4dab-8e47-bf3f5fd848a0"));
|
837
|
FeatureNode useRecFeatureNode = FeatureNode.NewInstance(featureUseSummary);
|
838
|
palmWebFeatureTree.getRoot().addChild(useRecFeatureNode);
|
839
|
vocabularyService.saveOrUpdate(featureVocabulary);
|
840
|
featureTreeService.saveOrUpdate(palmWebFeatureTree);
|
841
|
conversation.commit(true);
|
842
|
}*/
|
843
|
|
844
|
conversation.close();
|
845
|
applicationController.close();
|
846
|
|
847
|
return success;
|
848
|
}
|
849
|
|
850
|
public static void main(String[] args) {
|
851
|
UseImport uiImport = new UseImport();
|
852
|
// String xlsPath = ".//toload.xlsx";
|
853
|
//String xlsPath = "C://workspace//CDM Trunk//UseImport//src//main//java//eu//etaxonomy//cdm//toLoad2.xls";
|
854
|
|
855
|
uiImport.setupNecessaryItems();
|
856
|
try {
|
857
|
uiImport.loadTerms();
|
858
|
uiImport.loadUses();
|
859
|
} catch (InvalidFormatException e) {
|
860
|
// TODO Auto-generated catch block
|
861
|
e.printStackTrace();
|
862
|
}
|
863
|
//String xlsPath = "C://workspace//toLoad3.xls";
|
864
|
//uiImport.importFromExcelSS(xlsPath);
|
865
|
|
866
|
}
|
867
|
}
|