Revision 8422c0cd
Added by Andreas Müller almost 8 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/cyprus/CyprusSpecimenActivator.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
31 | 31 |
public class CyprusSpecimenActivator { |
32 | 32 |
@SuppressWarnings("unused") |
33 | 33 |
private static final Logger logger = Logger.getLogger(CyprusSpecimenActivator.class); |
34 |
|
|
34 |
|
|
35 | 35 |
//database validation status (create, update, validate ...) |
36 | 36 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.VALIDATE; |
37 | 37 |
static final URI source = cyprus_specimen_local(); |
38 | 38 |
|
39 |
|
|
39 |
|
|
40 | 40 |
// static final ICdmDataSource cdmDestination = CdmDestinations.localH2(); |
41 | 41 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_mysql(); |
42 | 42 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_cyprus_dev(); |
43 | 43 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_cyprus_production(); |
44 | 44 |
|
45 |
|
|
45 |
|
|
46 | 46 |
//check - import |
47 | 47 |
static final CHECK check = CHECK.IMPORT_WITHOUT_CHECK; |
48 |
|
|
48 |
|
|
49 | 49 |
//taxa |
50 | 50 |
// static final boolean doTaxa = false; |
51 | 51 |
// static final boolean doDeduplicate = false; |
52 | 52 |
// static final boolean doDistribution = true; |
53 | 53 |
|
54 |
|
|
54 |
|
|
55 | 55 |
private void doImport(ICdmDataSource cdmDestination){ |
56 |
|
|
56 |
|
|
57 | 57 |
//make Source |
58 | 58 |
SpecimenCdmExcelImportConfigurator config= SpecimenCdmExcelImportConfigurator.NewInstance(source, cdmDestination); |
59 | 59 |
config.setCheck(check); |
60 | 60 |
config.setDbSchemaValidation(hbm2dll); |
61 |
|
|
61 |
|
|
62 | 62 |
CdmDefaultImport myImport = new CdmDefaultImport(); |
63 | 63 |
|
64 |
|
|
64 |
|
|
65 | 65 |
//... |
66 | 66 |
if (true){ |
67 | 67 |
System.out.println("Start import from ("+ source.toString() + ") ..."); |
... | ... | |
70 | 70 |
|
71 | 71 |
System.out.println("End import from ("+ source.toString() + ")..."); |
72 | 72 |
} |
73 |
|
|
73 |
|
|
74 | 74 |
} |
75 | 75 |
|
76 |
private Reference<?> getSourceReference(String string) {
|
|
77 |
Reference<?> result = ReferenceFactory.newGeneric();
|
|
76 |
private Reference getSourceReference(String string) { |
|
77 |
Reference result = ReferenceFactory.newGeneric(); |
|
78 | 78 |
result.setTitleCache(string, true); |
79 | 79 |
return result; |
80 | 80 |
} |
81 |
|
|
81 |
|
|
82 | 82 |
//Cyprus |
83 | 83 |
public static URI cyprus_specimen_local() { |
84 | 84 |
URI sourceUrl; |
... | ... | |
91 | 91 |
} |
92 | 92 |
} |
93 | 93 |
|
94 |
|
|
94 |
|
|
95 | 95 |
|
96 | 96 |
/** |
97 | 97 |
* @param args |
... | ... | |
100 | 100 |
CyprusSpecimenActivator me = new CyprusSpecimenActivator(); |
101 | 101 |
me.doImport(cdmDestination); |
102 | 102 |
} |
103 |
|
|
103 |
|
|
104 | 104 |
} |
Also available in: Unified diff
Remove generics from Reference in cdmlib-app #5830