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.sdd;
|
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.database.DbSchemaValidation;
|
18
|
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
19
|
import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
|
20
|
import eu.etaxonomy.cdm.io.common.IImportConfigurator.CHECK;
|
21
|
import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES;
|
22
|
import eu.etaxonomy.cdm.io.sdd.SDDImportConfigurator;
|
23
|
|
24
|
/**
|
25
|
* @author h.fradin
|
26
|
* @created 24.10.2008
|
27
|
* @version 1.0
|
28
|
*/
|
29
|
public class AnthuriumActivator {
|
30
|
@SuppressWarnings("unused")
|
31
|
private static final Logger logger = Logger.getLogger(ViolaActivator.class);
|
32
|
|
33
|
//database validation status (create, update, validate ...)
|
34
|
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;
|
35
|
static final String sddSource = SDDSources.viola_local();
|
36
|
//static final String sddSource = SDDSources.viola_local_andreas();
|
37
|
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_andreasM2();
|
38
|
static final ICdmDataSource cdmDestination = CdmDestinations.localH2();
|
39
|
|
40
|
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_portal_test_localhost();
|
41
|
|
42
|
static final UUID secUuid = UUID.fromString("fc98e890-e487-4664-ac9b-8a60fda6244c");
|
43
|
static final String sourceSecId = "viola_pub_ed_999999";
|
44
|
|
45
|
//check - import
|
46
|
static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK;
|
47
|
|
48
|
//authors
|
49
|
static final boolean doAuthors = true;
|
50
|
//references
|
51
|
static final DO_REFERENCES doReferences = DO_REFERENCES.ALL;
|
52
|
//names
|
53
|
static final boolean doTaxonNames = true;
|
54
|
static final boolean doRelNames = true;
|
55
|
|
56
|
//taxa
|
57
|
static final boolean doTaxa = true;
|
58
|
static final boolean doRelTaxa = true;
|
59
|
static final boolean doFacts = true;
|
60
|
|
61
|
|
62
|
/**
|
63
|
* @param args
|
64
|
*/
|
65
|
public static void main(String[] args) {
|
66
|
System.out.println("Start import from SDD("+ sddSource.toString() + ") ...");
|
67
|
|
68
|
//make BerlinModel Source
|
69
|
String source = sddSource;
|
70
|
ICdmDataSource destination = cdmDestination;
|
71
|
|
72
|
SDDImportConfigurator sddImportConfigurator = SDDImportConfigurator.NewInstance(source, destination);
|
73
|
|
74
|
sddImportConfigurator.setSecUuid(secUuid);
|
75
|
sddImportConfigurator.setSourceSecId(sourceSecId);
|
76
|
|
77
|
sddImportConfigurator.setDoAuthors(doAuthors);
|
78
|
sddImportConfigurator.setDoReferences(doReferences);
|
79
|
sddImportConfigurator.setDoTaxonNames(doTaxonNames);
|
80
|
sddImportConfigurator.setDoRelNames(doRelNames);
|
81
|
|
82
|
sddImportConfigurator.setDoTaxa(doTaxa);
|
83
|
sddImportConfigurator.setDoRelTaxa(doRelTaxa);
|
84
|
sddImportConfigurator.setDoFacts(doFacts);
|
85
|
|
86
|
|
87
|
sddImportConfigurator.setCheck(check);
|
88
|
sddImportConfigurator.setDbSchemaValidation(hbm2dll);
|
89
|
|
90
|
// invoke import
|
91
|
CdmDefaultImport<SDDImportConfigurator> sddImport = new CdmDefaultImport<SDDImportConfigurator>();
|
92
|
sddImport.invoke(sddImportConfigurator);
|
93
|
|
94
|
System.out.println("End import from SDD ("+ source.toString() + ")...");
|
95
|
}
|
96
|
|
97
|
|
98
|
}
|