Revision 8804a550
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/common/CdmDestinations.java | ||
---|---|---|
55 | 55 |
return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null); |
56 | 56 |
} |
57 | 57 |
|
58 |
|
|
59 | 58 |
public static ICdmDataSource cdm_test_local_indexFungorum(){ |
60 | 59 |
DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL; |
61 | 60 |
String cdmServer = "127.0.0.1"; |
... | ... | |
64 | 63 |
return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null); |
65 | 64 |
} |
66 | 65 |
|
67 |
|
|
68 | 66 |
public static ICdmDataSource cdm_test_local_mysql_erms(){ |
69 | 67 |
DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL; |
70 | 68 |
String cdmServer = "127.0.0.1"; |
... | ... | |
73 | 71 |
return CdmDestinations.makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null); |
74 | 72 |
} |
75 | 73 |
|
74 |
public static ICdmDataSource cdm_test_local_mysql_erms2(){ |
|
75 |
DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL; |
|
76 |
String cdmServer = "127.0.0.1"; |
|
77 |
String cdmDB = "cdm_pesi_erms2"; |
|
78 |
String cdmUserName = "edit"; |
|
79 |
return CdmDestinations.makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null); |
|
80 |
} |
|
76 | 81 |
|
77 | 82 |
public static ICdmDataSource cdm_test_local_mysql_test(){ |
78 | 83 |
DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL; |
... | ... | |
81 | 86 |
String cdmUserName = "edit"; |
82 | 87 |
return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null); |
83 | 88 |
} |
84 |
public static ICdmDataSource cdm_portal_test_localhost(){ |
|
85 |
DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL; |
|
86 |
String cdmServer = "127.0.0.1"; |
|
87 |
String cdmDB = "cdm_portal_test"; |
|
88 |
String cdmUserName = "edit"; |
|
89 |
return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null); |
|
90 |
} |
|
91 |
|
|
92 |
public static ICdmDataSource cdm_portal_test_localhost2(){ |
|
93 |
DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL; |
|
94 |
String cdmServer = "127.0.0.1"; |
|
95 |
String cdmDB = "cdm_portal_test2"; |
|
96 |
String cdmUserName = "edit"; |
|
97 |
return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null); |
|
98 |
} |
|
99 |
|
|
100 |
public static ICdmDataSource cdm_local_postgres_CdmTest(){ |
|
101 |
DatabaseTypeEnum dbType = DatabaseTypeEnum.PostgreSQL; |
|
102 |
String cdmServer = "127.0.0.1"; |
|
103 |
String cdmDB = "CdmTest"; |
|
104 |
String cdmUserName = "edit"; |
|
105 |
return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null); |
|
106 |
} |
|
107 |
|
|
108 | 89 |
|
109 | 90 |
public static ICdmDataSource NULL(){ |
110 | 91 |
return null; |
... | ... | |
123 | 104 |
return CdmDataSource.NewH2EmbeddedInstance("erms", "sa", ""); |
124 | 105 |
} |
125 | 106 |
|
126 |
public static ICdmDataSource cdm_algaterra_preview(){ |
|
127 |
DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL; |
|
128 |
String cdmServer = "160.45.63.201"; |
|
129 |
String cdmDB = "cdm_edit_algaterra"; |
|
130 |
String cdmUserName = "edit"; |
|
131 |
return makeDestination(dbType, cdmServer, cdmDB, -1, cdmUserName, null); |
|
132 |
} |
|
133 |
|
|
134 |
|
|
135 | 107 |
public static ICdmDataSource test_cdm_pesi_euroMed(){ |
136 | 108 |
DatabaseTypeEnum dbType = DatabaseTypeEnum.MySQL; |
137 | 109 |
String cdmServer = "160.45.63.175"; |
... | ... | |
183 | 155 |
throw new RuntimeException("Unsupported DatabaseType"); |
184 | 156 |
} |
185 | 157 |
return destination; |
186 |
|
|
187 | 158 |
} |
188 | 159 |
|
189 | 160 |
|
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/ErmsActivator.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.pesi; |
|
11 |
|
|
12 |
import java.util.UUID; |
|
13 |
|
|
14 |
import org.apache.log4j.Logger; |
|
15 |
|
|
16 |
import eu.etaxonomy.cdm.api.application.ICdmRepository; |
|
17 |
import eu.etaxonomy.cdm.app.common.CdmDestinations; |
|
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.IImportConfigurator.CHECK; |
|
22 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES; |
|
23 |
import eu.etaxonomy.cdm.io.common.Source; |
|
24 |
import eu.etaxonomy.cdm.io.pesi.erms.ErmsImportConfigurator; |
|
25 |
import eu.etaxonomy.cdm.io.pesi.out.PesiTransformer; |
|
26 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
27 |
import eu.etaxonomy.cdm.model.reference.ISourceable; |
|
28 |
|
|
29 |
|
|
30 |
/** |
|
31 |
* @author a.mueller |
|
32 |
*/ |
|
33 |
public class ErmsActivator { |
|
34 |
private static final Logger logger = Logger.getLogger(ErmsActivator.class); |
|
35 |
|
|
36 |
//database validation status (create, update, validate ...) |
|
37 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE; |
|
38 |
// static final Source ermsSource = PesiSources.PESI3_ERMS(); |
|
39 |
static final Source ermsSource = PesiSources.PESI2019_ERMS(); |
|
40 |
// static final ICdmDataSource cdmDestination = CdmDestinations.test_cdm_pesi_erms(); |
|
41 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql_erms(); |
|
42 |
|
|
43 |
static final UUID classificationUuid = UUID.fromString("6fa988a9-10b7-48b0-a370-2586fbc066eb"); |
|
44 |
|
|
45 |
static final String classificationName = "ERMS 2019"; |
|
46 |
|
|
47 |
//check - import |
|
48 |
static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK; |
|
49 |
|
|
50 |
static final int partitionSize = 5000; |
|
51 |
|
|
52 |
//ignore null |
|
53 |
static final boolean ignoreNull = true; |
|
54 |
|
|
55 |
static final boolean includeExport = true; |
|
56 |
|
|
57 |
// ***************** ALL ************************************************// |
|
58 |
|
|
59 |
//references |
|
60 |
static final DO_REFERENCES doReferences = DO_REFERENCES.ALL; |
|
61 |
|
|
62 |
//taxa |
|
63 |
static final boolean doTaxa = true; |
|
64 |
static final boolean doRelTaxa = true; |
|
65 |
static final boolean doLinks = true; |
|
66 |
static final boolean doOccurences = true; |
|
67 |
static final boolean doImages = true; |
|
68 |
|
|
69 |
|
|
70 |
//******************** NONE ***************************************// |
|
71 |
|
|
72 |
|
|
73 |
// //references |
|
74 |
// static final DO_REFERENCES doReferences = DO_REFERENCES.NONE; |
|
75 |
// |
|
76 |
// //taxa |
|
77 |
// static final boolean doTaxa = false; |
|
78 |
// static final boolean doRelTaxa = false; |
|
79 |
// static final boolean doLinks = false; |
|
80 |
// static final boolean doOccurences = false; |
|
81 |
// |
|
82 |
|
|
83 |
|
|
84 |
private void doImport(Source source, ICdmDataSource destination, DbSchemaValidation hbm2dll){ |
|
85 |
System.out.println("Start import from ("+ ermsSource.getDatabase() + ") ..."); |
|
86 |
|
|
87 |
//make ERMS Source |
|
88 |
|
|
89 |
ErmsImportConfigurator config = ErmsImportConfigurator.NewInstance(source, destination); |
|
90 |
|
|
91 |
config.setClassificationUuid(classificationUuid); |
|
92 |
|
|
93 |
config.setIgnoreNull(ignoreNull); |
|
94 |
config.setDoReferences(doReferences); |
|
95 |
|
|
96 |
config.setDoTaxa(doTaxa); |
|
97 |
config.setDoRelTaxa(doRelTaxa); |
|
98 |
config.setDoLinks(doLinks); |
|
99 |
config.setDoOccurrence(doOccurences); |
|
100 |
config.setDbSchemaValidation(hbm2dll); |
|
101 |
|
|
102 |
config.setCheck(check); |
|
103 |
config.setRecordsPerTransaction(partitionSize); |
|
104 |
config.setSourceRefUuid(PesiTransformer.uuidSourceRefErms); |
|
105 |
config.setClassificationName(classificationName); |
|
106 |
|
|
107 |
// invoke import |
|
108 |
CdmDefaultImport<ErmsImportConfigurator> ermsImport = new CdmDefaultImport<ErmsImportConfigurator>(); |
|
109 |
ermsImport.invoke(config); |
|
110 |
|
|
111 |
if (config.getCheck().equals(CHECK.CHECK_AND_IMPORT) || config.getCheck().equals(CHECK.IMPORT_WITHOUT_CHECK) ){ |
|
112 |
ICdmRepository app = ermsImport.getCdmAppController(); |
|
113 |
ISourceable<?> obj = app.getCommonService().getSourcedObjectByIdInSource(TaxonName.class, "1000027", null); |
|
114 |
logger.info(obj); |
|
115 |
|
|
116 |
// //make feature tree |
|
117 |
// FeatureTree tree = TreeCreator.flatTree(featureTreeUuid, ermsImportConfigurator.getFeatureMap(), featureKeyList); |
|
118 |
// app = ermsImport.getCdmAppController(); |
|
119 |
// app.getFeatureTreeService().saveOrUpdate(tree); |
|
120 |
} |
|
121 |
System.out.println("End import from ("+ source.getDatabase() + ")..."); |
|
122 |
} |
|
123 |
|
|
124 |
/** |
|
125 |
* @param args |
|
126 |
*/ |
|
127 |
public static void main(String[] args) { |
|
128 |
ICdmDataSource cdmDB = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination; |
|
129 |
ErmsActivator ermsImport = new ErmsActivator(); |
|
130 |
ermsImport.doImport(ermsSource, cdmDB, hbm2dll); |
|
131 |
|
|
132 |
if (includeExport){ |
|
133 |
PesiExportActivatorERMS ermsExport = new PesiExportActivatorERMS(); |
|
134 |
ermsExport.doExport(cdmDB); |
|
135 |
} |
|
136 |
System.exit(0); |
|
137 |
} |
|
138 |
|
|
139 |
} |
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/ErmsImportActivator.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.pesi; |
|
11 |
|
|
12 |
import java.util.UUID; |
|
13 |
|
|
14 |
import org.apache.log4j.Logger; |
|
15 |
|
|
16 |
import eu.etaxonomy.cdm.api.application.ICdmRepository; |
|
17 |
import eu.etaxonomy.cdm.app.common.CdmDestinations; |
|
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.IImportConfigurator.CHECK; |
|
22 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES; |
|
23 |
import eu.etaxonomy.cdm.io.common.Source; |
|
24 |
import eu.etaxonomy.cdm.io.pesi.erms.ErmsImportConfigurator; |
|
25 |
import eu.etaxonomy.cdm.io.pesi.out.PesiTransformer; |
|
26 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
27 |
import eu.etaxonomy.cdm.model.reference.ISourceable; |
|
28 |
|
|
29 |
|
|
30 |
/** |
|
31 |
* @author a.mueller |
|
32 |
*/ |
|
33 |
public class ErmsActivator { |
|
34 |
private static final Logger logger = Logger.getLogger(ErmsActivator.class); |
|
35 |
|
|
36 |
//database validation status (create, update, validate ...) |
|
37 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE; |
|
38 |
// static final Source ermsSource = PesiSources.PESI3_ERMS(); |
|
39 |
static final Source ermsSource = PesiSources.PESI2019_ERMS(); |
|
40 |
// static final ICdmDataSource cdmDestination = CdmDestinations.test_cdm_pesi_erms(); |
|
41 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql_erms(); |
|
42 |
|
|
43 |
static final UUID classificationUuid = UUID.fromString("6fa988a9-10b7-48b0-a370-2586fbc066eb"); |
|
44 |
|
|
45 |
static final String classificationName = "ERMS 2019"; |
|
46 |
|
|
47 |
//check - import |
|
48 |
static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK; |
|
49 |
|
|
50 |
static final int partitionSize = 5000; |
|
51 |
|
|
52 |
//ignore null |
|
53 |
static final boolean ignoreNull = true; |
|
54 |
|
|
55 |
static final boolean includeExport = true; |
|
56 |
|
|
57 |
// ***************** ALL ************************************************// |
|
58 |
|
|
59 |
//references |
|
60 |
static final DO_REFERENCES doReferences = DO_REFERENCES.ALL; |
|
61 |
|
|
62 |
//taxa |
|
63 |
static final boolean doTaxa = true; |
|
64 |
static final boolean doRelTaxa = true; |
|
65 |
static final boolean doLinks = true; |
|
66 |
static final boolean doOccurences = true; |
|
67 |
static final boolean doImages = true; |
|
68 |
|
|
69 |
|
|
70 |
//******************** NONE ***************************************// |
|
71 |
|
|
72 |
|
|
73 |
// //references |
|
74 |
// static final DO_REFERENCES doReferences = DO_REFERENCES.NONE; |
|
75 |
// |
|
76 |
// //taxa |
|
77 |
// static final boolean doTaxa = false; |
|
78 |
// static final boolean doRelTaxa = false; |
|
79 |
// static final boolean doLinks = false; |
|
80 |
// static final boolean doOccurences = false; |
|
81 |
// |
|
82 |
|
|
83 |
|
|
84 |
private void doImport(Source source, ICdmDataSource destination, DbSchemaValidation hbm2dll){ |
|
85 |
System.out.println("Start import from ("+ ermsSource.getDatabase() + ") ..."); |
|
86 |
|
|
87 |
//make ERMS Source |
|
88 |
|
|
89 |
ErmsImportConfigurator config = ErmsImportConfigurator.NewInstance(source, destination); |
|
90 |
|
|
91 |
config.setClassificationUuid(classificationUuid); |
|
92 |
|
|
93 |
config.setIgnoreNull(ignoreNull); |
|
94 |
config.setDoReferences(doReferences); |
|
95 |
|
|
96 |
config.setDoTaxa(doTaxa); |
|
97 |
config.setDoRelTaxa(doRelTaxa); |
|
98 |
config.setDoLinks(doLinks); |
|
99 |
config.setDoOccurrence(doOccurences); |
|
100 |
config.setDbSchemaValidation(hbm2dll); |
|
101 |
|
|
102 |
config.setCheck(check); |
|
103 |
config.setRecordsPerTransaction(partitionSize); |
|
104 |
config.setSourceRefUuid(PesiTransformer.uuidSourceRefErms); |
|
105 |
config.setClassificationName(classificationName); |
|
106 |
|
|
107 |
// invoke import |
|
108 |
CdmDefaultImport<ErmsImportConfigurator> ermsImport = new CdmDefaultImport<ErmsImportConfigurator>(); |
|
109 |
ermsImport.invoke(config); |
|
110 |
|
|
111 |
if (config.getCheck().equals(CHECK.CHECK_AND_IMPORT) || config.getCheck().equals(CHECK.IMPORT_WITHOUT_CHECK) ){ |
|
112 |
ICdmRepository app = ermsImport.getCdmAppController(); |
|
113 |
ISourceable<?> obj = app.getCommonService().getSourcedObjectByIdInSource(TaxonName.class, "1000027", null); |
|
114 |
logger.info(obj); |
|
115 |
|
|
116 |
// //make feature tree |
|
117 |
// FeatureTree tree = TreeCreator.flatTree(featureTreeUuid, ermsImportConfigurator.getFeatureMap(), featureKeyList); |
|
118 |
// app = ermsImport.getCdmAppController(); |
|
119 |
// app.getFeatureTreeService().saveOrUpdate(tree); |
|
120 |
} |
|
121 |
System.out.println("End import from ("+ source.getDatabase() + ")..."); |
|
122 |
} |
|
123 |
|
|
124 |
/** |
|
125 |
* @param args |
|
126 |
*/ |
|
127 |
public static void main(String[] args) { |
|
128 |
ICdmDataSource cdmDB = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmDestination; |
|
129 |
ErmsActivator ermsImport = new ErmsActivator(); |
|
130 |
ermsImport.doImport(ermsSource, cdmDB, hbm2dll); |
|
131 |
|
|
132 |
if (includeExport){ |
|
133 |
PesiExportActivatorERMS ermsExport = new PesiExportActivatorERMS(); |
|
134 |
ermsExport.doExport(cdmDB); |
|
135 |
} |
|
136 |
System.exit(0); |
|
137 |
} |
|
138 |
|
|
139 |
} |
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/PesiDestinations.java | ||
---|---|---|
17 | 17 |
/** |
18 | 18 |
* @author e.-m.lee |
19 | 19 |
* @since 16.02.2010 |
20 |
* |
|
21 | 20 |
*/ |
22 | 21 |
public class PesiDestinations { |
23 | 22 |
@SuppressWarnings("unused") |
... | ... | |
70 | 69 |
String strServer = "pesiimport3"; |
71 | 70 |
String strDB = "CDM_ERMS2PESI"; |
72 | 71 |
int port = 1433; |
73 |
String userName = "pesiexport";
|
|
72 |
String userName = "pesi2019";
|
|
74 | 73 |
return makeSource(dbms, strServer, strDB, port, userName, null); |
75 | 74 |
} |
76 | 75 |
|
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/PesiExportActivator.java | ||
---|---|---|
30 | 30 |
@SuppressWarnings("unused") |
31 | 31 |
private static final Logger logger = Logger.getLogger(PesiExportActivator.class); |
32 | 32 |
|
33 |
//database validation status (create, update, validate ...) |
|
34 |
// static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_EM2PESI(); |
|
35 |
// static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI(); |
|
36 |
static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_ERMS2PESI(); |
|
37 |
|
|
38 | 33 |
static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_faunaEu_mysql(); |
39 | 34 |
// static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_mysql(); |
40 | 35 |
// static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_mysql_test(); |
41 | 36 |
|
37 |
// static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_EM2PESI(); |
|
38 |
// static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI(); |
|
39 |
static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_ERMS2PESI(); |
|
40 |
|
|
42 | 41 |
//Taxon names can't be mapped to their CDM ids as PESI Taxon table mainly holds taxa and there IDs. We ad nameIdStart to the TaxonName id to get a unique id |
43 | 42 |
static final int nameIdStart = 10000000; |
44 | 43 |
|
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/PesiExportActivatorEM.java | ||
---|---|---|
25 | 25 |
* @author a.mueller |
26 | 26 |
* @author e.-m.lee |
27 | 27 |
* @since 16.02.2010 |
28 |
* |
|
29 | 28 |
*/ |
30 | 29 |
public class PesiExportActivatorEM { |
31 | 30 |
@SuppressWarnings("unused") |
32 | 31 |
private static final Logger logger = Logger.getLogger(PesiExportActivatorEM.class); |
33 | 32 |
|
33 |
static final ICdmDataSource cdmSource = CdmDestinations.test_cdm_pesi_euroMed(); |
|
34 |
|
|
34 | 35 |
//database validation status (create, update, validate ...) |
35 | 36 |
static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_EM2PESI(); |
36 | 37 |
// static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_FE2PESI(); |
37 | 38 |
// static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_ERMS2PESI(); |
38 | 39 |
|
39 |
static final ICdmDataSource cdmSource = CdmDestinations.cdm_pesi_erms(); |
|
40 | 40 |
//Taxon names can't be mapped to their CDM ids as PESI Taxon table mainly holds taxa and there IDs. We ad nameIdStart to the TaxonName id to get a unique id |
41 | 41 |
static final int nameIdStart = 10000000; |
42 | 42 |
static final IdType idType = IdType.CDM_ID_WITH_EXCEPTIONS; |
... | ... | |
128 | 128 |
} |
129 | 129 |
|
130 | 130 |
// invoke export |
131 |
CdmDefaultExport<PesiExportConfigurator> pesiExport = new CdmDefaultExport<PesiExportConfigurator>();
|
|
131 |
CdmDefaultExport<PesiExportConfigurator> pesiExport = new CdmDefaultExport<>(); |
|
132 | 132 |
boolean result = pesiExport.invoke(config).isSuccess(); |
133 | 133 |
|
134 | 134 |
System.out.println("End export to PESI ("+ destination.getDatabase() + ")..." + (result? "(successful)":"(with errors)")); |
135 | 135 |
return result; |
136 | 136 |
} |
137 | 137 |
|
138 |
/** |
|
139 |
* @param args |
|
140 |
*/ |
|
141 | 138 |
public static void main(String[] args) { |
142 | 139 |
PesiExportActivatorEM ex = new PesiExportActivatorEM(); |
143 | 140 |
ICdmDataSource source = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmSource; |
144 | 141 |
// Connection con = pesiDestination.getConnection(); |
145 | 142 |
// System.out.println(con); |
146 | 143 |
ex.doExport(source); |
144 |
System.exit(0); |
|
147 | 145 |
} |
148 | 146 |
|
149 | 147 |
} |
cdm-pesi/src/main/java/eu/etaxonomy/cdm/app/pesi/PesiExportActivatorERMS.java | ||
---|---|---|
25 | 25 |
* @author a.mueller |
26 | 26 |
* @author e.-m.lee |
27 | 27 |
* @since 16.02.2010 |
28 |
* |
|
29 | 28 |
*/ |
30 | 29 |
public class PesiExportActivatorERMS { |
31 | 30 |
@SuppressWarnings("unused") |
32 | 31 |
private static final Logger logger = Logger.getLogger(PesiExportActivatorERMS.class); |
33 | 32 |
|
34 |
static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_mysql_erms(); |
|
33 |
// static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_mysql_erms(); |
|
34 |
static final ICdmDataSource cdmSource = CdmDestinations.cdm_test_local_mysql_erms2(); |
|
35 | 35 |
|
36 | 36 |
//database validation status (create, update, validate ...) |
37 | 37 |
static final Source pesiDestination = PesiDestinations.pesi_test_local_CDM_ERMS2PESI(); |
... | ... | |
131 | 131 |
return result; |
132 | 132 |
} |
133 | 133 |
|
134 |
/** |
|
135 |
* @param args |
|
136 |
*/ |
|
137 | 134 |
public static void main(String[] args) { |
138 | 135 |
PesiExportActivatorERMS ex = new PesiExportActivatorERMS(); |
139 | 136 |
ICdmDataSource source = CdmDestinations.chooseDestination(args) != null ? CdmDestinations.chooseDestination(args) : cdmSource; |
140 | 137 |
|
141 | 138 |
ex.doExport(source); |
139 |
System.exit(0); |
|
142 | 140 |
} |
143 |
|
|
144 | 141 |
} |
Also available in: Unified diff
ref #1444 update pesi/erms sources and destinations