adapt app-import to v5.45
[cdmlib-apps.git] / cdm-eflora / src / main / java / eu / etaxonomy / cdm / app / eflora / FloraMalesianaActivator.java
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.HashSet;
12 import java.util.List;
13 import java.util.Set;
14 import java.util.UUID;
15
16 import org.apache.logging.log4j.LogManager;
17 import org.apache.logging.log4j.Logger;
18 import org.springframework.transaction.TransactionStatus;
19
20 import eu.etaxonomy.cdm.api.service.ITermService;
21 import eu.etaxonomy.cdm.common.URI;
22 import eu.etaxonomy.cdm.database.DbSchemaValidation;
23 import eu.etaxonomy.cdm.database.ICdmDataSource;
24 import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
25 import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK;
26 import eu.etaxonomy.cdm.io.common.events.IIoObserver;
27 import eu.etaxonomy.cdm.io.common.events.LoggingIoObserver;
28 import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
29 import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
30 import eu.etaxonomy.cdm.io.eflora.floraMalesiana.FloraMalesianaTransformer;
31 import eu.etaxonomy.cdm.io.markup.MarkupImportConfigurator;
32 import eu.etaxonomy.cdm.model.description.Feature;
33 import eu.etaxonomy.cdm.model.description.PolytomousKey;
34 import eu.etaxonomy.cdm.model.reference.Reference;
35 import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
36 import eu.etaxonomy.cdm.model.term.TermNode;
37 import eu.etaxonomy.cdm.model.term.TermTree;
38
39 /**
40 * @author a.mueller
41 * @since 20.06.2008
42 */
43 public class FloraMalesianaActivator extends EfloraActivatorBase {
44
45 private static Logger logger = LogManager.getLogger();
46
47 //database validation status (create, update, validate ...)
48 static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;
49
50 // static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_malesiana_preview();
51 // static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_malesiana_production();
52 static final ICdmDataSource cdmDestination = CdmDestinations.localH2();
53 // static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql();
54 // static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql_test();
55
56 private final boolean includeBase = false;
57
58 //5880 / 121834
59 //2 footnote issues
60 //habitat: 6 syso, + ???
61 private final boolean includeVol04 = includeBase;
62 //6258 / 110625
63 //11 sysos, + ??
64 private final boolean includeVol05 = includeBase;
65 //8097 / 177845
66 //2 sysos (<sub>
67 //102 keys
68 private final boolean includeVol06 = includeBase;
69
70 //2283 /49700
71 //no syso, 120 lifecycle, few of them references! and figureRef?
72 private final boolean includeVol07_1 = includeBase;
73 //1640
74 //keys: 1 nothofagus; 4 quercus
75 //12 syso, no uncovered, >>100 lifecycle, >10 references, figureRefs?
76 private final boolean includeVol07_2 = includeBase;
77 //4225
78 //430 syso (10 subheadings),no uncovered, 43 figureRef, references and lifecycle
79 private final boolean includeVol07_3_09_1 = includeBase;
80 //561 / 12440
81 //no syso, 14 lifecycle, 1 reference
82 private final boolean includeVol07_4 = includeBase;
83
84 //223 / 5986
85 //no syso, 5 lifecycle
86 private final boolean includeVol08_1 = includeBase;
87 //2830 / 53189
88 //keys: 23 S. Moore -> Symplocos Moore (handle manually before import)
89 //4syso, <= uncovered, <150 lifecycle, figureRef and references
90 private final boolean includeVol08_2 = includeBase;
91 //2912 / 54235
92 //no syso
93 private final boolean includeVol08_3 = includeBase;
94 //4641 / 94566
95 //184 syso!! (30 subheadings), <=3 uncovered, <50 lifecycle and figureRef
96 private final boolean includeVol09 = includeBase;
97 //845 / 19098
98 //no syso, <= 5 uncovered, <=50 lifecycle
99 private final boolean includeVol10_1 = includeBase;
100 //1211 / 32334
101 //6 syso, <=3 uncovered, <50 lifecycle
102 private final boolean includeVol10_2 = includeBase;
103 //1993 / 49034
104 //2 syso habitats, 2 fast, many lifcycle
105 private final boolean includeVol10_3 = includeBase;
106 //533 / 13553
107 //no syso, 1 uncovered, 1 figureRef, 10 lifecycle
108 private final boolean includeVol10_4 = includeBase;
109 //1529 / 36379
110 //keys: 1 manually (a sect. botrycephalae)
111 //no syso, <= 10 uncovered, < 100 lifecycle
112 private final boolean includeVol11_1 = includeBase;
113 //1271 / 24775
114 //keys: 2 cultivar groups (a cultivar group aggregatum; b cultivar group common onion)
115 //no syso, 1 uncovered, 1 lifecycle, 2 references
116 private final boolean includeVol11_2 = includeBase;
117 //4582 / 52747
118 //1 empty "[]"
119 //no syso habitat, <10 uncovered, > 100 lifecycles
120 private final boolean includeVol11_3 = includeBase;
121 //6135 / 116737
122 //keys: 10 apostrophs
123 //habitat: no syso, 200 - 400 uncovered, different types
124 private final boolean includeVol12 = includeBase;
125 //2865 / 43764
126 //keys: 1 manual (Loranthaceae)
127 //no syso, 1 uncovered habitat
128 private final boolean includeVol13 = includeBase;
129 //4843 / 55501
130 //no syso habitat, 100-150 uncovered, most of them flowering and fruiting lifecycle
131 private final boolean includeVol14 = includeBase;
132 //1775 / 16415
133 //no syso, 5 uncovered, 2 of them epiphytic
134 private final boolean includeVol15 = includeBase;
135 //1471 / 22049
136 //no syso, <= 60 uncovered, very different types
137 private final boolean includeVol16 = includeBase;
138
139 //4113 / 116956
140 //no syso, medium # uncovered habitat (some or)
141 private final boolean includeVol17 = includeBase;
142 //6422 / 71151
143 //no syso habitat, <20 uncovered
144 private final boolean includeVol18 = includeBase;
145 //2612 / 27663
146 //no syso habitat, <= 50 uncovered, mostly untagged lifecycle, some errors
147 private final boolean includeVol19 = includeBase;
148 //563 / 5866
149 //no syso, < 20 uncovered, mostly untagged lifecycle
150 private final boolean includeVol20 = includeBase;
151 //1735 / 19469
152 //no syso, no covered, medium # lifecycle and very few references
153 private final boolean includeVol21 = ! includeBase;
154
155 //Ser II
156 //5798 / 123.627
157 //2 manually, 9 non standard(?), 2 hybrids(?)
158 //no syso habitat, only figureRef and references as habitat issues
159 private final boolean includeVol2_1 = includeBase;
160 //1054 / 25100
161 //2 hybrid formulas
162 //no syso, no habitat issue
163 private final boolean includeVol2_2 = includeBase;
164 //2382 / 52100
165 //no syso, 10-15 uncovered, 2 unexpected attributes: extra
166 private final boolean includeVol2_3 = includeBase;
167 //1045 / 12240
168 //no syso, 1 <br>
169 private final boolean includeVol2_4 = includeBase;
170
171
172 static final URI fmSource04 = EfloraSources.fm_04();
173 static final URI fmSource05 = EfloraSources.fm_05();
174 static final URI fmSource06 = EfloraSources.fm_06();
175 static final URI fmSource07_1 = EfloraSources.fm_07_1();
176 static final URI fmSource07_2 = EfloraSources.fm_07_2();
177 static final URI fmSource07_3_09_1 = EfloraSources.fm_07_3_09_1();
178 static final URI fmSource07_4 = EfloraSources.fm_07_4();
179
180 static final URI fmSource08_1 = EfloraSources.fm_08_1();
181 static final URI fmSource08_2 = EfloraSources.fm_08_2();
182 static final URI fmSource08_3 = EfloraSources.fm_08_3();
183
184 static final URI fmSource09 = EfloraSources.fm_09();
185
186 static final URI fmSource10_1 = EfloraSources.fm_10_1();
187 static final URI fmSource10_2 = EfloraSources.fm_10_2();
188 static final URI fmSource10_3 = EfloraSources.fm_10_3();
189 static final URI fmSource10_4 = EfloraSources.fm_10_4();
190
191
192 static final URI fmSource11_1 = EfloraSources.fm_11_1();
193 static final URI fmSource11_2 = EfloraSources.fm_11_2();
194 static final URI fmSource11_3 = EfloraSources.fm_11_3();
195 static final URI fmSource12_1 = EfloraSources.fm_12();
196 static final URI fmSource13 = EfloraSources.fm_13();
197 static final URI fmSource14 = EfloraSources.fm_14();
198 static final URI fmSource15 = EfloraSources.fm_15();
199 static final URI fmSource16 = EfloraSources.fm_16();
200 static final URI fmSource17 = EfloraSources.fm_17();
201 static final URI fmSource17_1 = EfloraSources.fm_17_1();
202 static final URI fmSource17_2 = EfloraSources.fm_17_2();
203 static final URI fmSource18 = EfloraSources.fm_18();
204 static final URI fmSource19 = EfloraSources.fm_19();
205 static final URI fmSource20 = EfloraSources.fm_20();
206 static final URI fmSource21 = EfloraSources.fm_21();
207
208 static final URI fmSource_Ser2_01 = EfloraSources.fm_ser2_1();
209 static final URI fmSource_Ser2_02 = EfloraSources.fm_ser2_2();
210 static final URI fmSource_Ser2_03 = EfloraSources.fm_ser2_3();
211 static final URI fmSource_Ser2_04 = EfloraSources.fm_ser2_4();
212
213 private final boolean h2ForCheck = true;
214
215 static final boolean reuseState = true; //when running multiple imports
216
217 //feature tree uuid
218 public static final UUID featureTreeUuid = UUID.fromString("168df0c6-6429-484c-b26f-ded1f7e44bd9");
219 private static final String featureTreeTitle = "Flora Malesiana Presentation Feature Tree";
220
221 //classification
222 static final UUID classificationUuid = UUID.fromString("ca4e4bcb-a1d1-4124-a358-a3d3c41dd450");
223 static final String classificationTitle = "Flora Malesiana";
224
225 //check - import
226 static CHECK check = CHECK.IMPORT_WITHOUT_CHECK;
227
228 static boolean doPrintKeys = false;
229
230 //taxa
231 static final boolean doTaxa = true;
232
233
234 private final boolean replaceStandardKeyTitles = false;
235
236 private final IIoObserver observer = new LoggingIoObserver();
237 private final Set<IIoObserver> observerList = new HashSet<IIoObserver>();
238
239
240 private void doImport(ICdmDataSource cdmDestination){
241 observerList.add(observer);
242 if (h2ForCheck && cdmDestination.getDatabaseType().equals(CdmDestinations.localH2().getDatabaseType())){
243 check = CHECK.CHECK_ONLY;
244 }
245
246 //make Source
247 // URI source = fmSource13_small;
248 URI source = null;
249
250 MarkupImportConfigurator markupConfig= MarkupImportConfigurator.NewInstance(source, cdmDestination);
251 markupConfig.setClassificationUuid(classificationUuid);
252 markupConfig.setClassificationName(classificationTitle);
253 markupConfig.setDoTaxa(doTaxa);
254 markupConfig.setCheck(check);
255 markupConfig.setDoPrintKeys(doPrintKeys);
256 markupConfig.setDbSchemaValidation(hbm2dll);
257 markupConfig.setObservers(observerList);
258 markupConfig.setReplaceStandardKeyTitles(replaceStandardKeyTitles);
259 markupConfig.setReuseExistingState(reuseState);
260
261 markupConfig.setSourceReference(getSourceReference("Flora Malesiana - Vol. 13"));
262
263 CdmDefaultImport<MarkupImportConfigurator> myImport = new CdmDefaultImport<MarkupImportConfigurator>();
264
265 //Vol04
266 doSource(includeVol04, fmSource04, "Flora Malesiana - vol. 4", markupConfig, myImport);
267 //Vol05
268 doSource(includeVol05, fmSource05, "Flora Malesiana - vol. 5", markupConfig, myImport);
269 //Vol06
270 doSource(includeVol06, fmSource06, "Flora Malesiana - vol. 6", markupConfig, myImport);
271 //Vol07_1
272 doSource(includeVol07_1, fmSource07_1, "Flora Malesiana - vol. 7, pt.1", markupConfig, myImport);
273 //Vol07_2
274 doSource(includeVol07_2, fmSource07_2, "Flora Malesiana - vol. 7, pt.2", markupConfig, myImport);
275 //Vol07_3
276 doSource(includeVol07_3_09_1, fmSource07_3_09_1, "Flora Malesiana - vol. 7, pt.3 and vol. 9 pt.1", markupConfig, myImport);
277 //Vol07_4
278 doSource(includeVol07_4, fmSource07_4, "Flora Malesiana - vol. 7, pt.4", markupConfig, myImport);
279
280 //Vol08_1
281 doSource(includeVol08_1, fmSource08_1, "Flora Malesiana - vol. 8, pt.1", markupConfig, myImport);
282
283 //Vol08_2
284 doSource(includeVol08_2, fmSource08_2, "Flora Malesiana - vol. 8, pt.2", markupConfig, myImport);
285
286 //Vol08_3
287 doSource(includeVol08_3, fmSource08_3, "Flora Malesiana - vol. 8, pt.3", markupConfig, myImport);
288
289 //Vol09
290 doSource(includeVol09, fmSource09, "Flora Malesiana - vol. 9", markupConfig, myImport);
291
292 //Vol10_1
293 doSource(includeVol10_1, fmSource10_1, "Flora Malesiana - vol. 10, pt.1", markupConfig, myImport);
294
295 //Vol10_2
296 doSource(includeVol10_2, fmSource10_2, "Flora Malesiana - vol. 10, pt.2", markupConfig, myImport);
297
298 //Vol10_3
299 doSource(includeVol10_3, fmSource10_3, "Flora Malesiana - vol. 10, pt.3", markupConfig, myImport);
300
301 //Vol10_4
302 doSource(includeVol10_4, fmSource10_4, "Flora Malesiana - vol. 10, pt.4", markupConfig, myImport);
303
304 //Vol11_1
305 doSource(includeVol11_1, fmSource11_1, "Flora Malesiana - vol. 11, pt.1", markupConfig, myImport);
306
307 //Vol11_2
308 doSource(includeVol11_2, fmSource11_2, "Flora Malesiana - vol. 11, pt.2", markupConfig, myImport);
309
310 //Vol11_3
311 doSource(includeVol11_3, fmSource11_3, "Flora Malesiana - vol. 11, pt.3", markupConfig, myImport);
312
313 //Vol12_1
314 doSource(includeVol12, fmSource12_1, "Flora Malesiana - vol. 12", markupConfig, myImport);
315
316 //Vol13_large
317 doSource(includeVol13, fmSource13, "Flora Malesiana - vol. 13", markupConfig, myImport);
318
319 //Vol14
320 doSource(includeVol14, fmSource14, "Flora Malesiana - vol. 14", markupConfig, myImport);
321
322 //Vol15
323 doSource(includeVol15, fmSource15, "Flora Malesiana - vol. 15", markupConfig, myImport);
324
325 //Vol16
326 doSource(includeVol16, fmSource16, "Flora Malesiana - vol. 16", markupConfig, myImport);
327
328 //Vol17, part1+2
329 doSource(includeVol17, fmSource17, "Flora Malesiana - vol. 17, part I and II", markupConfig, myImport);
330
331 // //Vol17, part1
332 // doSource(includeVol17_1, fmSource17_1, "Flora Malesiana - vol. 17, part I", markupConfig, myImport);
333 //
334 // //Vol17, part2
335 // doSource(includeVol17_2, fmSource17_2, "Flora Malesiana - vol. 17, part II", markupConfig, myImport);
336
337 //Vol18
338 doSource(includeVol18, fmSource18, "Flora Malesiana - vol. 18", markupConfig, myImport);
339
340 //Vol19
341 doSource(includeVol19, fmSource19, "Flora Malesiana - vol. 19", markupConfig, myImport);
342
343 //Vol20
344 doSource(includeVol20, fmSource20, "Flora Malesiana - vol. 20", markupConfig, myImport);
345
346 //Vol21
347 doSource(includeVol21, fmSource21, "Flora Malesiana - vol. 21", markupConfig, myImport);
348
349 //Vol_2_1
350 doSource(includeVol2_1, fmSource_Ser2_01, "Flora Malesiana - Ser.2, vol. 1", markupConfig, myImport);
351
352 //Vol_2_2
353 doSource(includeVol2_2, fmSource_Ser2_02, "Flora Malesiana - Ser.2, vol. 2", markupConfig, myImport);
354
355 //Vol_2_3
356 doSource(includeVol2_3, fmSource_Ser2_03, "Flora Malesiana - Ser.2, vol. 3", markupConfig, myImport);
357
358 //Vol_2_3
359 doSource(includeVol2_4, fmSource_Ser2_04, "Flora Malesiana - Ser.2, vol. 4", markupConfig, myImport);
360
361
362 makeAutomatedFeatureTree(myImport.getCdmAppController(), markupConfig.getState(),
363 featureTreeUuid, featureTreeTitle);
364
365 // makeGeoService();
366
367 TermTree<Feature> tree = makeFeatureNode(myImport.getCdmAppController().getTermService());
368 myImport.getCdmAppController().getTermTreeService().saveOrUpdate(tree);
369
370 //check keys
371 if (doPrintKeys){
372 TransactionStatus tx = myImport.getCdmAppController().startTransaction();
373 List<PolytomousKey> keys = myImport.getCdmAppController().getPolytomousKeyService().list(PolytomousKey.class, null, null, null, null);
374 for(PolytomousKey key : keys){
375 key.print(System.out);
376 System.out.println();
377 }
378 myImport.getCdmAppController().commitTransaction(tx);
379 }
380
381 }
382
383 private void doSource(boolean doInclude, URI source, String sourceTitle, MarkupImportConfigurator markupConfig,
384 CdmDefaultImport<MarkupImportConfigurator> myImport) {
385 if (doInclude){
386 System.out.println("\nStart import from ("+ source.toString() + ") ...");
387 markupConfig.setSource(source);
388 markupConfig.setSourceReference(getSourceReference(sourceTitle));
389 myImport.invoke(markupConfig);
390 System.out.println("End import from ("+ source.toString() + ")...");
391 }
392 }
393
394 private Reference getSourceReference(String string) {
395 Reference result = ReferenceFactory.newGeneric();
396 result.setTitleCache(string, true);
397 return result;
398 }
399
400 private TermTree<Feature> makeFeatureNode(ITermService service){
401 FloraMalesianaTransformer transformer = new FloraMalesianaTransformer();
402
403 TermTree<Feature> result = TermTree.NewFeatureInstance(UUID.randomUUID());
404 result.setTitleCache("Flora Malesiana Presentation Feature Tree - Old", true);
405 TermNode<Feature> root = result.getRoot();
406
407 TermNode<Feature> newNode = root.addChild(Feature.DESCRIPTION());
408
409 addFeatureNodesByStringList(descriptionFeatureList, newNode, transformer, service);
410
411 addFeatureNodesByStringList(generellDescriptionsUpToAnatomyList, root, transformer, service);
412 newNode = root.addChild(Feature.ANATOMY()); //not sure if this is correct, but it looked like the node was orphaned before
413 addFeatureNodesByStringList(anatomySubfeatureList, newNode, transformer, service);
414
415 newNode = addFeatureNodesByStringList(generellDescriptionsFromAnatomyToPhytoChemoList, root, transformer, service);
416 addFeatureNodesByStringList(phytoChemoSubFeaturesList, newNode, transformer, service);
417
418 newNode = addFeatureNodesByStringList(generellDescriptionsFromPhytoChemoList, root, transformer, service);
419
420
421 newNode = root.addChild(Feature.DISTRIBUTION());
422
423 newNode = root.addChild(Feature.ECOLOGY());
424 addFeatureNodesByStringList(habitatEcologyList, root, transformer, service);
425
426 newNode = root.addChild(Feature.USES());
427
428 addFeatureNodesByStringList(chomosomesList, root, transformer, service);
429
430 newNode = root.addChild(Feature.CITATION());
431
432 return result;
433 }
434
435 private static String [] chomosomesList = new String[]{
436 "Chromosomes",
437 };
438
439 private static String [] habitatEcologyList = new String[]{
440 "Habitat",
441 "Habitat & Ecology"
442 };
443
444 private static String [] generellDescriptionsUpToAnatomyList = new String[]{
445 "Fossils",
446 "Morphology and anatomy",
447 "Morphology",
448 "Vegetative morphology and anatomy",
449 };
450
451 private static String [] anatomySubfeatureList = new String[]{
452 "Leaf anatomy",
453 "Wood anatomy"
454 };
455
456 private static String [] generellDescriptionsFromAnatomyToPhytoChemoList = new String[]{
457 "Flower morphology",
458 "Palynology",
459 "Pollination",
460 "Pollen morphology",
461 "embryology",
462 "cytology",
463 "Life cycle",
464 "Fruits and embryology",
465 "Dispersal",
466 "Chromosome numbers",
467 "Phytochemistry and Chemotaxonomy",
468 };
469
470 private static String [] phytoChemoSubFeaturesList = new String[]{
471 "Alkaloids",
472 "Iridoid glucosides",
473 "Leaf phenolics",
474 "Storage products of seeds",
475 "Aluminium",
476 "Chemotaxonomy",
477 };
478
479 private static String [] generellDescriptionsFromPhytoChemoList = new String[]{
480 "Phytochemistry",
481 "Taxonomy",
482 "history",
483 "cultivation",
484 "Notes"
485 };
486
487 private static String [] descriptionFeatureList = new String[]{
488 "lifeform",
489 "Bark",
490 //new
491 "wood",
492 "Indumentum",
493 "endophytic body",
494 "flowering buds",
495 "Branchlets",
496 "Branches",
497 "Branch",
498 "Flowering branchlets",
499 "Trees",
500 "Twigs",
501 "stem",
502 "Stems",
503 "stem leaves",
504 "Leaves",
505 "flower-bearing stems",
506 "Petiole",
507 "Petiolules",
508 "Leaflets",
509 "Thyrsus",
510 "Thyrses",
511 "Inflorescences",
512 "Inflorescence",
513 "Young inflorescences",
514 "Male inflorescences",
515 "Female inflorescences",
516 "Bracts",
517 "Pedicels",
518 "flowering buds",
519 "scales",
520 "Buds",
521 "Flowers",
522 "Flower",
523 "Flowering",
524 "Stigma",
525 "perianth",
526 "Sepals",
527 "Sepal",
528 "Outer Sepals",
529 "Axillary",
530 "cymes",
531 "Calyx",
532 "Petal",
533 "Petals",
534 "perigone",
535 "perigone lobes",
536 "perigone tube",
537 "Disc",
538 "corolla",
539 "Stamens",
540 "Staminodes",
541 "Ovary",
542 "Anthers",
543 "anther",
544 "Pistil",
545 "Pistillode",
546 "Ovules",
547 "androecium",
548 "gynoecium",
549 "Filaments",
550 "Style",
551 "annulus",
552 "female flowers",
553 "Male flowers",
554 "Female",
555 "Infructescences", //order not consistent (sometimes before "Flowers")
556 "Fruit",
557 "Fruits",
558 "fruiting axes",
559 "drupes",
560 "Arillode",
561 "seed",
562 "Seeds",
563 "Seedling",
564 "flower tube",
565 "nutlets",
566 "pollen",
567 "secondary xylem",
568 "chromosome number",
569
570 "figure",
571 "fig",
572 "figs",
573 };
574
575 public TermNode<Feature> addFeatureNodesByStringList(String[] featureStringList,
576 TermNode<Feature> root, IInputTransformer transformer, ITermService termService){
577 TermNode<Feature> lastChild = null;
578 try {
579 for (String featureString : featureStringList){
580 UUID featureUuid;
581 featureUuid = transformer.getFeatureUuid(featureString);
582 Feature feature = (Feature)termService.find(featureUuid);
583 if (feature != null){
584 root.addChild(feature);
585 }
586 }
587
588 } catch (UndefinedTransformerMethodException e) {
589 logger.error("getFeatureUuid is not implemented in transformer. Features could not be added");
590 }
591 return lastChild;
592 }
593
594 public static void main(String[] args) {
595 FloraMalesianaActivator me = new FloraMalesianaActivator();
596 me.doImport(cdmDestination);
597 System.exit(0);
598 }
599 }