Revision 8f2ee187
Added by Andreas Müller over 12 years ago
.gitattributes | ||
---|---|---|
29 | 29 |
app-import/src/main/java/eu/etaxonomy/cdm/app/cyprus/CyprusActivator.java -text |
30 | 30 |
app-import/src/main/java/eu/etaxonomy/cdm/app/cyprus/CyprusSpecimenActivator.java -text |
31 | 31 |
app-import/src/main/java/eu/etaxonomy/cdm/app/dwca/DwcaExportActivator.java -text |
32 |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/CentralAfricaChecklistActivator.java -text |
|
33 |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/CentralAfricaEricaceaeActivator.java -text |
|
34 |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/CentralAfricaFernsActivator.java -text |
|
35 |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/EfloraSources.java -text |
|
36 |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/FloraMalesianaActivator.java -text |
|
37 |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/FloraMalesianaVol13Activator.java -text |
|
38 | 32 |
app-import/src/main/java/eu/etaxonomy/cdm/app/excelImport/distribution/CichorieaeDistributionActivator.java -text |
39 | 33 |
app-import/src/main/java/eu/etaxonomy/cdm/app/excelImport/taxa/NormalExplicitActivator.java -text |
40 | 34 |
app-import/src/main/java/eu/etaxonomy/cdm/app/excelImport/taxa/UseSummaryActivator.java -text |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/CentralAfricaChecklistActivator.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 |
|
|
10 |
package eu.etaxonomy.cdm.app.eflora; |
|
11 |
|
|
12 |
import java.util.UUID; |
|
13 |
|
|
14 |
import org.apache.log4j.Logger; |
|
15 |
|
|
16 |
import eu.etaxonomy.cdm.app.common.CdmDestinations; |
|
17 |
import eu.etaxonomy.cdm.app.common.CdmImportSources; |
|
18 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
|
19 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
|
20 |
import eu.etaxonomy.cdm.io.common.CdmDefaultImport; |
|
21 |
import eu.etaxonomy.cdm.io.common.Source; |
|
22 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK; |
|
23 |
import eu.etaxonomy.cdm.io.eflora.centralAfrica.checklist.CentralAfricaChecklistImportConfigurator; |
|
24 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
25 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
|
26 |
|
|
27 |
/** |
|
28 |
* @author a.mueller |
|
29 |
* @created 20.06.2008 |
|
30 |
* @version 1.0 |
|
31 |
*/ |
|
32 |
public class CentralAfricaChecklistActivator { |
|
33 |
@SuppressWarnings("unused") |
|
34 |
private static final Logger logger = Logger.getLogger(CentralAfricaChecklistActivator.class); |
|
35 |
|
|
36 |
//database validation status (create, update, validate ...) |
|
37 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.VALIDATE; |
|
38 |
static final Source mySource = CdmImportSources.AFRICA_CHECKLIST_ACCESS(); |
|
39 |
|
|
40 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_andreasM3(); |
|
41 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_central_africa_preview(); |
|
42 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_central_africa_production(); |
|
43 |
static final ICdmDataSource cdmDestination = CdmDestinations.localH2(); |
|
44 |
|
|
45 |
int recordsPerTransaction = 1000; |
|
46 |
|
|
47 |
//feature tree uuid |
|
48 |
public static final UUID featureTreeUuid = UUID.fromString("ebe558b5-d04d-41d5-83d9-b61c56e6e34a"); |
|
49 |
|
|
50 |
public static final String sourceReference = "Flora of Central Africa - Checklist"; |
|
51 |
|
|
52 |
private UUID uuidGenevaReference = UUID.fromString("cf3fd13d-6cad-430c-ab70-7ea841b7159f"); |
|
53 |
|
|
54 |
private String genevaReferenceTitle = "Geneva Database"; |
|
55 |
|
|
56 |
//classification |
|
57 |
public static final UUID classificationUuid = UUID.fromString("ce1d035a-79a9-4a3a-95bf-26641ecb4fbe"); |
|
58 |
|
|
59 |
//check - import |
|
60 |
static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK; |
|
61 |
|
|
62 |
//taxa |
|
63 |
static final boolean doTaxa = true; |
|
64 |
|
|
65 |
private void doImport(ICdmDataSource cdmDestination){ |
|
66 |
|
|
67 |
//make Source |
|
68 |
Source source = mySource; |
|
69 |
|
|
70 |
CentralAfricaChecklistImportConfigurator config= CentralAfricaChecklistImportConfigurator.NewInstance(source, cdmDestination); |
|
71 |
config.setClassificationUuid(classificationUuid); |
|
72 |
config.setDoTaxa(doTaxa); |
|
73 |
config.setCheck(check); |
|
74 |
config.setDbSchemaValidation(hbm2dll); |
|
75 |
config.setRecordsPerTransaction(recordsPerTransaction); |
|
76 |
config.setGenevaReferenceTitle(genevaReferenceTitle); |
|
77 |
config.setUuidGenevaReference(uuidGenevaReference); |
|
78 |
|
|
79 |
CdmDefaultImport<CentralAfricaChecklistImportConfigurator> myImport = new CdmDefaultImport<CentralAfricaChecklistImportConfigurator>(); |
|
80 |
|
|
81 |
System.out.println("Start import from ("+ source.toString() + ") ..."); |
|
82 |
config.setSourceReference(getSourceReference(sourceReference)); |
|
83 |
myImport.invoke(config); |
|
84 |
System.out.println("End import from ("+ source.toString() + ")..."); |
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
// FeatureTree tree = makeFeatureNode(myImport.getCdmAppController().getTermService()); |
|
89 |
// myImport.getCdmAppController().getFeatureTreeService().saveOrUpdate(tree); |
|
90 |
|
|
91 |
} |
|
92 |
|
|
93 |
private Reference getSourceReference(String string) { |
|
94 |
Reference result = ReferenceFactory.newGeneric(); |
|
95 |
result.setTitleCache(string); |
|
96 |
return result; |
|
97 |
} |
|
98 |
|
|
99 |
// private FeatureTree makeFeatureNode(ITermService service){ |
|
100 |
// FloraMalesianaTransformer transformer = new FloraMalesianaTransformer(); |
|
101 |
// |
|
102 |
// FeatureTree result = FeatureTree.NewInstance(featureTreeUuid); |
|
103 |
// result.setTitleCache("Flora Malesiana Presentation Feature Tree"); |
|
104 |
// FeatureNode root = result.getRoot(); |
|
105 |
// FeatureNode newNode; |
|
106 |
// |
|
107 |
// newNode = FeatureNode.NewInstance(Feature.CITATION()); |
|
108 |
// root.addChild(newNode); |
|
109 |
// |
|
110 |
// newNode = FeatureNode.NewInstance(Feature.DESCRIPTION()); |
|
111 |
// root.addChild(newNode); |
|
112 |
// |
|
113 |
// return result; |
|
114 |
// } |
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
/** |
|
119 |
* @param args |
|
120 |
*/ |
|
121 |
public static void main(String[] args) { |
|
122 |
CentralAfricaChecklistActivator me = new CentralAfricaChecklistActivator(); |
|
123 |
me.doImport(cdmDestination); |
|
124 |
} |
|
125 |
|
|
126 |
} |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/CentralAfricaEricaceaeActivator.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 |
|
|
10 |
package eu.etaxonomy.cdm.app.eflora; |
|
11 |
|
|
12 |
import java.net.URI; |
|
13 |
import java.util.List; |
|
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.application.CdmApplicationController; |
|
20 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration; |
|
21 |
import eu.etaxonomy.cdm.api.service.ITermService; |
|
22 |
import eu.etaxonomy.cdm.app.common.CdmDestinations; |
|
23 |
import eu.etaxonomy.cdm.common.monitor.DefaultProgressMonitor; |
|
24 |
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor; |
|
25 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
|
26 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
|
27 |
import eu.etaxonomy.cdm.database.update.CdmUpdater; |
|
28 |
import eu.etaxonomy.cdm.io.common.CdmDefaultImport; |
|
29 |
import eu.etaxonomy.cdm.io.common.CdmImportBase.TermMatchMode; |
|
30 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK; |
|
31 |
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer; |
|
32 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException; |
|
33 |
import eu.etaxonomy.cdm.io.eflora.EfloraImportConfigurator; |
|
34 |
import eu.etaxonomy.cdm.io.eflora.centralAfrica.ericaceae.CentralAfricaEricaceaeImportConfigurator; |
|
35 |
import eu.etaxonomy.cdm.io.eflora.centralAfrica.ericaceae.CentralAfricaEricaceaeTransformer; |
|
36 |
import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator; |
|
37 |
import eu.etaxonomy.cdm.model.agent.Team; |
|
38 |
import eu.etaxonomy.cdm.model.common.Language; |
|
39 |
import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary; |
|
40 |
import eu.etaxonomy.cdm.model.description.Feature; |
|
41 |
import eu.etaxonomy.cdm.model.description.FeatureNode; |
|
42 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
|
43 |
import eu.etaxonomy.cdm.model.description.PolytomousKey; |
|
44 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
|
45 |
import eu.etaxonomy.cdm.model.location.NamedAreaLevel; |
|
46 |
import eu.etaxonomy.cdm.model.location.NamedAreaType; |
|
47 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
48 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
|
49 |
|
|
50 |
/** |
|
51 |
* @author a.mueller |
|
52 |
* @created 20.06.2008 |
|
53 |
* @version 1.0 |
|
54 |
*/ |
|
55 |
public class CentralAfricaEricaceaeActivator { |
|
56 |
private static final Logger logger = Logger.getLogger(CentralAfricaEricaceaeActivator.class); |
|
57 |
|
|
58 |
//database validation status (create, update, validate ...) |
|
59 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.VALIDATE; |
|
60 |
static final URI source = EfloraSources.ericacea_local(); |
|
61 |
|
|
62 |
static final URI specimenSource = EfloraSources.ericacea_specimen_local(); |
|
63 |
|
|
64 |
|
|
65 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_andreasM3(); |
|
66 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_central_africa_preview(); |
|
67 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_central_africa_production(); |
|
68 |
static final ICdmDataSource cdmDestination = CdmDestinations.localH2(); |
|
69 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_local_postgres_CdmTest(); |
|
70 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql(); |
|
71 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_jaxb(); |
|
72 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_edit_cichorieae_preview(); |
|
73 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_campanulaceae_production(); |
|
74 |
|
|
75 |
//feature tree uuid |
|
76 |
public static final UUID featureTreeUuid = UUID.fromString("051d35ee-22f1-42d8-be07-9e9bfec5bcf7"); |
|
77 |
|
|
78 |
public static UUID defaultLanguageUuid = Language.uuidFrench; |
|
79 |
|
|
80 |
//classification |
|
81 |
static final UUID classificationUuid = UUID.fromString("10e5efcc-6e13-4abc-ad42-e0b46e50cbe7"); |
|
82 |
|
|
83 |
//check - import |
|
84 |
static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK; |
|
85 |
|
|
86 |
static boolean doPrintKeys = false; |
|
87 |
|
|
88 |
//taxa |
|
89 |
private boolean includeEricaceae = true; |
|
90 |
static final boolean doTaxa = true; |
|
91 |
static final boolean doDeduplicate = false; |
|
92 |
|
|
93 |
|
|
94 |
private boolean doNewNamedAreas = false; |
|
95 |
private boolean doFeatureTree = false; |
|
96 |
|
|
97 |
private boolean doSpecimen = false; |
|
98 |
private TermMatchMode specimenAreaMatchMode = TermMatchMode.UUID_ABBREVLABEL; |
|
99 |
|
|
100 |
|
|
101 |
private void doImport(ICdmDataSource cdmDestination){ |
|
102 |
|
|
103 |
CdmUpdater su = CdmUpdater.NewInstance(); |
|
104 |
IProgressMonitor monitor = DefaultProgressMonitor.NewInstance(); |
|
105 |
// |
|
106 |
// try { |
|
107 |
// su.updateToCurrentVersion(cdmDestination, monitor); |
|
108 |
// } catch (Exception e) { |
|
109 |
// e.printStackTrace(); |
|
110 |
// } |
|
111 |
// if (true){ |
|
112 |
// return; |
|
113 |
// } |
|
114 |
|
|
115 |
//make Source |
|
116 |
CentralAfricaEricaceaeImportConfigurator config= CentralAfricaEricaceaeImportConfigurator.NewInstance(source, cdmDestination); |
|
117 |
config.setClassificationUuid(classificationUuid); |
|
118 |
config.setDoTaxa(doTaxa); |
|
119 |
config.setCheck(check); |
|
120 |
config.setDefaultLanguageUuid(defaultLanguageUuid); |
|
121 |
config.setDoPrintKeys(doPrintKeys); |
|
122 |
config.setDbSchemaValidation(hbm2dll); |
|
123 |
|
|
124 |
CdmDefaultImport<EfloraImportConfigurator> myImport = new CdmDefaultImport<EfloraImportConfigurator>(); |
|
125 |
|
|
126 |
|
|
127 |
//Ericaceae |
|
128 |
if (includeEricaceae){ |
|
129 |
System.out.println("Start import from ("+ source.toString() + ") ..."); |
|
130 |
config.setSourceReference(getSourceReference(config.getSourceReferenceTitle())); |
|
131 |
myImport.invoke(config); |
|
132 |
System.out.println("End import from ("+ source.toString() + ")..."); |
|
133 |
} |
|
134 |
|
|
135 |
if (doFeatureTree){ |
|
136 |
FeatureTree tree = makeFeatureNode(myImport.getCdmAppController().getTermService()); |
|
137 |
myImport.getCdmAppController().getFeatureTreeService().saveOrUpdate(tree); |
|
138 |
} |
|
139 |
|
|
140 |
//check keys |
|
141 |
if (doPrintKeys){ |
|
142 |
TransactionStatus tx = myImport.getCdmAppController().startTransaction(); |
|
143 |
List<PolytomousKey> keys = myImport.getCdmAppController().getPolytomousKeyService().list(PolytomousKey.class, null, null, null, null); |
|
144 |
for(PolytomousKey key : keys){ |
|
145 |
key.print(System.out); |
|
146 |
System.out.println(); |
|
147 |
} |
|
148 |
myImport.getCdmAppController().commitTransaction(tx); |
|
149 |
} |
|
150 |
|
|
151 |
//deduplicate |
|
152 |
if (doDeduplicate){ |
|
153 |
ICdmApplicationConfiguration app = myImport.getCdmAppController(); |
|
154 |
if (app == null){ |
|
155 |
app = CdmApplicationController.NewInstance(cdmDestination, hbm2dll, false); |
|
156 |
} |
|
157 |
app.getAgentService().updateTitleCache(Team.class, null, null, null); |
|
158 |
return; |
|
159 |
// int count = app.getAgentService().deduplicate(Person.class, null, null); |
|
160 |
// |
|
161 |
// logger.warn("Deduplicated " + count + " persons."); |
|
162 |
//// count = app.getAgentService().deduplicate(Team.class, null, null); |
|
163 |
//// logger.warn("Deduplicated " + count + " teams."); |
|
164 |
// count = app.getReferenceService().deduplicate(Reference.class, null, null); |
|
165 |
// logger.warn("Deduplicated " + count + " references."); |
|
166 |
} |
|
167 |
|
|
168 |
if(doNewNamedAreas){ |
|
169 |
newNamedAreas(myImport); |
|
170 |
} |
|
171 |
|
|
172 |
if (doSpecimen){ |
|
173 |
logger.warn("Start specimen import"); |
|
174 |
ICdmApplicationConfiguration app = myImport.getCdmAppController(); |
|
175 |
SpecimenCdmExcelImportConfigurator specimenConfig= SpecimenCdmExcelImportConfigurator.NewInstance(specimenSource, cdmDestination); |
|
176 |
specimenConfig.setCdmAppController((CdmApplicationController)app); |
|
177 |
specimenConfig.setAreaMatchMode(specimenAreaMatchMode); |
|
178 |
|
|
179 |
config.setDbSchemaValidation(DbSchemaValidation.VALIDATE); |
|
180 |
specimenConfig.setSourceReference(getSourceReference(specimenConfig.getSourceReferenceTitle())); |
|
181 |
|
|
182 |
CdmDefaultImport<SpecimenCdmExcelImportConfigurator> specimenImport = new CdmDefaultImport<SpecimenCdmExcelImportConfigurator>(); |
|
183 |
specimenImport.setCdmAppController(app); |
|
184 |
specimenImport.invoke(specimenConfig); |
|
185 |
|
|
186 |
|
|
187 |
} |
|
188 |
return; |
|
189 |
|
|
190 |
|
|
191 |
|
|
192 |
} |
|
193 |
|
|
194 |
private void newNamedAreas(CdmDefaultImport<EfloraImportConfigurator> myImport) { |
|
195 |
ICdmApplicationConfiguration app = myImport.getCdmAppController(); |
|
196 |
if (app == null){ |
|
197 |
app = CdmApplicationController.NewInstance(cdmDestination, hbm2dll, false); |
|
198 |
} |
|
199 |
TransactionStatus tx = app.startTransaction(); |
|
200 |
|
|
201 |
OrderedTermVocabulary<NamedArea> voc = OrderedTermVocabulary.NewInstance("Phytogeographic Regions of Central Africa", "Phytogeographic Regions of Central Africa", "FdAC regions", null); |
|
202 |
app.getVocabularyService().save(voc); |
|
203 |
|
|
204 |
NamedAreaLevel level = NamedAreaLevel.NewInstance("Phytogeographic Regions of Central Africa", "Phytogeographic Regions of Central Africa", "FdAC regions"); |
|
205 |
ITermService termService = app.getTermService(); |
|
206 |
|
|
207 |
termService.save(level); |
|
208 |
|
|
209 |
NamedArea area = NamedArea.NewInstance("C?tier", "C?tier", "I"); |
|
210 |
area.setLevel(level); |
|
211 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
212 |
voc.addTerm(area); |
|
213 |
termService.save(area); |
|
214 |
|
|
215 |
|
|
216 |
area = NamedArea.NewInstance("Mayumbe", "Mayumbe", "II"); |
|
217 |
area.setLevel(level); |
|
218 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
219 |
voc.addTerm(area); |
|
220 |
termService.save(area); |
|
221 |
|
|
222 |
area = NamedArea.NewInstance("Bas-Congo", "Bas-Congo", "III"); |
|
223 |
area.setLevel(level); |
|
224 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
225 |
voc.addTerm(area); |
|
226 |
termService.save(area); |
|
227 |
|
|
228 |
area = NamedArea.NewInstance("Kasai", "Kasai", "IV"); |
|
229 |
area.setLevel(level); |
|
230 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
231 |
voc.addTerm(area); |
|
232 |
termService.save(area); |
|
233 |
|
|
234 |
area = NamedArea.NewInstance("Bas-Katanga", "Bas-Katanga", "V"); |
|
235 |
area.setLevel(level); |
|
236 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
237 |
voc.addTerm(area); |
|
238 |
termService.save(area); |
|
239 |
|
|
240 |
area = NamedArea.NewInstance("Forestier Central", "Forestier Central", "VI"); |
|
241 |
area.setLevel(level); |
|
242 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
243 |
voc.addTerm(area); |
|
244 |
termService.save(area); |
|
245 |
|
|
246 |
area = NamedArea.NewInstance("Ubangi-Uele", "Ubangi-Uele", "VII"); |
|
247 |
area.setLevel(level); |
|
248 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
249 |
voc.addTerm(area); |
|
250 |
termService.save(area); |
|
251 |
|
|
252 |
area = NamedArea.NewInstance("Lac Albert", "Lac Albert", "VIII"); |
|
253 |
area.setLevel(level); |
|
254 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
255 |
voc.addTerm(area); |
|
256 |
termService.save(area); |
|
257 |
|
|
258 |
area = NamedArea.NewInstance("Lacs ?douard et Kivu", "Lacs ?douard et Kivu", "IX"); |
|
259 |
area.setLevel(level); |
|
260 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
261 |
voc.addTerm(area); |
|
262 |
termService.save(area); |
|
263 |
|
|
264 |
area = NamedArea.NewInstance("Rwanda-Burundi", "Rwanda-Burundi", "X"); |
|
265 |
area.setLevel(level); |
|
266 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
267 |
voc.addTerm(area); |
|
268 |
termService.save(area); |
|
269 |
|
|
270 |
area = NamedArea.NewInstance("Haut-Katanga", "Haut-Katanga", "XI"); |
|
271 |
area.setLevel(level); |
|
272 |
area.setType(NamedAreaType.NATURAL_AREA()); |
|
273 |
voc.addTerm(area); |
|
274 |
termService.save(area); |
|
275 |
|
|
276 |
app.getVocabularyService().save(voc); |
|
277 |
|
|
278 |
app.commitTransaction(tx); |
|
279 |
|
|
280 |
} |
|
281 |
|
|
282 |
private Reference getSourceReference(String string) { |
|
283 |
Reference result = ReferenceFactory.newGeneric(); |
|
284 |
result.setTitleCache(string); |
|
285 |
return result; |
|
286 |
} |
|
287 |
|
|
288 |
private FeatureTree makeFeatureNode(ITermService service){ |
|
289 |
CentralAfricaEricaceaeTransformer transformer = new CentralAfricaEricaceaeTransformer(); |
|
290 |
|
|
291 |
FeatureTree result = FeatureTree.NewInstance(featureTreeUuid); |
|
292 |
result.setTitleCache("Central Africa Ericaceae Feature Tree"); |
|
293 |
FeatureNode root = result.getRoot(); |
|
294 |
FeatureNode newNode; |
|
295 |
|
|
296 |
newNode = FeatureNode.NewInstance(Feature.DESCRIPTION()); |
|
297 |
root.addChild(newNode); |
|
298 |
|
|
299 |
addFeataureNodesByStringList(descriptionFeatureList, newNode, transformer, service); |
|
300 |
|
|
301 |
addFeataureNodesByStringList(generellDescriptionsList, root, transformer, service); |
|
302 |
|
|
303 |
|
|
304 |
newNode = FeatureNode.NewInstance(Feature.DISTRIBUTION()); |
|
305 |
root.addChild(newNode); |
|
306 |
|
|
307 |
newNode = FeatureNode.NewInstance(Feature.ECOLOGY()); |
|
308 |
root.addChild(newNode); |
|
309 |
addFeataureNodesByStringList(habitatEcologyList, root, transformer, service); |
|
310 |
|
|
311 |
newNode = FeatureNode.NewInstance(Feature.USES()); |
|
312 |
root.addChild(newNode); |
|
313 |
|
|
314 |
addFeataureNodesByStringList(chomosomesList, root, transformer, service); |
|
315 |
|
|
316 |
newNode = FeatureNode.NewInstance(Feature.COMMON_NAME()); |
|
317 |
root.addChild(newNode); |
|
318 |
|
|
319 |
newNode = FeatureNode.NewInstance(Feature.CITATION()); |
|
320 |
root.addChild(newNode); |
|
321 |
|
|
322 |
return result; |
|
323 |
} |
|
324 |
|
|
325 |
private static String [] chomosomesList = new String[]{ |
|
326 |
"Chromosomes", |
|
327 |
}; |
|
328 |
|
|
329 |
|
|
330 |
private static String [] habitatEcologyList = new String[]{ |
|
331 |
"Habitat", |
|
332 |
"Habitat & Ecology" |
|
333 |
}; |
|
334 |
|
|
335 |
|
|
336 |
private static String [] generellDescriptionsList = new String[]{ |
|
337 |
"Fossils", |
|
338 |
"Morphology and anatomy", |
|
339 |
"Morphology", |
|
340 |
"Vegetative morphology and anatomy", |
|
341 |
"Flower morphology", |
|
342 |
"Palynology", |
|
343 |
"Pollination", |
|
344 |
"Pollen morphology", |
|
345 |
"Life cycle", |
|
346 |
"Fruits and embryology", |
|
347 |
"Dispersal", |
|
348 |
"Wood anatomy", |
|
349 |
"Leaf anatomy", |
|
350 |
"Chromosome numbers", |
|
351 |
"Phytochemistry and Chemotaxonomy", |
|
352 |
"Phytochemistry", |
|
353 |
"Taxonomy", |
|
354 |
}; |
|
355 |
|
|
356 |
private static String [] descriptionFeatureList = new String[]{ |
|
357 |
"lifeform", |
|
358 |
"Bark", |
|
359 |
"Indumentum", |
|
360 |
"endophytic body", |
|
361 |
"flowering buds", |
|
362 |
"Branchlets", |
|
363 |
"Branches", |
|
364 |
"Branch", |
|
365 |
"Flowering branchlets", |
|
366 |
"Trees", |
|
367 |
"Twigs", |
|
368 |
"stem", |
|
369 |
"Stems", |
|
370 |
"stem leaves", |
|
371 |
"Leaves", |
|
372 |
"flower-bearing stems", |
|
373 |
"Petiole", |
|
374 |
"Petiolules", |
|
375 |
"Leaflets", |
|
376 |
"Thyrsus", |
|
377 |
"Thyrses", |
|
378 |
"Inflorescences", |
|
379 |
"Inflorescence", |
|
380 |
"Young inflorescences", |
|
381 |
"Bracts", |
|
382 |
"Pedicels", |
|
383 |
"flowering buds", |
|
384 |
"scales", |
|
385 |
"Buds", |
|
386 |
"Flowers", |
|
387 |
"Flower", |
|
388 |
"Flowering", |
|
389 |
"Stigma", |
|
390 |
"perianth", |
|
391 |
"Sepals", |
|
392 |
"Sepal", |
|
393 |
"Outer Sepals", |
|
394 |
"Axillary", |
|
395 |
"cymes", |
|
396 |
"Calyx", |
|
397 |
"Petal", |
|
398 |
"Petals", |
|
399 |
"perigone tube", |
|
400 |
"Disc", |
|
401 |
"corolla", |
|
402 |
"Stamens", |
|
403 |
"Staminodes", |
|
404 |
"Ovary", |
|
405 |
"Anthers", |
|
406 |
"anther", |
|
407 |
"Pistil", |
|
408 |
"Pistillode", |
|
409 |
"Ovules", |
|
410 |
"androecium", |
|
411 |
"gynoecium", |
|
412 |
"Filaments", |
|
413 |
"Style", |
|
414 |
"annulus", |
|
415 |
"female flowers", |
|
416 |
"Male flowers", |
|
417 |
"Female", |
|
418 |
"Infructescences", //order not consistent (sometimes before "Flowers") |
|
419 |
"Fruit", |
|
420 |
"Fruits", |
|
421 |
"fruiting axes", |
|
422 |
"drupes", |
|
423 |
"Arillode", |
|
424 |
"seed", |
|
425 |
"Seeds", |
|
426 |
"Seedling", |
|
427 |
"flower tube", |
|
428 |
"nutlets", |
|
429 |
"pollen", |
|
430 |
"secondary xylem", |
|
431 |
"chromosome number", |
|
432 |
|
|
433 |
"figure", |
|
434 |
"fig", |
|
435 |
"figs", |
|
436 |
|
|
437 |
|
|
438 |
|
|
439 |
|
|
440 |
}; |
|
441 |
|
|
442 |
public void addFeataureNodesByStringList(String[] featureStringList, FeatureNode root, IInputTransformer transformer, ITermService termService){ |
|
443 |
try { |
|
444 |
for (String featureString : featureStringList){ |
|
445 |
UUID featureUuid; |
|
446 |
featureUuid = transformer.getFeatureUuid(featureString); |
|
447 |
Feature feature = (Feature)termService.find(featureUuid); |
|
448 |
if (feature != null){ |
|
449 |
FeatureNode child = FeatureNode.NewInstance(feature); |
|
450 |
root.addChild(child); |
|
451 |
} |
|
452 |
} |
|
453 |
} catch (UndefinedTransformerMethodException e) { |
|
454 |
logger.error("getFeatureUuid is not implemented in transformer. Features could not be added"); |
|
455 |
} |
|
456 |
} |
|
457 |
|
|
458 |
|
|
459 |
|
|
460 |
/** |
|
461 |
* @param args |
|
462 |
*/ |
|
463 |
public static void main(String[] args) { |
|
464 |
CentralAfricaEricaceaeActivator me = new CentralAfricaEricaceaeActivator(); |
|
465 |
me.doImport(cdmDestination); |
|
466 |
} |
|
467 |
|
|
468 |
} |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/CentralAfricaFernsActivator.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 |
|
|
10 |
package eu.etaxonomy.cdm.app.eflora; |
|
11 |
|
|
12 |
import java.util.UUID; |
|
13 |
|
|
14 |
import org.apache.log4j.Logger; |
|
15 |
|
|
16 |
import eu.etaxonomy.cdm.api.service.ITermService; |
|
17 |
import eu.etaxonomy.cdm.app.common.CdmDestinations; |
|
18 |
import eu.etaxonomy.cdm.app.common.CdmImportSources; |
|
19 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
|
20 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
|
21 |
import eu.etaxonomy.cdm.io.common.CdmDefaultImport; |
|
22 |
import eu.etaxonomy.cdm.io.common.Source; |
|
23 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK; |
|
24 |
import eu.etaxonomy.cdm.io.eflora.centralAfrica.ferns.CentralAfricaFernsImportConfigurator; |
|
25 |
import eu.etaxonomy.cdm.io.eflora.floraMalesiana.FloraMalesianaTransformer; |
|
26 |
import eu.etaxonomy.cdm.model.description.Feature; |
|
27 |
import eu.etaxonomy.cdm.model.description.FeatureNode; |
|
28 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
|
29 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
30 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
|
31 |
|
|
32 |
/** |
|
33 |
* @author a.mueller |
|
34 |
* @created 20.06.2008 |
|
35 |
* @version 1.0 |
|
36 |
*/ |
|
37 |
public class CentralAfricaFernsActivator { |
|
38 |
@SuppressWarnings("unused") |
|
39 |
private static final Logger logger = Logger.getLogger(CentralAfricaFernsActivator.class); |
|
40 |
|
|
41 |
//database validation status (create, update, validate ...) |
|
42 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE; |
|
43 |
static final Source mySource = CdmImportSources.AFRICA_FERNS_ACCESS(); |
|
44 |
|
|
45 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_andreasM2(); |
|
46 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_central_africa_preview(); |
|
47 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_central_africa_production(); |
|
48 |
static final ICdmDataSource cdmDestination = CdmDestinations.localH2(); |
|
49 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_local_postgres_CdmTest(); |
|
50 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql(); |
|
51 |
|
|
52 |
//feature tree uuid |
|
53 |
public static final UUID featureTreeUuid = UUID.fromString("62d930cb-aabb-461c-ad16-0fdbd2bae592"); |
|
54 |
|
|
55 |
public static final String sourceReference = "Flora of Central Africa"; |
|
56 |
|
|
57 |
public static final String classificationName = "Flora of Central Africa - Ferns"; |
|
58 |
|
|
59 |
//classification |
|
60 |
static final UUID classificationUuid = UUID.fromString("a90fa160-8f33-4a19-9c5a-ab05a1553017"); |
|
61 |
|
|
62 |
//check - import |
|
63 |
static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK; |
|
64 |
|
|
65 |
// static boolean doPrintKeys = false; |
|
66 |
|
|
67 |
//taxa |
|
68 |
static final boolean doTaxa = true; |
|
69 |
|
|
70 |
// private boolean includeSapindaceae1 = true; |
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
private void doImport(ICdmDataSource cdmDestination){ |
|
75 |
|
|
76 |
|
|
77 |
//make Source |
|
78 |
Source source = mySource; |
|
79 |
|
|
80 |
// mySource.getResultSet("SELECT * FROM tmp"); |
|
81 |
CentralAfricaFernsImportConfigurator config= CentralAfricaFernsImportConfigurator.NewInstance(source, cdmDestination); |
|
82 |
config.setClassificationUuid(classificationUuid); |
|
83 |
config.setClassificationName(classificationName); |
|
84 |
config.setDoTaxa(doTaxa); |
|
85 |
config.setCheck(check); |
|
86 |
// configsetDoPrintKeys(doPrintKeys); |
|
87 |
config.setDbSchemaValidation(hbm2dll); |
|
88 |
|
|
89 |
CdmDefaultImport<CentralAfricaFernsImportConfigurator> myImport = new CdmDefaultImport<CentralAfricaFernsImportConfigurator>(); |
|
90 |
|
|
91 |
|
|
92 |
// if (includeSapindaceae1){ |
|
93 |
System.out.println("Start import from ("+ source.toString() + ") ..."); |
|
94 |
config.setSourceReference(getSourceReference(sourceReference)); |
|
95 |
myImport.invoke(config); |
|
96 |
System.out.println("End import from ("+ source.toString() + ")..."); |
|
97 |
// } |
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
FeatureTree tree = makeFeatureNode(myImport.getCdmAppController().getTermService()); |
|
102 |
myImport.getCdmAppController().getFeatureTreeService().saveOrUpdate(tree); |
|
103 |
|
|
104 |
//check keys |
|
105 |
// if (doPrintKeys){ |
|
106 |
// TransactionStatus tx = myImport.getCdmAppController().startTransaction(); |
|
107 |
// List<FeatureTree> keys = myImport.getCdmAppController().getFeatureTreeService().list(PolytomousKey.class, null, null, null, null); |
|
108 |
// for(FeatureTree key : keys){ |
|
109 |
// ((PolytomousKey)key).print(System.out); |
|
110 |
// System.out.println(); |
|
111 |
// } |
|
112 |
// myImport.getCdmAppController().commitTransaction(tx); |
|
113 |
// } |
|
114 |
|
|
115 |
} |
|
116 |
|
|
117 |
private Reference getSourceReference(String string) { |
|
118 |
Reference result = ReferenceFactory.newGeneric(); |
|
119 |
result.setTitleCache(string); |
|
120 |
return result; |
|
121 |
} |
|
122 |
|
|
123 |
private FeatureTree makeFeatureNode(ITermService service){ |
|
124 |
FloraMalesianaTransformer transformer = new FloraMalesianaTransformer(); |
|
125 |
|
|
126 |
FeatureTree result = FeatureTree.NewInstance(featureTreeUuid); |
|
127 |
result.setTitleCache("Flora Malesiana Presentation Feature Tree"); |
|
128 |
FeatureNode root = result.getRoot(); |
|
129 |
FeatureNode newNode; |
|
130 |
|
|
131 |
newNode = FeatureNode.NewInstance(Feature.CITATION()); |
|
132 |
root.addChild(newNode); |
|
133 |
|
|
134 |
newNode = FeatureNode.NewInstance(Feature.DESCRIPTION()); |
|
135 |
root.addChild(newNode); |
|
136 |
|
|
137 |
return result; |
|
138 |
} |
|
139 |
|
|
140 |
|
|
141 |
|
|
142 |
/** |
|
143 |
* @param args |
|
144 |
*/ |
|
145 |
public static void main(String[] args) { |
|
146 |
CentralAfricaFernsActivator me = new CentralAfricaFernsActivator(); |
|
147 |
me.doImport(cdmDestination); |
|
148 |
} |
|
149 |
|
|
150 |
} |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/EfloraSources.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2009 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.cdm.app.eflora; |
|
11 |
|
|
12 |
import java.io.File; |
|
13 |
import java.net.URI; |
|
14 |
|
|
15 |
import org.apache.log4j.Logger; |
|
16 |
|
|
17 |
/** |
|
18 |
* @author a.mueller |
|
19 |
* @date 09.06.2010 |
|
20 |
* |
|
21 |
*/ |
|
22 |
public class EfloraSources { |
|
23 |
@SuppressWarnings("unused") |
|
24 |
private static final Logger logger = Logger.getLogger(EfloraSources.class); |
|
25 |
|
|
26 |
//Ericaceae |
|
27 |
public static URI ericacea_local() { |
|
28 |
return URI.create("file:C:/localCopy/Data/eflora/africa/Ericaceae/ericaceae_v2.xml"); |
|
29 |
} |
|
30 |
|
|
31 |
public static URI ericacea_specimen_local() { |
|
32 |
return URI.create("file:/C:/localCopy/Data/eflora/africa/Specimen/Ericaceae/Ericaceae_CDM_specimen.xls"); |
|
33 |
} |
|
34 |
|
|
35 |
//Sapindaceae |
|
36 |
public static URI fm_sapindaceae_local(){ |
|
37 |
return URI.create("file:C:/localCopy/Data/eflora/floraMalesiana/sapindaceae-01v25.xml"); |
|
38 |
} |
|
39 |
|
|
40 |
//Sapindaceae2 |
|
41 |
public static URI fm_sapindaceae2_local(){ |
|
42 |
return URI.create("file:C:/localCopy/Data/eflora/floraMalesiana/sapindaceae-02final2.xml"); |
|
43 |
} |
|
44 |
|
|
45 |
//Flora Malesiana Vol 13-1 |
|
46 |
public static URI fm_13_1_local(){ |
|
47 |
return URI.create("file:C:/localCopy/Data/eflora/floraMalesiana/fm13_1_v8_final.xml"); |
|
48 |
} |
|
49 |
|
|
50 |
//Flora Malesiana Vol 13-2 |
|
51 |
public static URI fm_13_2_local(){ |
|
52 |
return URI.create("file:C:/localCopy/Data/eflora/floraMalesiana/fm13_2_v8_final.xml"); |
|
53 |
} |
|
54 |
|
|
55 |
//Flora Malesiana Vol 13 - small families |
|
56 |
public static URI fm_13_small_families(){ |
|
57 |
URI uri = URI.create("file:/C:/localCopy/Data/eflora/floraMalesiana/vol_13/vol_13_small_families.xml"); |
|
58 |
File file = new File(uri); |
|
59 |
return uri; |
|
60 |
} |
|
61 |
|
|
62 |
//Flora Malesiana Vol 13 - large families |
|
63 |
public static URI fm_13_large_families(){ |
|
64 |
return URI.create("file:C:/localCopy/Data/eflora/floraMalesiana/vol_13/xmlv9_large_families_vol_13.xml"); |
|
65 |
} |
|
66 |
|
|
67 |
|
|
68 |
//Flora Malesiana Vol 12 |
|
69 |
public static URI fm_12(){ |
|
70 |
return URI.create("file:C:/localCopy/Data/eflora/floraMalesiana/vol_12/xml_1995_vol_12_all_final_5.xml"); |
|
71 |
} |
|
72 |
|
|
73 |
//Flora Malesiana Series 2 - Vol 2 |
|
74 |
public static URI fm_2_2(){ |
|
75 |
return URI.create("file:C:/localCopy/Data/eflora/floraMalesiana/ser2_vol2/ser2vol2final1.xml"); |
|
76 |
} |
|
77 |
|
|
78 |
} |
app-import/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 |
|
|
10 |
package eu.etaxonomy.cdm.app.eflora; |
|
11 |
|
|
12 |
import java.net.URI; |
|
13 |
import java.util.List; |
|
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.app.common.CdmDestinations; |
|
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.mapping.IInputTransformer; |
|
26 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException; |
|
27 |
import eu.etaxonomy.cdm.io.eflora.EfloraImportConfigurator; |
|
28 |
import eu.etaxonomy.cdm.io.eflora.floraMalesiana.FloraMalesianaTransformer; |
|
29 |
import eu.etaxonomy.cdm.model.description.Feature; |
|
30 |
import eu.etaxonomy.cdm.model.description.FeatureNode; |
|
31 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
|
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 |
|
|
36 |
/** |
|
37 |
* @author a.mueller |
|
38 |
* @created 20.06.2008 |
|
39 |
* @version 1.0 |
|
40 |
*/ |
|
41 |
public class FloraMalesianaActivator { |
|
42 |
private static final Logger logger = Logger.getLogger(FloraMalesianaActivator.class); |
|
43 |
|
|
44 |
//database validation status (create, update, validate ...) |
|
45 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE; |
|
46 |
static final URI fmSource1 = EfloraSources.fm_sapindaceae_local(); |
|
47 |
static final URI fmSource2 = EfloraSources.fm_sapindaceae2_local(); |
|
48 |
static final URI fmSource13_1 = EfloraSources.fm_13_1_local(); |
|
49 |
static final URI fmSource13_2 = EfloraSources.fm_13_2_local(); |
|
50 |
|
|
51 |
|
|
52 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_andreasM3(); |
|
53 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_malesiana_preview(); |
|
54 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_malesiana_production(); |
|
55 |
static final ICdmDataSource cdmDestination = CdmDestinations.localH2(); |
|
56 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql(); |
|
57 |
|
|
58 |
|
|
59 |
//feature tree uuid |
|
60 |
public static final UUID featureTreeUuid = UUID.fromString("168df0c6-6429-484c-b26f-ded1f7e44bd9"); |
|
61 |
|
|
62 |
//classification |
|
63 |
static final UUID classificationUuid = UUID.fromString("ca4e4bcb-a1d1-4124-a358-a3d3c41dd450"); |
|
64 |
|
|
65 |
//check - import |
|
66 |
static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK; |
|
67 |
|
|
68 |
static boolean doPrintKeys = false; |
|
69 |
|
|
70 |
//taxa |
|
71 |
static final boolean doTaxa = true; |
|
72 |
|
|
73 |
private boolean includeSapindaceae1 = true; |
|
74 |
private boolean includeSapindaceae2 = true; |
|
75 |
private boolean includeVol13_1 = false; |
|
76 |
private boolean includeVol13_2 = false; |
|
77 |
|
|
78 |
|
|
79 |
private void doImport(ICdmDataSource cdmDestination){ |
|
80 |
|
|
81 |
//make Source |
|
82 |
URI source = fmSource1; |
|
83 |
EfloraImportConfigurator floraMalesianaConfig= EfloraImportConfigurator.NewInstance(source, cdmDestination); |
|
84 |
floraMalesianaConfig.setClassificationUuid(classificationUuid); |
|
85 |
floraMalesianaConfig.setDoTaxa(doTaxa); |
|
86 |
floraMalesianaConfig.setCheck(check); |
|
87 |
floraMalesianaConfig.setDoPrintKeys(doPrintKeys); |
|
88 |
floraMalesianaConfig.setDbSchemaValidation(hbm2dll); |
|
89 |
|
|
90 |
CdmDefaultImport<EfloraImportConfigurator> myImport = new CdmDefaultImport<EfloraImportConfigurator>(); |
|
91 |
|
|
92 |
|
|
93 |
//Sapindaceae1 |
|
94 |
if (includeSapindaceae1){ |
|
95 |
System.out.println("Start import from ("+ fmSource1.toString() + ") ..."); |
|
96 |
floraMalesianaConfig.setSourceReference(getSourceReference("Flora Malesiana - Sapindaceae I")); |
|
97 |
myImport.invoke(floraMalesianaConfig); |
|
98 |
System.out.println("End import from ("+ fmSource1.toString() + ")..."); |
|
99 |
} |
|
100 |
|
|
101 |
//Sapindaceae2 |
|
102 |
if (includeSapindaceae2){ |
|
103 |
System.out.println("\nStart import from ("+ fmSource2.toString() + ") ..."); |
|
104 |
source = fmSource2; |
|
105 |
floraMalesianaConfig.setSource(source); |
|
106 |
floraMalesianaConfig.setSourceReference(getSourceReference("Flora Malesiana - Sapindaceae II")); |
|
107 |
myImport.invoke(floraMalesianaConfig); |
|
108 |
System.out.println("End import from ("+ fmSource2.toString() + ")..."); |
|
109 |
} |
|
110 |
|
|
111 |
floraMalesianaConfig.setSourceReference(getSourceReference("Flora Malesiana - Vol. 13")); |
|
112 |
//Vol13_1 |
|
113 |
if (includeVol13_1){ |
|
114 |
System.out.println("\nStart import from ("+ fmSource13_1.toString() + ") ..."); |
|
115 |
source = fmSource13_1; |
|
116 |
floraMalesianaConfig.setSource(source); |
|
117 |
myImport.invoke(floraMalesianaConfig); |
|
118 |
System.out.println("End import from ("+ fmSource13_1.toString() + ")..."); |
|
119 |
} |
|
120 |
|
|
121 |
//Vol13_2 |
|
122 |
if (includeVol13_2){ |
|
123 |
System.out.println("\nStart import from ("+ fmSource13_2.toString() + ") ..."); |
|
124 |
source = fmSource13_2; |
|
125 |
floraMalesianaConfig.setSource(source); |
|
126 |
myImport.invoke(floraMalesianaConfig); |
|
127 |
System.out.println("End import from ("+ fmSource13_2.toString() + ")..."); |
|
128 |
} |
|
129 |
|
|
130 |
FeatureTree tree = makeFeatureNode(myImport.getCdmAppController().getTermService()); |
|
131 |
myImport.getCdmAppController().getFeatureTreeService().saveOrUpdate(tree); |
|
132 |
|
|
133 |
//check keys |
|
134 |
if (doPrintKeys){ |
|
135 |
TransactionStatus tx = myImport.getCdmAppController().startTransaction(); |
|
136 |
List<PolytomousKey> keys = myImport.getCdmAppController().getPolytomousKeyService().list(PolytomousKey.class, null, null, null, null); |
|
137 |
for(PolytomousKey key : keys){ |
|
138 |
key.print(System.out); |
|
139 |
System.out.println(); |
|
140 |
} |
|
141 |
myImport.getCdmAppController().commitTransaction(tx); |
|
142 |
} |
|
143 |
|
|
144 |
} |
|
145 |
|
|
146 |
private Reference getSourceReference(String string) { |
|
147 |
Reference result = ReferenceFactory.newGeneric(); |
|
148 |
result.setTitleCache(string); |
|
149 |
return result; |
|
150 |
} |
|
151 |
|
|
152 |
private FeatureTree makeFeatureNode(ITermService service){ |
|
153 |
FloraMalesianaTransformer transformer = new FloraMalesianaTransformer(); |
|
154 |
|
|
155 |
FeatureTree result = FeatureTree.NewInstance(featureTreeUuid); |
|
156 |
result.setTitleCache("Flora Malesiana Presentation Feature Tree"); |
|
157 |
FeatureNode root = result.getRoot(); |
|
158 |
FeatureNode newNode; |
|
159 |
|
|
160 |
newNode = FeatureNode.NewInstance(Feature.DESCRIPTION()); |
|
161 |
root.addChild(newNode); |
|
162 |
|
|
163 |
addFeataureNodesByStringList(descriptionFeatureList, newNode, transformer, service); |
|
164 |
|
|
165 |
addFeataureNodesByStringList(generellDescriptionsList, root, transformer, service); |
|
166 |
|
|
167 |
|
|
168 |
newNode = FeatureNode.NewInstance(Feature.DISTRIBUTION()); |
|
169 |
root.addChild(newNode); |
|
170 |
|
|
171 |
newNode = FeatureNode.NewInstance(Feature.ECOLOGY()); |
|
172 |
root.addChild(newNode); |
|
173 |
addFeataureNodesByStringList(habitatEcologyList, root, transformer, service); |
|
174 |
|
|
175 |
newNode = FeatureNode.NewInstance(Feature.USES()); |
|
176 |
root.addChild(newNode); |
|
177 |
|
|
178 |
addFeataureNodesByStringList(chomosomesList, root, transformer, service); |
|
179 |
|
|
180 |
newNode = FeatureNode.NewInstance(Feature.CITATION()); |
|
181 |
root.addChild(newNode); |
|
182 |
|
|
183 |
return result; |
|
184 |
} |
|
185 |
|
|
186 |
private static String [] chomosomesList = new String[]{ |
|
187 |
"Chromosomes", |
|
188 |
}; |
|
189 |
|
|
190 |
|
|
191 |
private static String [] habitatEcologyList = new String[]{ |
|
192 |
"Habitat", |
|
193 |
"Habitat & Ecology" |
|
194 |
}; |
|
195 |
|
|
196 |
|
|
197 |
private static String [] generellDescriptionsList = new String[]{ |
|
198 |
"Fossils", |
|
199 |
"Morphology and anatomy", |
|
200 |
"Morphology", |
|
201 |
"Vegetative morphology and anatomy", |
|
202 |
"Flower morphology", |
|
203 |
"Palynology", |
|
204 |
"Pollination", |
|
205 |
"Pollen morphology", |
|
206 |
"Life cycle", |
|
207 |
"Fruits and embryology", |
|
208 |
"Dispersal", |
|
209 |
"Wood anatomy", |
|
210 |
"Leaf anatomy", |
|
211 |
"Chromosome numbers", |
|
212 |
"Phytochemistry and Chemotaxonomy", |
|
213 |
"Phytochemistry", |
|
214 |
"Taxonomy", |
|
215 |
}; |
|
216 |
|
|
217 |
private static String [] descriptionFeatureList = new String[]{ |
|
218 |
"lifeform", |
|
219 |
"Bark", |
|
220 |
"Indumentum", |
|
221 |
"endophytic body", |
|
222 |
"flowering buds", |
|
223 |
"Branchlets", |
|
224 |
"Branches", |
|
225 |
"Branch", |
|
226 |
"Flowering branchlets", |
|
227 |
"Trees", |
|
228 |
"Twigs", |
|
229 |
"stem", |
|
230 |
"Stems", |
|
231 |
"stem leaves", |
|
232 |
"Leaves", |
|
233 |
"flower-bearing stems", |
|
234 |
"Petiole", |
|
235 |
"Petiolules", |
|
236 |
"Leaflets", |
|
237 |
"Thyrsus", |
|
238 |
"Thyrses", |
|
239 |
"Inflorescences", |
|
240 |
"Inflorescence", |
|
241 |
"Young inflorescences", |
|
242 |
"Bracts", |
|
243 |
"Pedicels", |
|
244 |
"flowering buds", |
|
245 |
"scales", |
|
246 |
"Buds", |
|
247 |
"Flowers", |
|
248 |
"Flower", |
|
249 |
"Flowering", |
|
250 |
"Stigma", |
|
251 |
"perianth", |
|
252 |
"Sepals", |
|
253 |
"Sepal", |
|
254 |
"Outer Sepals", |
|
255 |
"Axillary", |
|
256 |
"cymes", |
|
257 |
"Calyx", |
|
258 |
"Petal", |
|
259 |
"Petals", |
|
260 |
"perigone tube", |
|
261 |
"Disc", |
|
262 |
"corolla", |
|
263 |
"Stamens", |
|
264 |
"Staminodes", |
|
265 |
"Ovary", |
|
266 |
"Anthers", |
|
267 |
"anther", |
|
268 |
"Pistil", |
|
269 |
"Pistillode", |
|
270 |
"Ovules", |
|
271 |
"androecium", |
|
272 |
"gynoecium", |
|
273 |
"Filaments", |
|
274 |
"Style", |
|
275 |
"annulus", |
|
276 |
"female flowers", |
|
277 |
"Male flowers", |
|
278 |
"Female", |
|
279 |
"Infructescences", //order not consistent (sometimes before "Flowers") |
|
280 |
"Fruit", |
|
281 |
"Fruits", |
|
282 |
"fruiting axes", |
|
283 |
"drupes", |
|
284 |
"Arillode", |
|
285 |
"seed", |
|
286 |
"Seeds", |
|
287 |
"Seedling", |
|
288 |
"flower tube", |
|
289 |
"nutlets", |
|
290 |
"pollen", |
|
291 |
"secondary xylem", |
|
292 |
"chromosome number", |
|
293 |
|
|
294 |
"figure", |
|
295 |
"fig", |
|
296 |
"figs", |
|
297 |
|
|
298 |
|
|
299 |
|
|
300 |
|
|
301 |
}; |
|
302 |
|
|
303 |
public void addFeataureNodesByStringList(String[] featureStringList, FeatureNode root, IInputTransformer transformer, ITermService termService){ |
|
304 |
try { |
|
305 |
for (String featureString : featureStringList){ |
|
306 |
UUID featureUuid; |
|
307 |
featureUuid = transformer.getFeatureUuid(featureString); |
|
308 |
Feature feature = (Feature)termService.find(featureUuid); |
|
309 |
if (feature != null){ |
|
310 |
FeatureNode child = FeatureNode.NewInstance(feature); |
|
311 |
root.addChild(child); |
|
312 |
} |
|
313 |
} |
|
314 |
} catch (UndefinedTransformerMethodException e) { |
|
315 |
logger.error("getFeatureUuid is not implemented in transformer. Features could not be added"); |
|
316 |
} |
|
317 |
} |
|
318 |
|
|
319 |
|
|
320 |
|
|
321 |
/** |
|
322 |
* @param args |
|
323 |
*/ |
|
324 |
public static void main(String[] args) { |
|
325 |
FloraMalesianaActivator me = new FloraMalesianaActivator(); |
|
326 |
me.doImport(cdmDestination); |
|
327 |
} |
|
328 |
|
|
329 |
} |
app-import/src/main/java/eu/etaxonomy/cdm/app/eflora/FloraMalesianaVol13Activator.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 |
|
|
10 |
package eu.etaxonomy.cdm.app.eflora; |
|
11 |
|
|
12 |
import java.net.URI; |
|
13 |
import java.util.HashSet; |
|
14 |
import java.util.List; |
|
15 |
import java.util.Set; |
|
16 |
import java.util.UUID; |
|
17 |
|
|
18 |
import org.apache.log4j.Logger; |
|
19 |
import org.springframework.transaction.TransactionStatus; |
|
20 |
|
|
21 |
import eu.etaxonomy.cdm.api.service.ITermService; |
|
22 |
import eu.etaxonomy.cdm.app.common.CdmDestinations; |
|
23 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
|
24 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
|
25 |
import eu.etaxonomy.cdm.io.common.CdmDefaultImport; |
|
26 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK; |
|
27 |
import eu.etaxonomy.cdm.io.common.events.IIoObserver; |
|
28 |
import eu.etaxonomy.cdm.io.common.events.LoggingIoObserver; |
|
29 |
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer; |
|
30 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException; |
|
31 |
import eu.etaxonomy.cdm.io.eflora.floraMalesiana.FloraMalesianaTransformer; |
|
32 |
import eu.etaxonomy.cdm.io.markup.MarkupImportConfigurator; |
|
33 |
import eu.etaxonomy.cdm.model.description.Feature; |
|
34 |
import eu.etaxonomy.cdm.model.description.FeatureNode; |
|
35 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
|
36 |
import eu.etaxonomy.cdm.model.description.PolytomousKey; |
|
37 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
38 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
|
39 |
|
|
40 |
/** |
|
41 |
* @author a.mueller |
|
42 |
* @created 20.06.2008 |
|
43 |
* @version 1.0 |
|
44 |
*/ |
|
45 |
public class FloraMalesianaVol13Activator { |
|
46 |
private static final Logger logger = Logger.getLogger(FloraMalesianaVol13Activator.class); |
|
47 |
|
|
48 |
//database validation status (create, update, validate ...) |
|
49 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE; |
|
50 |
static final URI fmSource13_small = EfloraSources.fm_13_small_families(); |
|
51 |
static final URI fmSource13_large = EfloraSources.fm_13_large_families(); |
|
52 |
static final URI fmSource12 = EfloraSources.fm_12(); |
|
53 |
static final URI fmSource2_2 = EfloraSources.fm_2_2(); |
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_andreasM3(); |
|
58 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_malesiana_preview(); |
|
59 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_malesiana_production(); |
|
60 |
static final ICdmDataSource cdmDestination = CdmDestinations.localH2(); |
|
61 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql(); |
|
62 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql_test(); |
|
63 |
|
|
64 |
private boolean includeVol13_small = false; |
|
65 |
private boolean includeVol13_large = false; |
|
66 |
private boolean includeVol12 = false; |
|
67 |
private boolean includeVol2_2 = true; |
|
68 |
|
|
69 |
private boolean h2ForCheck = true; |
|
70 |
|
|
71 |
|
|
72 |
//feature tree uuid |
|
73 |
public static final UUID featureTreeUuid = UUID.fromString("168df0c6-6429-484c-b26f-ded1f7e44bd9"); |
|
74 |
|
|
75 |
//classification |
|
76 |
static final UUID classificationUuid = UUID.fromString("ca4e4bcb-a1d1-4124-a358-a3d3c41dd450"); |
|
77 |
|
|
78 |
//check - import |
|
79 |
static CHECK check = CHECK.IMPORT_WITHOUT_CHECK; |
|
80 |
|
|
81 |
static boolean doPrintKeys = false; |
|
82 |
|
|
83 |
//taxa |
|
84 |
static final boolean doTaxa = true; |
|
85 |
|
|
86 |
|
|
87 |
private boolean replaceStandardKeyTitles = false; |
|
88 |
|
|
89 |
private IIoObserver observer = new LoggingIoObserver(); |
|
90 |
private Set<IIoObserver> observerList = new HashSet<IIoObserver>(); |
|
91 |
|
|
92 |
|
|
93 |
private void doImport(ICdmDataSource cdmDestination){ |
|
94 |
observerList.add(observer); |
|
95 |
if (h2ForCheck && cdmDestination.getDatabaseType().equals(CdmDestinations.localH2().getDatabaseType())){ |
|
96 |
check = CHECK.CHECK_ONLY; |
|
97 |
} |
|
98 |
|
|
99 |
//make Source |
|
100 |
URI source = fmSource13_small; |
|
101 |
MarkupImportConfigurator markupConfig= MarkupImportConfigurator.NewInstance(source, cdmDestination); |
|
102 |
markupConfig.setClassificationUuid(classificationUuid); |
|
103 |
markupConfig.setDoTaxa(doTaxa); |
|
104 |
markupConfig.setCheck(check); |
|
105 |
markupConfig.setDoPrintKeys(doPrintKeys); |
|
106 |
markupConfig.setDbSchemaValidation(hbm2dll); |
|
107 |
markupConfig.setObservers(observerList); |
|
108 |
markupConfig.setReplaceStandardKeyTitles(replaceStandardKeyTitles); |
|
109 |
|
|
110 |
|
|
111 |
markupConfig.setSourceReference(getSourceReference("Flora Malesiana - Vol. 13")); |
|
112 |
|
|
113 |
CdmDefaultImport<MarkupImportConfigurator> myImport = new CdmDefaultImport<MarkupImportConfigurator>(); |
|
114 |
|
|
115 |
//Vol13_2 |
|
116 |
if (includeVol13_large){ |
|
117 |
System.out.println("\nStart import from ("+ fmSource13_large.toString() + ") ..."); |
|
118 |
source = fmSource13_large; |
|
119 |
markupConfig.setSource(source); |
|
120 |
myImport.invoke(markupConfig); |
|
121 |
System.out.println("End import from ("+ fmSource13_large.toString() + ")..."); |
|
122 |
} |
|
123 |
|
|
124 |
//Vol13_1 |
|
125 |
if (includeVol13_small){ |
|
126 |
System.out.println("\nStart import from ("+ fmSource13_small.toString() + ") ..."); |
|
127 |
source = fmSource13_small; |
|
128 |
markupConfig.setSource(source); |
|
129 |
myImport.invoke(markupConfig); |
|
130 |
System.out.println("End import from ("+ fmSource13_small.toString() + ")..."); |
|
131 |
} |
|
132 |
|
|
133 |
//Vol12 |
|
134 |
if (includeVol12){ |
|
135 |
source = fmSource12; |
|
136 |
System.out.println("\nStart import from ("+ source.toString() + ") ..."); |
|
137 |
markupConfig.setSource(source); |
|
138 |
myImport.invoke(markupConfig); |
|
139 |
System.out.println("End import from ("+ source.toString() + ")..."); |
|
140 |
} |
|
141 |
//Vol_2_2 |
|
142 |
if (includeVol2_2){ |
|
143 |
source = fmSource2_2; |
|
144 |
System.out.println("\nStart import from ("+ source.toString() + ") ..."); |
|
145 |
markupConfig.setSource(source); |
|
146 |
myImport.invoke(markupConfig); |
|
147 |
System.out.println("End import from ("+ source.toString() + ")..."); |
|
148 |
} |
|
149 |
|
|
150 |
|
|
151 |
// makeGeoService(); |
|
152 |
|
|
153 |
FeatureTree tree = makeFeatureNode(myImport.getCdmAppController().getTermService()); |
|
154 |
myImport.getCdmAppController().getFeatureTreeService().saveOrUpdate(tree); |
|
155 |
|
|
156 |
//check keys |
|
157 |
if (doPrintKeys){ |
|
158 |
TransactionStatus tx = myImport.getCdmAppController().startTransaction(); |
|
159 |
List<PolytomousKey> keys = myImport.getCdmAppController().getPolytomousKeyService().list(PolytomousKey.class, null, null, null, null); |
|
160 |
for(PolytomousKey key : keys){ |
|
161 |
key.print(System.out); |
|
162 |
System.out.println(); |
|
163 |
} |
|
164 |
myImport.getCdmAppController().commitTransaction(tx); |
|
165 |
} |
|
166 |
|
|
167 |
} |
|
168 |
|
|
169 |
private Reference getSourceReference(String string) { |
|
170 |
Reference result = ReferenceFactory.newGeneric(); |
|
171 |
result.setTitleCache(string); |
|
172 |
return result; |
|
173 |
} |
|
174 |
|
|
175 |
private FeatureTree makeFeatureNode(ITermService service){ |
|
176 |
FloraMalesianaTransformer transformer = new FloraMalesianaTransformer(); |
|
177 |
|
|
178 |
FeatureTree result = FeatureTree.NewInstance(featureTreeUuid); |
|
179 |
result.setTitleCache("Flora Malesiana Presentation Feature Tree"); |
|
180 |
FeatureNode root = result.getRoot(); |
|
181 |
FeatureNode newNode; |
|
182 |
|
|
183 |
newNode = FeatureNode.NewInstance(Feature.DESCRIPTION()); |
|
184 |
root.addChild(newNode); |
|
185 |
|
|
186 |
addFeataureNodesByStringList(descriptionFeatureList, newNode, transformer, service); |
|
187 |
|
|
188 |
addFeataureNodesByStringList(generellDescriptionsUpToAnatomyList, root, transformer, service); |
|
189 |
newNode = FeatureNode.NewInstance(Feature.ANATOMY()); |
|
190 |
addFeataureNodesByStringList(anatomySubfeatureList, newNode, transformer, service); |
|
191 |
|
|
192 |
newNode = addFeataureNodesByStringList(generellDescriptionsFromAnatomyToPhytoChemoList, root, transformer, service); |
|
193 |
addFeataureNodesByStringList(phytoChemoSubFeaturesList, newNode, transformer, service); |
|
194 |
|
|
195 |
newNode = addFeataureNodesByStringList(generellDescriptionsFromPhytoChemoList, root, transformer, service); |
|
196 |
|
|
197 |
|
|
198 |
newNode = FeatureNode.NewInstance(Feature.DISTRIBUTION()); |
|
199 |
root.addChild(newNode); |
|
200 |
|
|
201 |
newNode = FeatureNode.NewInstance(Feature.ECOLOGY()); |
|
202 |
root.addChild(newNode); |
|
203 |
addFeataureNodesByStringList(habitatEcologyList, root, transformer, service); |
|
204 |
|
|
205 |
newNode = FeatureNode.NewInstance(Feature.USES()); |
|
206 |
root.addChild(newNode); |
|
207 |
|
|
208 |
addFeataureNodesByStringList(chomosomesList, root, transformer, service); |
|
209 |
|
|
210 |
newNode = FeatureNode.NewInstance(Feature.CITATION()); |
|
211 |
root.addChild(newNode); |
|
212 |
|
|
213 |
return result; |
|
214 |
} |
|
215 |
|
|
216 |
private static String [] chomosomesList = new String[]{ |
|
217 |
"Chromosomes", |
|
218 |
}; |
|
219 |
|
|
220 |
|
|
221 |
private static String [] habitatEcologyList = new String[]{ |
|
222 |
"Habitat", |
|
223 |
"Habitat & Ecology" |
|
224 |
}; |
|
225 |
|
|
226 |
|
|
227 |
private static String [] generellDescriptionsUpToAnatomyList = new String[]{ |
|
228 |
"Fossils", |
|
229 |
"Morphology and anatomy", |
|
230 |
"Morphology", |
|
231 |
"Vegetative morphology and anatomy", |
|
232 |
}; |
|
233 |
|
|
234 |
|
|
235 |
private static String [] anatomySubfeatureList = new String[]{ |
|
236 |
"Leaf anatomy", |
|
237 |
"Wood anatomy" |
|
238 |
}; |
|
239 |
|
|
240 |
private static String [] generellDescriptionsFromAnatomyToPhytoChemoList = new String[]{ |
|
241 |
"Flower morphology", |
|
242 |
"Palynology", |
|
243 |
"Pollination", |
|
244 |
"Pollen morphology", |
|
245 |
"embryology", |
|
246 |
"cytology", |
|
247 |
"Life cycle", |
|
248 |
"Fruits and embryology", |
|
249 |
"Dispersal", |
|
250 |
"Chromosome numbers", |
|
251 |
"Phytochemistry and Chemotaxonomy", |
|
252 |
}; |
|
253 |
|
|
254 |
|
|
255 |
private static String [] phytoChemoSubFeaturesList = new String[]{ |
|
256 |
"Alkaloids", |
|
257 |
"Iridoid glucosides", |
|
258 |
"Leaf phenolics", |
|
259 |
"Storage products of seeds", |
|
260 |
"Aluminium", |
|
261 |
"Chemotaxonomy", |
|
262 |
}; |
|
263 |
|
|
264 |
|
|
265 |
private static String [] generellDescriptionsFromPhytoChemoList = new String[]{ |
|
266 |
"Phytochemistry", |
|
267 |
"Taxonomy", |
|
268 |
"history", |
|
269 |
"cultivation", |
|
270 |
"Notes" |
|
271 |
}; |
|
272 |
|
|
273 |
|
|
274 |
private static String [] descriptionFeatureList = new String[]{ |
|
275 |
"lifeform", |
|
276 |
"Bark", |
|
277 |
//new |
|
278 |
"wood", |
|
279 |
"Indumentum", |
|
280 |
"endophytic body", |
|
281 |
"flowering buds", |
|
282 |
"Branchlets", |
|
283 |
"Branches", |
|
284 |
"Branch", |
|
285 |
"Flowering branchlets", |
|
286 |
"Trees", |
|
287 |
"Twigs", |
|
288 |
"stem", |
|
289 |
"Stems", |
|
290 |
"stem leaves", |
|
291 |
"Leaves", |
Also available in: Unified diff
move eflora activators from app-import to cdm-eflora