Project

General

Profile

Download (20.2 KB) Statistics
| Branch: | Revision:
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.log4j.Logger;
17
import org.springframework.transaction.TransactionStatus;
18

    
19
import eu.etaxonomy.cdm.api.service.ITermService;
20
import eu.etaxonomy.cdm.common.URI;
21
import eu.etaxonomy.cdm.database.DbSchemaValidation;
22
import eu.etaxonomy.cdm.database.ICdmDataSource;
23
import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
24
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK;
25
import eu.etaxonomy.cdm.io.common.events.IIoObserver;
26
import eu.etaxonomy.cdm.io.common.events.LoggingIoObserver;
27
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
28
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException;
29
import eu.etaxonomy.cdm.io.eflora.floraMalesiana.FloraMalesianaTransformer;
30
import eu.etaxonomy.cdm.io.markup.MarkupImportConfigurator;
31
import eu.etaxonomy.cdm.model.description.Feature;
32
import eu.etaxonomy.cdm.model.description.PolytomousKey;
33
import eu.etaxonomy.cdm.model.reference.Reference;
34
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
35
import eu.etaxonomy.cdm.model.term.TermNode;
36
import eu.etaxonomy.cdm.model.term.TermTree;
37

    
38
/**
39
 * @author a.mueller
40
 * @since 20.06.2008
41
 */
