Revision 702cfaf1
Added by Andreas Müller about 7 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/greece/FloraHellenicaActivator.java | ||
---|---|---|
37 | 37 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE; |
38 | 38 |
|
39 | 39 |
// static final ICdmDataSource cdmDestination = CdmDestinations.localH2(); |
40 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql_test(); |
|
41 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_greece_checklist_production();
|
|
40 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql_test();
|
|
41 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_greece_checklist_production(); |
|
42 | 42 |
|
43 | 43 |
//feature tree uuid |
44 | 44 |
public static final UUID featureTreeUuid = UUID.fromString("9e1e0e81-7475-4b28-8619-b7f42cd760b6"); |
... | ... | |
52 | 52 |
//check - import |
53 | 53 |
static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK; |
54 | 54 |
|
55 |
boolean doImages = true; |
|
56 |
|
|
55 | 57 |
boolean doVocabularies = (hbm2dll == DbSchemaValidation.CREATE); |
56 | 58 |
|
57 | 59 |
private void doImport(ICdmDataSource cdmDestination){ |
... | ... | |
70 | 72 |
// config.setDoVocabularies(doVocabularies); |
71 | 73 |
config.setUuidFeatureTree(featureTreeUuid); |
72 | 74 |
config.setFeatureTreeTitle(featureTreeTitle); |
75 |
config.setDoImages(doImages); |
|
73 | 76 |
|
74 | 77 |
CdmDefaultImport<FloraHellenicaImportConfigurator> myImport = new CdmDefaultImport<>(); |
75 | 78 |
myImport.invoke(config); |
app-import/src/main/java/eu/etaxonomy/cdm/io/greece/FloraHellenicaImageImport.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2016 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.io.greece; |
|
10 |
|
|
11 |
import org.apache.log4j.Logger; |
|
12 |
import org.springframework.stereotype.Component; |
|
13 |
|
|
14 |
import eu.etaxonomy.cdm.io.common.CdmImportBase; |
|
15 |
import eu.etaxonomy.cdm.io.mexico.SimpleExcelTaxonImportState; |
|
16 |
|
|
17 |
/** |
|
18 |
* Import for the Flora Hellenica images. |
|
19 |
* |
|
20 |
* @author a.mueller |
|
21 |
* @date 03.04.2017 |
|
22 |
*/ |
|
23 |
|
|
24 |
@Component |
|
25 |
public class FloraHellenicaImageImport<CONFIG extends FloraHellenicaImportConfigurator> |
|
26 |
extends CdmImportBase<CONFIG,SimpleExcelTaxonImportState<CONFIG>>{ |
|
27 |
|
|
28 |
private static final long serialVersionUID = 7118028793298922703L; |
|
29 |
private static final Logger logger = Logger.getLogger(FloraHellenicaImageImport.class); |
|
30 |
|
|
31 |
/** |
|
32 |
* {@inheritDoc} |
|
33 |
*/ |
|
34 |
@Override |
|
35 |
protected void doInvoke(SimpleExcelTaxonImportState<CONFIG> state) { |
|
36 |
// String baseURI = |
|
37 |
} |
|
38 |
|
|
39 |
/** |
|
40 |
* {@inheritDoc} |
|
41 |
*/ |
|
42 |
@Override |
|
43 |
protected boolean doCheck(SimpleExcelTaxonImportState<CONFIG> state) { |
|
44 |
return false; |
|
45 |
} |
|
46 |
|
|
47 |
/** |
|
48 |
* {@inheritDoc} |
|
49 |
*/ |
|
50 |
@Override |
|
51 |
protected boolean isIgnore(SimpleExcelTaxonImportState<CONFIG> state) { |
|
52 |
return ! state.getConfig().isDoImages(); |
|
53 |
} |
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
} |
app-import/src/main/java/eu/etaxonomy/cdm/io/greece/FloraHellenicaImportConfigurator.java | ||
---|---|---|
29 | 29 |
private static IInputTransformer defaultTransformer = new FloraHellenicaTransformer(); |
30 | 30 |
private Reference secReference; |
31 | 31 |
|
32 |
private boolean isDoImages = true; |
|
33 |
|
|
34 |
|
|
32 | 35 |
|
33 | 36 |
/** |
34 | 37 |
* @param source |
... | ... | |
59 | 62 |
FloraHellenicaExcludedTaxonImport.class, |
60 | 63 |
FloraHellenicaSynonymImport.class, |
61 | 64 |
FloraHellenicaCommentsImport.class, |
65 |
FloraHellenicaImageImport.class, |
|
62 | 66 |
}; |
63 | 67 |
} |
68 |
|
|
69 |
|
|
70 |
public boolean isDoImages() { |
|
71 |
return isDoImages; |
|
72 |
} |
|
73 |
|
|
74 |
|
|
75 |
public void setDoImages(boolean isDoImages) { |
|
76 |
this.isDoImages = isDoImages; |
|
77 |
} |
|
64 | 78 |
} |
cdm-eflora/src/main/java/eu/etaxonomy/cdm/app/eflora/CdmDestinations.java | ||
---|---|---|
38 | 38 |
DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL; |
39 | 39 |
String cdmServer = "127.0.0.1"; |
40 | 40 |
String cdmDB = "cdm_test"; |
41 |
String cdmUserName = "root";
|
|
41 |
String cdmUserName = "edit";
|
|
42 | 42 |
return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null); |
43 | 43 |
} |
44 | 44 |
|
Also available in: Unified diff
ref #6286 FloraHellenica image import class added