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
|
package eu.etaxonomy.cdm.app.eflora;
|
10
|
|
11
|
import java.util.List;
|
12
|
import java.util.UUID;
|
13
|
|
14
|
import org.apache.log4j.Logger;
|
15
|
import org.springframework.transaction.TransactionStatus;
|
16
|
|
17
|
import eu.etaxonomy.cdm.api.service.ITermService;
|
18
|
import eu.etaxonomy.cdm.common.URI;
|
19
|
import eu.etaxonomy.cdm.database.DbSchemaValidation;
|
20
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
21
|
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK;
|
22
|
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
|
23
|
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
|
24
|
import eu.etaxonomy.cdm.io.markup.MarkupTransformer;
|
25
|
import eu.etaxonomy.cdm.model.description.Feature;
|
26
|
import eu.etaxonomy.cdm.model.description.PolytomousKey;
|
27
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
28
|
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
|
29
|
import eu.etaxonomy.cdm.model.term.TermNode;
|
30
|
import eu.etaxonomy.cdm.model.term.TermTree;
|
31
|
|
32
|
/**
|
33
|
* @author a.mueller
|
34
|
* @since 20.06.2008
|
35
|
*/
|
36
|
public class FloreGabonActivator extends EfloraActivatorBase {
|
37
|
private static final Logger logger = Logger.getLogger(FloreGabonActivator.class);
|
38
|
|
39
|
//database validation status (create, update, validate ...)
|
40
|
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;
|
41
|
// static final URI source = EfloraSources.fdg_sample();
|
42
|
static final URI fdg1 = EfloraSources.fdg_1();
|
43
|
static final URI fdg2 = EfloraSources.fdg_2();
|
44
|
static final URI fdg3 = EfloraSources.fdg_3();
|
45
|
static final URI fdg4 = EfloraSources.fdg_4();
|
46
|
static final URI fdg5 = EfloraSources.fdg_5();
|
47
|
static final URI fdg5bis = EfloraSources.fdg_5bis();
|
48
|
static final URI fdg6 = EfloraSources.fdg_6();
|
49
|
static final URI fdg7 = EfloraSources.fdg_7();
|
50
|
static final URI fdg8 = EfloraSources.fdg_8();
|
51
|
static final URI fdg9 = EfloraSources.fdg_9();
|
52
|
static final URI fdg10 = EfloraSources.fdg_10();
|
53
|
static final URI fdg11 = EfloraSources.fdg_11();
|
54
|
static final URI fdg12_17 = EfloraSources.fdg_12_17();
|
55
|
static final URI fdg13 = EfloraSources.fdg_13();
|
56
|
static final URI fdg14 = EfloraSources.fdg_14();
|
57
|
static final URI fdg15 = EfloraSources.fdg_15();
|
58
|
static final URI fdg16 = EfloraSources.fdg_16();
|
59
|
static final URI fdg18 = EfloraSources.fdg_18();
|
60
|
static final URI fdg19 = EfloraSources.fdg_19();
|
61
|
static final URI fdg20 = EfloraSources.fdg_20();
|
62
|
static final URI fdg21 = EfloraSources.fdg_21();
|
63
|
static final URI fdg22 = EfloraSources.fdg_22();
|
64
|
static final URI fdg23 = EfloraSources.fdg_23();
|
65
|
static final URI fdg24 = EfloraSources.fdg_24();
|
66
|
static final URI fdg25 = EfloraSources.fdg_25();
|
67
|
static final URI fdg26 = EfloraSources.fdg_26();
|
68
|
static final URI fdg27 = EfloraSources.fdg_27();
|
69
|
static final URI fdg28 = EfloraSources.fdg_28();
|
70
|
static final URI fdg29 = EfloraSources.fdg_29();
|
71
|
static final URI fdg30 = EfloraSources.fdg_30();
|
72
|
static final URI fdg31 = EfloraSources.fdg_31();
|
73
|
static final URI fdg32 = EfloraSources.fdg_32();
|
74
|
static final URI fdg33 = EfloraSources.fdg_33();
|
75
|
static final URI fdg34 = EfloraSources.fdg_34();
|
76
|
static final URI fdg35 = EfloraSources.fdg_35();
|
77
|
|
78
|
// static final URI fdg36 = EfloraSources.fdg_36();
|
79
|
// static final URI fdg37 = EfloraSources.fdg_37();
|
80
|
static final URI fdg36_37 = EfloraSources.fdg_36_37();
|
81
|
|
82
|
static final URI fdg38 = EfloraSources.fdg_38();
|
83
|
static final URI fdg39 = EfloraSources.fdg_39();
|
84
|
static final URI fdg40 = EfloraSources.fdg_40();
|
85
|
static final URI fdg41 = EfloraSources.fdg_41();
|
86
|
static final URI fdg42 = EfloraSources.fdg_42();
|
87
|
static final URI fdg43 = EfloraSources.fdg_43();
|
88
|
static final URI fdg44 = EfloraSources.fdg_44();
|
89
|
static final URI fdg45 = EfloraSources.fdg_45();
|
90
|
|
91
|
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flore_gabon_preview();
|
92
|
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flore_gabon_production();
|
93
|
static final ICdmDataSource cdmDestination = CdmDestinations.localH2();
|
94
|
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql();
|
95
|
|
96
|
//feature tree uuid
|
97
|
public static final UUID featureTreeUuid = UUID.fromString("ee688973-2595-4d4d-b11e-6df71e96a5c2");
|
98
|
private static final String featureTreeTitle = "Flore Gabon Presentation Feature Tree";
|
99
|
|
100
|
//classification
|
101
|
static final UUID classificationUuid = UUID.fromString("2f892452-ff49-48cf-834f-52ca29600719");
|
102
|
static final String classificationTitle = "Flore du Gabon";
|
103
|
|
104
|
//check - import
|
105
|
private boolean h2ForCheck = false;
|
106
|
static CHECK check = CHECK.IMPORT_WITHOUT_CHECK;
|
107
|
|
108
|
static boolean doPrintKeys = false;
|
109
|
|
110
|
private boolean replaceStandardKeyTitles = true;
|
111
|
|
112
|
//taxa
|
113
|
static final boolean doTaxa = true;
|
114
|
|
115
|
static final boolean reuseState = true;
|
116
|
|
117
|
//if true, use inverse include information
|
118
|
private boolean inverseInclude = true;
|
119
|
|
120
|
private boolean includeFdg1 = true;
|
121
|
private boolean includeFdg2 = true;
|
122
|
private boolean includeFdg3 = true;
|
123
|
private boolean includeFdg4 = true;
|
124
|
private boolean includeFdg5 = true;
|
125
|
private boolean includeFdg5bis = true;
|
126
|
private boolean includeFdg6 = true;
|
127
|
private boolean includeFdg7 = true;
|
128
|
private boolean includeFdg8 = true;
|
129
|
private boolean includeFdg9 = true;
|
130
|
private boolean includeFdg10 = true;
|
131
|
private boolean includeFdg11 = true;
|
132
|
private boolean includeFdg12_17 = true;
|
133
|
private boolean includeFdg13 = true;
|
134
|
private boolean includeFdg14 = true;
|
135
|
private boolean includeFdg15 = true;
|
136
|
private boolean includeFdg16 = true;
|
137
|
private boolean includeFdg18 = true;
|
138
|
private boolean includeFdg19 = true;
|
139
|
private boolean includeFdg20 = true;
|
140
|
private boolean includeFdg21 = true;
|
141
|
private boolean includeFdg22 = true;
|
142
|
|
143
|
private boolean includeFdg23 = false;
|
144
|
private boolean includeFdg24 = true;
|
145
|
private boolean includeFdg25 = true;
|
146
|
private boolean includeFdg26 = true;
|
147
|
|
148
|
private boolean includeFdg27 = true;
|
149
|
private boolean includeFdg28 = true;
|
150
|
|
151
|
private boolean includeFdg29 = true;
|
152
|
|
153
|
private boolean includeFdg30 = true;
|
154
|
|
155
|
private boolean includeFdg31 = true;
|
156
|
private boolean includeFdg32 = true;
|
157
|
private boolean includeFdg33 = true;
|
158
|
|
159
|
private boolean includeFdg34 = true;
|
160
|
private boolean includeFdg35 = true;
|
161
|
|
162
|
// private boolean includeFdg36 = true;
|
163
|
// private boolean includeFdg37 = true;
|
164
|
private boolean includeFdg36_37 = true;
|
165
|
private boolean includeFdg38 = true;
|
166
|
private boolean includeFdg39 = true;
|
167
|
private boolean includeFdg40 = true;
|
168
|
private boolean includeFdg41 = true;
|
169
|
private boolean includeFdg42 = true;
|
170
|
private boolean includeFdg43 = true;
|
171
|
private boolean includeFdg44 = true;
|
172
|
private boolean includeFdg45 = true;
|
173
|
|
174
|
// **************** NO CHANGE **********************************************/
|
175
|
|
176
|
private void doImport(ICdmDataSource cdmDestination){
|
177
|
super.doImport(fdg1, cdmDestination,check, h2ForCheck);
|
178
|
|
179
|
//make config
|
180
|
config.setClassificationUuid(classificationUuid);
|
181
|
config.setDoTaxa(doTaxa);
|
182
|
config.setDoPrintKeys(doPrintKeys);
|
183
|
config.setDbSchemaValidation(hbm2dll);
|
184
|
config.setReplaceStandardKeyTitles(replaceStandardKeyTitles);
|
185
|
config.setSourceReference(getSourceReference("Flore du Gabon"));
|
186
|
config.setClassificationName(classificationTitle);
|
187
|
config.setReuseExistingState(reuseState);
|
188
|
|
189
|
//Vol1
|
190
|
executeVolume( fdg1, includeFdg1 ^ inverseInclude);
|
191
|
|
192
|
//Vol2
|
193
|
executeVolume(fdg2, includeFdg2 ^ inverseInclude);
|
194
|
|
195
|
//Vol3
|
196
|
executeVolume(fdg3, includeFdg3 ^ inverseInclude);
|
197
|
|
198
|
//Vol4
|
199
|
executeVolume(fdg4, includeFdg4 ^ inverseInclude);
|
200
|
|
201
|
//Vol5
|
202
|
executeVolume(fdg5, includeFdg5 ^ inverseInclude);
|
203
|
|
204
|
//Vol5bis
|
205
|
executeVolume(fdg5bis, includeFdg5bis ^ inverseInclude);
|
206
|
|
207
|
//Vol6
|
208
|
executeVolume(fdg6, includeFdg6 ^ inverseInclude);
|
209
|
|
210
|
//Vol7
|
211
|
executeVolume(fdg7, includeFdg7 ^ inverseInclude);
|
212
|
|
213
|
//Vol8
|
214
|
executeVolume(fdg8, includeFdg8 ^ inverseInclude);
|
215
|
|
216
|
//Vol9
|
217
|
executeVolume(fdg9, includeFdg9 ^ inverseInclude);
|
218
|
|
219
|
//Vol10
|
220
|
executeVolume(fdg10, includeFdg10 ^ inverseInclude);
|
221
|
|
222
|
//Vol11
|
223
|
executeVolume(fdg11, includeFdg11 ^ inverseInclude);
|
224
|
|
225
|
//Vol12
|
226
|
executeVolume(fdg12_17, includeFdg12_17 ^ inverseInclude);
|
227
|
|
228
|
//Vol13
|
229
|
executeVolume(fdg13, includeFdg13 ^ inverseInclude);
|
230
|
|
231
|
//Vol14
|
232
|
executeVolume(fdg14, includeFdg14 ^ inverseInclude);
|
233
|
|
234
|
//Vol15
|
235
|
executeVolume(fdg15, includeFdg15 ^ inverseInclude);
|
236
|
|
237
|
//Vol16
|
238
|
executeVolume(fdg16, includeFdg16 ^ inverseInclude);
|
239
|
|
240
|
//Vol18
|
241
|
executeVolume(fdg18, includeFdg18 ^ inverseInclude);
|
242
|
|
243
|
//Vol19
|
244
|
executeVolume(fdg19, includeFdg19 ^ inverseInclude);
|
245
|
|
246
|
//Vol20
|
247
|
executeVolume(fdg20, includeFdg20 ^ inverseInclude);
|
248
|
|
249
|
//Vol21
|
250
|
executeVolume(fdg21, includeFdg21 ^ inverseInclude);
|
251
|
//Vol22
|
252
|
executeVolume(fdg22, includeFdg22 ^ inverseInclude);
|
253
|
//Vol23
|
254
|
executeVolume(fdg23, includeFdg23 ^ inverseInclude);
|
255
|
//Vol24
|
256
|
executeVolume(fdg24, includeFdg24 ^ inverseInclude);
|
257
|
//Vol25
|
258
|
executeVolume(fdg25, includeFdg25 ^ inverseInclude);
|
259
|
//Vol26
|
260
|
executeVolume(fdg26, includeFdg26 ^ inverseInclude);
|
261
|
//Vol27
|
262
|
executeVolume(fdg27, includeFdg27 ^ inverseInclude);
|
263
|
//Vol28
|
264
|
executeVolume(fdg28, includeFdg28 ^ inverseInclude);
|
265
|
//Vol29
|
266
|
executeVolume(fdg29, includeFdg29 ^ inverseInclude);
|
267
|
//Vol30
|
268
|
executeVolume(fdg30, includeFdg30 ^ inverseInclude);
|
269
|
//Vol31
|
270
|
executeVolume(fdg31, includeFdg31 ^ inverseInclude);
|
271
|
//Vol32
|
272
|
executeVolume(fdg32, includeFdg32 ^ inverseInclude);
|
273
|
//Vol33
|
274
|
executeVolume(fdg33, includeFdg33 ^ inverseInclude);
|
275
|
//Vol34
|
276
|
executeVolume(fdg34, includeFdg34 ^ inverseInclude);
|
277
|
//Vol35
|
278
|
executeVolume(fdg35, includeFdg35 ^ inverseInclude);
|
279
|
|
280
|
// //Vol36
|
281
|
// executeVolume(fdg36, includeFdg36 ^ inverseInclude);
|
282
|
//
|
283
|
// //Vol37
|
284
|
// executeVolume(fdg37, includeFdg37 ^ inverseInclude);
|
285
|
|
286
|
//Vol 36_37
|
287
|
executeVolume(fdg36_37, includeFdg36_37 ^ inverseInclude);
|
288
|
|
289
|
//Vol38
|
290
|
executeVolume(fdg38, includeFdg38 ^ inverseInclude);
|
291
|
|
292
|
//Vol39
|
293
|
executeVolume(fdg39, includeFdg39 ^ inverseInclude);
|
294
|
|
295
|
//Vol40
|
296
|
executeVolume(fdg40, includeFdg40 ^ inverseInclude);
|
297
|
|
298
|
//Vol41
|
299
|
executeVolume(fdg41, includeFdg41 ^ inverseInclude);
|
300
|
|
301
|
//Vol42
|
302
|
executeVolume(fdg42, includeFdg42 ^ inverseInclude);
|
303
|
|
304
|
//Vol43
|
305
|
executeVolume(fdg43, includeFdg43 ^ inverseInclude);
|
306
|
|
307
|
//Vol44
|
308
|
executeVolume(fdg44, includeFdg44 ^ inverseInclude);
|
309
|
|
310
|
//Vol45
|
311
|
executeVolume(fdg45, includeFdg45 ^ inverseInclude);
|
312
|
|
313
|
TermTree<Feature> tree = makeFeatureNode(myImport.getCdmAppController().getTermService());
|
314
|
myImport.getCdmAppController().getTermTreeService().saveOrUpdate(tree);
|
315
|
|
316
|
makeAutomatedFeatureTree(myImport.getCdmAppController(), config.getState(),
|
317
|
featureTreeUuid, featureTreeTitle);
|
318
|
|
319
|
//check keys
|
320
|
if (doPrintKeys){
|
321
|
TransactionStatus tx = myImport.getCdmAppController().startTransaction();
|
322
|
List<PolytomousKey> keys = myImport.getCdmAppController().getPolytomousKeyService().list(PolytomousKey.class, null, null, null, null);
|
323
|
for(PolytomousKey key : keys){
|
324
|
key.print(System.out);
|
325
|
System.out.println();
|
326
|
}
|
327
|
myImport.getCdmAppController().commitTransaction(tx);
|
328
|
}
|
329
|
|
330
|
}
|
331
|
|
332
|
private Reference getSourceReference(String string) {
|
333
|
Reference result = ReferenceFactory.newGeneric();
|
334
|
result.setTitleCache(string, true);
|
335
|
return result;
|
336
|
}
|
337
|
|
338
|
|
339
|
|
340
|
|
341
|
private TermTree<Feature> makeFeatureNode(ITermService service){
|
342
|
MarkupTransformer transformer = new MarkupTransformer();
|
343
|
|
344
|
TermTree<Feature> result = TermTree.NewInstance();
|
345
|
result.setTitleCache("Old feature tree", true);
|
346
|
TermNode<Feature> root = result.getRoot();
|
347
|
|
348
|
TermNode<Feature> newNode = root.addChild(Feature.DESCRIPTION());
|
349
|
|
350
|
addFeatureNodesByStringList(descriptionFeatureList, newNode, transformer, service);
|
351
|
|
352
|
addFeatureNodesByStringList(generellDescriptionsUpToAnatomyList, root, transformer, service);
|
353
|
newNode = root.addChild(Feature.ANATOMY()); //not sure if this is correct, but it looked like the node was orphaned before
|
354
|
addFeatureNodesByStringList(anatomySubfeatureList, newNode, transformer, service);
|
355
|
|
356
|
newNode = addFeatureNodesByStringList(generellDescriptionsFromAnatomyToPhytoChemoList, root, transformer, service);
|
357
|
addFeatureNodesByStringList(phytoChemoSubFeaturesList, newNode, transformer, service);
|
358
|
|
359
|
newNode = addFeatureNodesByStringList(generellDescriptionsFromPhytoChemoList, root, transformer, service);
|
360
|
|
361
|
newNode = root.addChild(Feature.COMMON_NAME());
|
362
|
|
363
|
newNode = root.addChild(Feature.DISTRIBUTION());
|
364
|
|
365
|
newNode = root.addChild(Feature.ECOLOGY());
|
366
|
addFeatureNodesByStringList(habitatEcologyList, root, transformer, service);
|
367
|
|
368
|
newNode = root.addChild(Feature.USES());
|
369
|
|
370
|
addFeatureNodesByStringList(chomosomesList, root, transformer, service);
|
371
|
|
372
|
newNode = root.addChild(Feature.CITATION());
|
373
|
|
374
|
return result;
|
375
|
}
|
376
|
|
377
|
private static String [] chomosomesList = new String[]{
|
378
|
"Chromosomes",
|
379
|
};
|
380
|
|
381
|
|
382
|
private static String [] habitatEcologyList = new String[]{
|
383
|
"Habitat",
|
384
|
"Habitat & Ecology"
|
385
|
};
|
386
|
|
387
|
|
388
|
private static String [] generellDescriptionsUpToAnatomyList = new String[]{
|
389
|
"Fossils",
|
390
|
"Morphology and anatomy",
|
391
|
"Morphology",
|
392
|
"Vegetative morphology and anatomy",
|
393
|
};
|
394
|
|
395
|
|
396
|
private static String [] anatomySubfeatureList = new String[]{
|
397
|
"Leaf anatomy",
|
398
|
"Wood anatomy"
|
399
|
};
|
400
|
|
401
|
private static String [] generellDescriptionsFromAnatomyToPhytoChemoList = new String[]{
|
402
|
"Flower morphology",
|
403
|
"Palynology",
|
404
|
"Pollination",
|
405
|
"Pollen morphology",
|
406
|
"embryology",
|
407
|
"cytology",
|
408
|
"Life cycle",
|
409
|
"Fruits and embryology",
|
410
|
"Dispersal",
|
411
|
"Chromosome numbers",
|
412
|
"Phytochemistry and Chemotaxonomy",
|
413
|
};
|
414
|
|
415
|
|
416
|
private static String [] phytoChemoSubFeaturesList = new String[]{
|
417
|
"Alkaloids",
|
418
|
"Iridoid glucosides",
|
419
|
"Leaf phenolics",
|
420
|
"Storage products of seeds",
|
421
|
"Aluminium",
|
422
|
"Chemotaxonomy",
|
423
|
};
|
424
|
|
425
|
|
426
|
private static String [] generellDescriptionsFromPhytoChemoList = new String[]{
|
427
|
"Phytochemistry",
|
428
|
"Taxonomy",
|
429
|
"history",
|
430
|
"cultivation",
|
431
|
"Notes"
|
432
|
};
|
433
|
|
434
|
|
435
|
private static String [] descriptionFeatureList = new String[]{
|
436
|
"lifeform",
|
437
|
"Juvenile parts",
|
438
|
"Bark",
|
439
|
//new
|
440
|
"wood",
|
441
|
"Indumentum",
|
442
|
"endophytic body",
|
443
|
"apical buds",
|
444
|
"flowering buds",
|
445
|
"Branchlets",
|
446
|
"Branches",
|
447
|
"Branch",
|
448
|
"Flowering branchlets",
|
449
|
"Trees",
|
450
|
"Twigs",
|
451
|
"stem",
|
452
|
"Stems",
|
453
|
"stem leaves",
|
454
|
"Leaves",
|
455
|
"extraxylary sclerenchyma",
|
456
|
"flower-bearing stems",
|
457
|
"Petiole",
|
458
|
"Petiolules",
|
459
|
"Leaflets",
|
460
|
"Lamina",
|
461
|
"Veins",
|
462
|
"Lateral veins",
|
463
|
"secondary veins",
|
464
|
"Intersecondary veins",
|
465
|
"veinlets",
|
466
|
"Thyrsus",
|
467
|
"Thyrses",
|
468
|
"Inflorescences",
|
469
|
"Inflorescence",
|
470
|
"Young inflorescences",
|
471
|
"Male inflorescences",
|
472
|
"Female inflorescences",
|
473
|
"rachises",
|
474
|
"Bracts",
|
475
|
"Pedicels",
|
476
|
"flowering buds",
|
477
|
"scales",
|
478
|
"Buds",
|
479
|
"Flowers",
|
480
|
"Flower",
|
481
|
"Flowering",
|
482
|
"Stigma",
|
483
|
"perianth",
|
484
|
"Sepals",
|
485
|
"Sepal",
|
486
|
"Outer Sepals",
|
487
|
"Axillary",
|
488
|
"cymes",
|
489
|
"Calyx",
|
490
|
"Androgynophore",
|
491
|
"Petal",
|
492
|
"Petals",
|
493
|
"perigone",
|
494
|
"perigone lobes",
|
495
|
"perigone tube",
|
496
|
"Disc",
|
497
|
"corolla",
|
498
|
"Stamens",
|
499
|
"Staminodes",
|
500
|
"Ovary",
|
501
|
"Anthers",
|
502
|
"anther",
|
503
|
"Pistil",
|
504
|
"Pistillode",
|
505
|
"Ovules",
|
506
|
"androecium",
|
507
|
"gynoecium",
|
508
|
"Filaments",
|
509
|
"Style",
|
510
|
"annulus",
|
511
|
"female flowers",
|
512
|
"Male flowers",
|
513
|
"Androphore",
|
514
|
"Female",
|
515
|
"Infructescences", //order not consistent (sometimes before "Flowers")
|
516
|
"Fruit",
|
517
|
"Fruits",
|
518
|
"fruiting axes",
|
519
|
"drupes",
|
520
|
"Arillode",
|
521
|
"seed",
|
522
|
"Seeds",
|
523
|
"Seedling",
|
524
|
"flower tube",
|
525
|
"nutlets",
|
526
|
"pollen",
|
527
|
"secondary xylem",
|
528
|
"chromosome number",
|
529
|
|
530
|
"figure",
|
531
|
"fig",
|
532
|
"figs",
|
533
|
};
|
534
|
|
535
|
public TermNode<Feature> addFeatureNodesByStringList(String[] featureStringList,
|
536
|
TermNode<Feature> root, IInputTransformer transformer, ITermService termService){
|
537
|
|
538
|
TermNode<Feature> lastChild = null;
|
539
|
try {
|
540
|
for (String featureString : featureStringList){
|
541
|
UUID featureUuid;
|
542
|
featureUuid = transformer.getFeatureUuid(featureString);
|
543
|
Feature feature = (Feature)termService.find(featureUuid);
|
544
|
if (feature != null){
|
545
|
root.addChild(feature);
|
546
|
}
|
547
|
}
|
548
|
|
549
|
} catch (UndefinedTransformerMethodException e) {
|
550
|
logger.error("getFeatureUuid is not implemented in transformer. Features could not be added");
|
551
|
}
|
552
|
return lastChild;
|
553
|
}
|
554
|
|
555
|
public static void main(String[] args) {
|
556
|
FloreGabonActivator me = new FloreGabonActivator();
|
557
|
me.doImport(cdmDestination);
|
558
|
}
|
559
|
}
|