42
public class FloraMalesianaActivator extends EfloraActivatorBase {
43
	private static final Logger logger = Logger.getLogger(FloraMalesianaActivator.class);
44

    
45
	//database validation status (create, update, validate ...)
46
	static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;
47

    
48
//	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_malesiana_preview();
49
//	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_malesiana_production();
50
	static final ICdmDataSource cdmDestination = CdmDestinations.localH2();
51
//	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql();
52
//	static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql_test();
53

    
54
	private final boolean includeBase = false;
55

    
56
	//5880 / 121834
57
	//2 footnote issues
58
	//habitat: 6 syso, + ???
59
	private final boolean includeVol04 = includeBase;
60
	//6258  / 110625
61
	//11 sysos, + ??
62
	private final boolean includeVol05 = includeBase;
63
	//8097   / 177845
64
	//2 sysos (<sub>
65
	//102 keys
66
    private final boolean includeVol06 = includeBase;
67

    
68
	//2283 /49700
69
	//no syso, 120 lifecycle, few of them references! and figureRef?
70
	private final boolean includeVol07_1 = includeBase;
71
	//1640
72
	//keys: 1 nothofagus; 4 quercus
73
//12 syso, no uncovered, >>100 lifecycle, >10 references, figureRefs?
74
    private final boolean includeVol07_2 = includeBase;
75
    //4225
76
 //430 syso (10 subheadings),no uncovered, 43 figureRef, references and lifecycle
77
    private final boolean includeVol07_3_09_1 = includeBase;
78
    //561   /   12440
79
    //no syso, 14 lifecycle, 1 reference
80
    private final boolean includeVol07_4 = includeBase;
81

    
82
    //223   /   5986
83
    //no syso, 5 lifecycle
84
    private final boolean includeVol08_1 = includeBase;
85
    //2830   /   53189
86
    //keys: 23 S. Moore -> Symplocos Moore (handle manually before import)
87
 //4syso, <= uncovered, <150 lifecycle, figureRef and references
88
    private final boolean includeVol08_2 = includeBase;
89
    //2912    /   54235
90
    //no syso
91
	private final boolean includeVol08_3 = includeBase;
92
	//4641    /   94566
93
 //184 syso!! (30 subheadings), <=3 uncovered, <50 lifecycle and figureRef
94
	private final boolean includeVol09 = includeBase;
95
	//845   / 19098
96
	//no syso, <= 5 uncovered, <=50 lifecycle
97
	private final boolean includeVol10_1 = includeBase;
98
	//1211  / 32334
99
//6 syso, <=3 uncovered, <50 lifecycle
100
    private final boolean includeVol10_2 = includeBase;
101
    //1993   /  49034
102
//2 syso habitats, 2 fast, many lifcycle
103
	private final boolean includeVol10_3 = includeBase;
104
	//533    /   13553
105
	//no syso, 1 uncovered, 1 figureRef, 10 lifecycle
106
	private final boolean includeVol10_4 = includeBase;
107
	//1529     /  36379
108
	//keys: 1 manually (a sect. botrycephalae)
109
	//no syso, <= 10 uncovered, < 100 lifecycle
110
	private final boolean includeVol11_1 = includeBase;
111
	//1271   /  24775
112
	//keys: 2 cultivar groups (a cultivar group aggregatum; b cultivar group common onion)
113
	//no syso, 1 uncovered, 1 lifecycle, 2 references
114
	private final boolean includeVol11_2 = includeBase;
115
	//4582    /  52747
116
	//1 empty "[]"
117
	//no syso habitat, <10 uncovered, > 100 lifecycles
118
	private final boolean includeVol11_3 = includeBase;
119
	//6135   /   116737
120
	//keys: 10 apostrophs
121
	//habitat: no syso, 200 - 400 uncovered, different types
122
	private final boolean includeVol12 = includeBase;
123
	//2865    /   43764
124
	//keys: 1 manual (Loranthaceae)
125
	//no syso, 1 uncovered habitat
126
	private final boolean includeVol13 = includeBase;
127
	//4843   /   55501
128
	//no syso habitat, 100-150 uncovered, most of them flowering and fruiting lifecycle
129
	private final boolean includeVol14 = includeBase;
130
	//1775   /   16415
131
	//no syso, 5 uncovered, 2 of them epiphytic
132
	private final boolean includeVol15 = includeBase;
133
	//1471   /   22049
134
	//no syso, <= 60 uncovered, very different types
135
	private final boolean includeVol16 = includeBase;
136

    
137
	//4113    /   116956
138
	//no syso, medium # uncovered habitat (some or)
139
	private final boolean includeVol17 = includeBase;
140
	//6422    /   71151
141
	//no syso habitat, <20 uncovered
142
	private final boolean includeVol18 = includeBase;
143
	//2612    /   27663
144
    //no syso habitat, <= 50 uncovered, mostly untagged lifecycle, some errors
145
    private final boolean includeVol19 = includeBase;
146
    //563    /    5866
147
    //no syso, < 20 uncovered, mostly untagged lifecycle
148
	private final boolean includeVol20 = includeBase;
149
	//1735     /   19469
150
	//no syso, no covered, medium # lifecycle and very few references
151
	private final boolean includeVol21 = ! includeBase;
152

    
153
//Ser II
154
	//5798  / 123.627
155
	//2 manually, 9 non standard(?), 2 hybrids(?)
156
	//no syso habitat, only figureRef and references as habitat issues
157
    private final boolean includeVol2_1 = includeBase;
158
    //1054   / 25100
159
    //2 hybrid formulas
160
    //no syso, no habitat issue
161
    private final boolean includeVol2_2 = includeBase;
162
    //2382  / 52100
163
    //no syso, 10-15 uncovered, 2 unexpected attributes: extra
164
	private final boolean includeVol2_3 = includeBase;
165
	//1045  / 12240
166
	//no syso, 1 <br>
167
	private final boolean includeVol2_4 = includeBase;
168

    
169

    
170
	static final URI fmSource04 = EfloraSources.fm_04();
171
	static final URI fmSource05 = EfloraSources.fm_05();
172
	static final URI fmSource06 = EfloraSources.fm_06();
173
    static final URI fmSource07_1 = EfloraSources.fm_07_1();
174
    static final URI fmSource07_2 = EfloraSources.fm_07_2();
175
    static final URI fmSource07_3_09_1 = EfloraSources.fm_07_3_09_1();
176
    static final URI fmSource07_4 = EfloraSources.fm_07_4();
177

    
178
    static final URI fmSource08_1 = EfloraSources.fm_08_1();
179
    static final URI fmSource08_2 = EfloraSources.fm_08_2();
180
    static final URI fmSource08_3 = EfloraSources.fm_08_3();
181

    
182
    static final URI fmSource09 = EfloraSources.fm_09();
183

    
184
    static final URI fmSource10_1 = EfloraSources.fm_10_1();
185
    static final URI fmSource10_2 = EfloraSources.fm_10_2();
186
    static final URI fmSource10_3 = EfloraSources.fm_10_3();
187
    static final URI fmSource10_4 = EfloraSources.fm_10_4();
188

    
189

    
190
    static final URI fmSource11_1 = EfloraSources.fm_11_1();
191
    static final URI fmSource11_2 = EfloraSources.fm_11_2();
192
    static final URI fmSource11_3 = EfloraSources.fm_11_3();
193
    static final URI fmSource12_1 = EfloraSources.fm_12();
194
    static final URI fmSource13 = EfloraSources.fm_13();
195
    static final URI fmSource14 = EfloraSources.fm_14();
196
    static final URI fmSource15 = EfloraSources.fm_15();
197
    static final URI fmSource16 = EfloraSources.fm_16();
198
    static final URI fmSource17 = EfloraSources.fm_17();
199
    static final URI fmSource17_1 = EfloraSources.fm_17_1();
200
    static final URI fmSource17_2 = EfloraSources.fm_17_2();
201
    static final URI fmSource18 = EfloraSources.fm_18();
202
    static final URI fmSource19 = EfloraSources.fm_19();
203
    static final URI fmSource20 = EfloraSources.fm_20();
204
    static final URI fmSource21 = EfloraSources.fm_21();
205

    
206
    static final URI fmSource_Ser2_01 = EfloraSources.fm_ser2_1();
207
    static final URI fmSource_Ser2_02 = EfloraSources.fm_ser2_2();
208
    static final URI fmSource_Ser2_03 = EfloraSources.fm_ser2_3();
209
    static final URI fmSource_Ser2_04 = EfloraSources.fm_ser2_4();
210

    
211
	private final boolean h2ForCheck = true;
212

    
213
	static final boolean reuseState = true;  //when running multiple imports
214

    
215
	//feature tree uuid
216
	public static final UUID featureTreeUuid = UUID.fromString("168df0c6-6429-484c-b26f-ded1f7e44bd9");
217
	private static final String featureTreeTitle = "Flora Malesiana Presentation Feature Tree";
218

    
219
	//classification
220
	static final UUID classificationUuid = UUID.fromString("ca4e4bcb-a1d1-4124-a358-a3d3c41dd450");
221
	static final String classificationTitle = "Flora Malesiana";
222

    
223
	//check - import
224
	static CHECK check = CHECK.IMPORT_WITHOUT_CHECK;
225

    
226
	static boolean doPrintKeys = false;
227

    
228
	//taxa
229
	static final boolean doTaxa = true;
230

    
231

    
232
	private final boolean replaceStandardKeyTitles = false;
233

    
234
	private final IIoObserver observer = new LoggingIoObserver();
235
	private final Set<IIoObserver> observerList = new HashSet<IIoObserver>();
236

    
237

    
238
	private void doImport(ICdmDataSource cdmDestination){
239
		observerList.add(observer);
240
		if (h2ForCheck && cdmDestination.getDatabaseType().equals(CdmDestinations.localH2().getDatabaseType())){
241
			check = CHECK.CHECK_ONLY;
242
		}
243

    
244
		//make Source
245
//		URI source = fmSource13_small;
246
		URI source = null;
247

    
248
		MarkupImportConfigurator markupConfig= MarkupImportConfigurator.NewInstance(source, cdmDestination);
249
		markupConfig.setClassificationUuid(classificationUuid);
250
		markupConfig.setClassificationName(classificationTitle);
251
		markupConfig.setDoTaxa(doTaxa);
252
		markupConfig.setCheck(check);
253
		markupConfig.setDoPrintKeys(doPrintKeys);
254
		markupConfig.setDbSchemaValidation(hbm2dll);
255
		markupConfig.setObservers(observerList);
256
		markupConfig.setReplaceStandardKeyTitles(replaceStandardKeyTitles);
257
		markupConfig.setReuseExistingState(reuseState);
258

    
259
		markupConfig.setSourceReference(getSourceReference("Flora Malesiana - Vol. 13"));
260

    
261
		CdmDefaultImport<MarkupImportConfigurator> myImport = new CdmDefaultImport<MarkupImportConfigurator>();
262

    
263
        //Vol04
264
        doSource(includeVol04, fmSource04, "Flora Malesiana - vol. 4", markupConfig, myImport);
265
        //Vol05
266
        doSource(includeVol05, fmSource05, "Flora Malesiana - vol. 5", markupConfig, myImport);
267
        //Vol06
268
        doSource(includeVol06, fmSource06, "Flora Malesiana - vol. 6", markupConfig, myImport);
269
        //Vol07_1
270
        doSource(includeVol07_1, fmSource07_1, "Flora Malesiana - vol. 7, pt.1", markupConfig, myImport);
271
        //Vol07_2
272
        doSource(includeVol07_2, fmSource07_2, "Flora Malesiana - vol. 7, pt.2", markupConfig, myImport);
273
        //Vol07_3
274
        doSource(includeVol07_3_09_1, fmSource07_3_09_1, "Flora Malesiana - vol. 7, pt.3 and vol. 9 pt.1", markupConfig, myImport);
275
        //Vol07_4
276
        doSource(includeVol07_4, fmSource07_4, "Flora Malesiana - vol. 7, pt.4", markupConfig, myImport);
277

    
278
		//Vol08_1
279
		doSource(includeVol08_1, fmSource08_1, "Flora Malesiana - vol. 8, pt.1", markupConfig, myImport);
280

    
281
		//Vol08_2
282
		doSource(includeVol08_2, fmSource08_2, "Flora Malesiana - vol. 8, pt.2", markupConfig, myImport);
283

    
284
		//Vol08_3
285
		doSource(includeVol08_3, fmSource08_3, "Flora Malesiana - vol. 8, pt.3", markupConfig, myImport);
286

    
287
		//Vol09
288
        doSource(includeVol09, fmSource09, "Flora Malesiana - vol. 9", markupConfig, myImport);
289

    
290
		//Vol10_1
291
		doSource(includeVol10_1, fmSource10_1, "Flora Malesiana - vol. 10, pt.1", markupConfig, myImport);
292

    
293
		//Vol10_2
294
		doSource(includeVol10_2, fmSource10_2, "Flora Malesiana - vol. 10, pt.2", markupConfig, myImport);
295

    
296
		//Vol10_3
297
		doSource(includeVol10_3, fmSource10_3, "Flora Malesiana - vol. 10, pt.3", markupConfig, myImport);
298

    
299
		//Vol10_4
300
		doSource(includeVol10_4, fmSource10_4, "Flora Malesiana - vol. 10, pt.4", markupConfig, myImport);
301

    
302
		//Vol11_1
303
		doSource(includeVol11_1, fmSource11_1, "Flora Malesiana - vol. 11, pt.1", markupConfig, myImport);
304

    
305
		//Vol11_2
306
		doSource(includeVol11_2, fmSource11_2, "Flora Malesiana - vol. 11, pt.2", markupConfig, myImport);
307

    
308
		//Vol11_3
309
		doSource(includeVol11_3, fmSource11_3, "Flora Malesiana - vol. 11, pt.3", markupConfig, myImport);
310

    
311
		//Vol12_1
312
		doSource(includeVol12, fmSource12_1, "Flora Malesiana - vol. 12", markupConfig, myImport);
313

    
314
		//Vol13_large
315
		doSource(includeVol13, fmSource13, "Flora Malesiana - vol. 13", markupConfig, myImport);
316

    
317
		//Vol14
318
		doSource(includeVol14, fmSource14, "Flora Malesiana - vol. 14", markupConfig, myImport);
319

    
320
		//Vol15
321
		doSource(includeVol15, fmSource15, "Flora Malesiana - vol. 15", markupConfig, myImport);
322

    
323
		//Vol16
324
		doSource(includeVol16, fmSource16, "Flora Malesiana - vol. 16", markupConfig, myImport);
325

    
326
		//Vol17, part1+2
327
        doSource(includeVol17, fmSource17, "Flora Malesiana - vol. 17, part I and II", markupConfig, myImport);
328

    
329
//		//Vol17, part1
330
//		doSource(includeVol17_1, fmSource17_1, "Flora Malesiana - vol. 17, part I", markupConfig, myImport);
331
//
332
//		//Vol17, part2
333
//		doSource(includeVol17_2, fmSource17_2, "Flora Malesiana - vol. 17, part II", markupConfig, myImport);
334

    
335
		//Vol18
336
		doSource(includeVol18, fmSource18, "Flora Malesiana - vol. 18", markupConfig, myImport);
337

    
338
		//Vol19
339
		doSource(includeVol19, fmSource19, "Flora Malesiana - vol. 19", markupConfig, myImport);
340

    
341
		//Vol20
342
		doSource(includeVol20, fmSource20, "Flora Malesiana - vol. 20", markupConfig, myImport);
343

    
344
		//Vol21
345
		doSource(includeVol21, fmSource21, "Flora Malesiana - vol. 21", markupConfig, myImport);
346

    
347
        //Vol_2_1
348
        doSource(includeVol2_1, fmSource_Ser2_01, "Flora Malesiana - Ser.2, vol. 1", markupConfig, myImport);
349

    
350
		//Vol_2_2
351
		doSource(includeVol2_2, fmSource_Ser2_02, "Flora Malesiana - Ser.2, vol. 2", markupConfig, myImport);
352

    
353
		//Vol_2_3
354
		doSource(includeVol2_3, fmSource_Ser2_03, "Flora Malesiana - Ser.2, vol. 3", markupConfig, myImport);
355

    
356
		//Vol_2_3
357
		doSource(includeVol2_4, fmSource_Ser2_04, "Flora Malesiana - Ser.2, vol. 4", markupConfig, myImport);
358

    
359

    
360
		makeAutomatedFeatureTree(myImport.getCdmAppController(), markupConfig.getState(),
361
				featureTreeUuid, featureTreeTitle);
362

    
363
//		makeGeoService();
364

    
365
		TermTree<Feature> tree = makeFeatureNode(myImport.getCdmAppController().getTermService());
366
		myImport.getCdmAppController().getTermTreeService().saveOrUpdate(tree);
367

    
368
		//check keys
369
		if (doPrintKeys){
370
			TransactionStatus tx = myImport.getCdmAppController().startTransaction();
371
			List<PolytomousKey> keys = myImport.getCdmAppController().getPolytomousKeyService().list(PolytomousKey.class, null, null, null, null);
372
			for(PolytomousKey key : keys){
373
				key.print(System.out);
374
				System.out.println();
375
			}
376
			myImport.getCdmAppController().commitTransaction(tx);
377
		}
378

    
379
	}
380

    
381
	private void doSource(boolean doInclude, URI source, String sourceTitle, MarkupImportConfigurator markupConfig,
382
			CdmDefaultImport<MarkupImportConfigurator> myImport) {
383
		if (doInclude){
384
			System.out.println("\nStart import from ("+ source.toString() + ") ...");
385
			markupConfig.setSource(source);
386
			markupConfig.setSourceReference(getSourceReference(sourceTitle));
387
			myImport.invoke(markupConfig);
388
			System.out.println("End import from ("+ source.toString() + ")...");
389
		}
390
	}
391

    
392
	private Reference getSourceReference(String string) {
393
		Reference result = ReferenceFactory.newGeneric();
394
		result.setTitleCache(string, true);
395
		return result;
396
	}
397

    
398
	private TermTree<Feature> makeFeatureNode(ITermService service){
399
		FloraMalesianaTransformer transformer = new FloraMalesianaTransformer();
400

    
401
		TermTree<Feature> result = TermTree.NewFeatureInstance(UUID.randomUUID());
402
		result.setTitleCache("Flora Malesiana Presentation Feature Tree - Old", true);
403
		TermNode<Feature> root = result.getRoot();
404

    
405
		TermNode<Feature> newNode = root.addChild(Feature.DESCRIPTION());
406

    
407
		addFeatureNodesByStringList(descriptionFeatureList, newNode, transformer, service);
408

    
409
		addFeatureNodesByStringList(generellDescriptionsUpToAnatomyList, root, transformer, service);
410
		newNode = root.addChild(Feature.ANATOMY());  //not sure if this is correct, but it looked like the node was orphaned before
411
		addFeatureNodesByStringList(anatomySubfeatureList, newNode, transformer, service);
412

    
413
		newNode = addFeatureNodesByStringList(generellDescriptionsFromAnatomyToPhytoChemoList, root, transformer, service);
414
		addFeatureNodesByStringList(phytoChemoSubFeaturesList, newNode, transformer, service);
415

    
416
		newNode = addFeatureNodesByStringList(generellDescriptionsFromPhytoChemoList, root, transformer, service);
417

    
418

    
419
		newNode = root.addChild(Feature.DISTRIBUTION());
420

    
421
		newNode = root.addChild(Feature.ECOLOGY());
422
		addFeatureNodesByStringList(habitatEcologyList, root, transformer, service);
423

    
424
		newNode = root.addChild(Feature.USES());
425

    
426
		addFeatureNodesByStringList(chomosomesList, root, transformer, service);
427

    
428
		newNode = root.addChild(Feature.CITATION());
429

    
430
		return result;
431
	}
432

    
433
	private static String [] chomosomesList = new String[]{
434
		"Chromosomes",
435
	};
436

    
437
	private static String [] habitatEcologyList = new String[]{
438
		"Habitat",
439
		"Habitat & Ecology"
440
	};
441

    
442
	private static String [] generellDescriptionsUpToAnatomyList = new String[]{
443
		"Fossils",
444
		"Morphology and anatomy",
445
		"Morphology",
446
		"Vegetative morphology and anatomy",
447
	};
448

    
449
	private static String [] anatomySubfeatureList = new String[]{
450
		"Leaf anatomy",
451
		"Wood anatomy"
452
	};
453

    
454
	private static String [] generellDescriptionsFromAnatomyToPhytoChemoList = new String[]{
455
		"Flower morphology",
456
		"Palynology",
457
		"Pollination",
458
		"Pollen morphology",
459
		"embryology",
460
		"cytology",
461
		"Life cycle",
462
		"Fruits and embryology",
463
		"Dispersal",
464
		"Chromosome numbers",
465
		"Phytochemistry and Chemotaxonomy",
466
	};
467

    
468
	private static String [] phytoChemoSubFeaturesList = new String[]{
469
		"Alkaloids",
470
		"Iridoid glucosides",
471
		"Leaf phenolics",
472
		"Storage products of seeds",
473
		"Aluminium",
474
		"Chemotaxonomy",
475
	};
476

    
477
	private static String [] generellDescriptionsFromPhytoChemoList = new String[]{
478
		"Phytochemistry",
479
		"Taxonomy",
480
		"history",
481
		"cultivation",
482
		"Notes"
483
	};
484

    
485
	private static String [] descriptionFeatureList = new String[]{
486
		"lifeform",
487
		"Bark",
488
		//new
489
		"wood",
490
		"Indumentum",
491
		"endophytic body",
492
		"flowering buds",
493
		"Branchlets",
494
		"Branches",
495
		"Branch",
496
		"Flowering branchlets",
497
		"Trees",
498
		"Twigs",
499
		"stem",
500
		"Stems",
501
		"stem leaves",
502
		"Leaves",
503
		"flower-bearing stems",
504
		"Petiole",
505
		"Petiolules",
506
		"Leaflets",
507
		"Thyrsus",
508
		"Thyrses",
509
		"Inflorescences",
510
		"Inflorescence",
511
		"Young inflorescences",
512
		"Male inflorescences",
513
		"Female inflorescences",
514
		"Bracts",
515
		"Pedicels",
516
		"flowering buds",
517
		"scales",
518
		"Buds",
519
		"Flowers",
520
		"Flower",
521
		"Flowering",
522
		"Stigma",
523
		"perianth",
524
		"Sepals",
525
		"Sepal",
526
		"Outer Sepals",
527
		"Axillary",
528
		"cymes",
529
		"Calyx",
530
		"Petal",
531
		"Petals",
532
		"perigone",
533
		"perigone lobes",
534
		"perigone tube",
535
		"Disc",
536
		"corolla",
537
		"Stamens",
538
		"Staminodes",
539
		"Ovary",
540
		"Anthers",
541
		"anther",
542
		"Pistil",
543
		"Pistillode",
544
		"Ovules",
545
		"androecium",
546
		"gynoecium",
547
		"Filaments",
548
		"Style",
549
		"annulus",
550
		"female flowers",
551
		"Male flowers",
552
		"Female",
553
		"Infructescences",    //order not consistent (sometimes before "Flowers")
554
		"Fruit",
555
		"Fruits",
556
		"fruiting axes",
557
		"drupes",
558
		"Arillode",
559
		"seed",
560
		"Seeds",
561
		"Seedling",
562
		"flower tube",
563
		"nutlets",
564
		"pollen",
565
		"secondary xylem",
566
		"chromosome number",
567

    
568
		"figure",
569
		"fig",
570
		"figs",
571
	};
572

    
573
	public TermNode<Feature> addFeatureNodesByStringList(String[] featureStringList,
574
	        TermNode<Feature> root, IInputTransformer transformer, ITermService termService){
575
	    TermNode<Feature> lastChild = null;
576
		try {
577
			for (String featureString : featureStringList){
578
				UUID featureUuid;
579
				featureUuid = transformer.getFeatureUuid(featureString);
580
				Feature feature = (Feature)termService.find(featureUuid);
581
				if (feature != null){
582
					root.addChild(feature);
583
				}
584
			}
585

    
586
		} catch (UndefinedTransformerMethodException e) {
587
			logger.error("getFeatureUuid is not implemented in transformer. Features could not be added");
588
		}
589
		return lastChild;
590
	}
591

    
592
	public static void main(String[] args) {
593
		FloraMalesianaActivator me = new FloraMalesianaActivator();
594
		me.doImport(cdmDestination);
595
		System.exit(0);
596
	}
597
}
(10-10/15)