Revision 3407a162
Added by Andreas Müller almost 12 years ago
cdm-eflora/src/main/java/eu/etaxonomy/cdm/app/eflora/FloraGuianasActivator.java | ||
---|---|---|
27 | 27 |
import eu.etaxonomy.cdm.io.common.events.LoggingIoObserver; |
28 | 28 |
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer; |
29 | 29 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException; |
30 |
import eu.etaxonomy.cdm.io.eflora.floraMalesiana.FloraMalesianaTransformer; |
|
31 | 30 |
import eu.etaxonomy.cdm.io.markup.MarkupImportConfigurator; |
31 |
import eu.etaxonomy.cdm.io.markup.MarkupTransformer; |
|
32 | 32 |
import eu.etaxonomy.cdm.model.description.Feature; |
33 | 33 |
import eu.etaxonomy.cdm.model.description.FeatureNode; |
34 | 34 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
... | ... | |
55 | 55 |
|
56 | 56 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_guianas_preview(); |
57 | 57 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_flora_guianas_production(); |
58 |
// static final ICdmDataSource cdmDestination = CdmDestinations.localH2();
|
|
59 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql(); |
|
58 |
static final ICdmDataSource cdmDestination = CdmDestinations.localH2(); |
|
59 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql();
|
|
60 | 60 |
|
61 | 61 |
|
62 | 62 |
//feature tree uuid |
... | ... | |
65 | 65 |
//classification |
66 | 66 |
static final UUID classificationUuid = UUID.fromString("5e3a1b07-2609-4597-bbda-7b02dfe8c2b3"); |
67 | 67 |
|
68 |
private static final String SOURCE_REFERENCE_TITLE = "Flora of the Guianas"; |
|
69 |
private static final String FEATURE_TREE_TITLE = "Flora of the Guianas Feature Tree"; |
|
70 |
|
|
68 | 71 |
//check - import |
69 | 72 |
private boolean h2ForCheck = true; |
70 | 73 |
static CHECK check = CHECK.IMPORT_WITHOUT_CHECK; |
... | ... | |
80 | 83 |
private boolean includeFgu4 = false; |
81 | 84 |
|
82 | 85 |
|
83 |
private boolean replaceStandardKeyTitles = false;
|
|
86 |
private boolean replaceStandardKeyTitles = true;
|
|
84 | 87 |
|
85 | 88 |
private IIoObserver observer = new LoggingIoObserver(); |
86 | 89 |
private Set<IIoObserver> observerList = new HashSet<IIoObserver>(); |
... | ... | |
104 | 107 |
markupConfig.setReplaceStandardKeyTitles(replaceStandardKeyTitles); |
105 | 108 |
|
106 | 109 |
|
107 |
markupConfig.setSourceReference(getSourceReference("Flore du Gabon"));
|
|
110 |
markupConfig.setSourceReference(getSourceReference(SOURCE_REFERENCE_TITLE));
|
|
108 | 111 |
|
109 | 112 |
CdmDefaultImport<MarkupImportConfigurator> myImport = new CdmDefaultImport<MarkupImportConfigurator>(); |
110 | 113 |
|
... | ... | |
167 | 170 |
} |
168 | 171 |
|
169 | 172 |
private FeatureTree makeFeatureNode(ITermService service){ |
170 |
FloraMalesianaTransformer transformer = new FloraMalesianaTransformer();
|
|
173 |
MarkupTransformer transformer = new MarkupTransformer();
|
|
171 | 174 |
|
172 | 175 |
FeatureTree result = FeatureTree.NewInstance(featureTreeUuid); |
173 |
result.setTitleCache("Flore Gabon Presentation Feature Tree");
|
|
176 |
result.setTitleCache(FEATURE_TREE_TITLE);
|
|
174 | 177 |
FeatureNode root = result.getRoot(); |
175 | 178 |
FeatureNode newNode; |
176 | 179 |
|
... | ... | |
192 | 195 |
newNode = FeatureNode.NewInstance(Feature.DISTRIBUTION()); |
193 | 196 |
root.addChild(newNode); |
194 | 197 |
|
198 |
newNode = FeatureNode.NewInstance(Feature.COMMON_NAME()); |
|
199 |
root.addChild(newNode); |
|
200 |
|
|
201 |
newNode = FeatureNode.NewInstance(Feature.PHENOLOGY()); |
|
202 |
root.addChild(newNode); |
|
203 |
|
|
195 | 204 |
newNode = FeatureNode.NewInstance(Feature.ECOLOGY()); |
196 | 205 |
root.addChild(newNode); |
197 | 206 |
addFeataureNodesByStringList(habitatEcologyList, root, transformer, service); |
... | ... | |
204 | 213 |
newNode = FeatureNode.NewInstance(Feature.CITATION()); |
205 | 214 |
root.addChild(newNode); |
206 | 215 |
|
216 |
String sql = "\nSELECT feature.titleCache " + |
|
217 |
" FROM DescriptionElementBase deb INNER JOIN DefinedTermBase feature ON deb.feature_id = feature.id " + |
|
218 |
" GROUP BY feature.id " + |
|
219 |
" HAVING feature.id NOT IN (SELECT DISTINCT fn.feature_id " + |
|
220 |
" FROM FeatureNode fn " + |
|
221 |
" WHERE fn.feature_id IS NOT NULL) "; |
|
222 |
logger.warn("Check for missing features in feature tree: " + sql); |
|
223 |
|
|
207 | 224 |
return result; |
208 | 225 |
} |
209 | 226 |
|
... | ... | |
267 | 284 |
|
268 | 285 |
private static String [] descriptionFeatureList = new String[]{ |
269 | 286 |
"lifeform", |
287 |
"Juvenile parts", |
|
270 | 288 |
"Bark", |
271 | 289 |
//new |
272 | 290 |
"wood", |
... | ... | |
283 | 301 |
"Stems", |
284 | 302 |
"stem leaves", |
285 | 303 |
"Leaves", |
304 |
"extraxylary sclerenchyma", |
|
286 | 305 |
"flower-bearing stems", |
287 | 306 |
"Petiole", |
288 | 307 |
"Petiolules", |
289 | 308 |
"Leaflets", |
309 |
"Lamina", |
|
310 |
"Veins", |
|
290 | 311 |
"Thyrsus", |
291 | 312 |
"Thyrses", |
292 | 313 |
"Inflorescences", |
... | ... | |
294 | 315 |
"Young inflorescences", |
295 | 316 |
"Male inflorescences", |
296 | 317 |
"Female inflorescences", |
297 |
"Bracts",
|
|
318 |
"rachises",
|
|
298 | 319 |
"Pedicels", |
320 |
"Bracts", |
|
299 | 321 |
"flowering buds", |
300 | 322 |
"scales", |
301 | 323 |
"Buds", |
Also available in: Unified diff
latest changes to Gabon and Guiana activators