Revision 246e1070
Added by Andreas Müller about 13 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/synthesysImport/SynthesysCacheActivator.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController; |
25 | 25 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
26 | 26 |
import eu.etaxonomy.cdm.app.common.CdmDestinations; |
27 |
import eu.etaxonomy.cdm.app.common.CdmImportSources; |
|
27 | 28 |
import eu.etaxonomy.cdm.common.ExcelUtils; |
28 | 29 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
30 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
|
29 | 31 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
30 | 32 |
import eu.etaxonomy.cdm.model.agent.Institution; |
31 | 33 |
import eu.etaxonomy.cdm.model.agent.Person; |
... | ... | |
73 | 75 |
protected ArrayList<String> gatheringAgentList = new ArrayList<String>(); |
74 | 76 |
protected ArrayList<String> identificationList = new ArrayList<String>(); |
75 | 77 |
|
76 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.UPDATE; |
|
77 |
|
|
78 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE; |
|
79 |
|
|
80 |
static ICdmDataSource desitination = CdmDestinations.localH2(); |
|
81 |
|
|
78 | 82 |
protected HSSFWorkbook hssfworkbook = null; |
79 | 83 |
|
80 | 84 |
|
... | ... | |
123 | 127 |
} catch (Exception e) { |
124 | 128 |
} |
125 | 129 |
try {String coll =unit.get("collector"); |
126 |
coll=coll.replaceAll("None", null); |
|
127 |
this.gatheringAgentList.add(coll); |
|
130 |
coll=coll.replaceAll("None", null);
|
|
131 |
this.gatheringAgentList.add(coll);
|
|
128 | 132 |
} catch (Exception e) { |
129 | 133 |
} |
130 | 134 |
try {this.identificationList.add(taxonName+" "+author); |
... | ... | |
138 | 142 |
CdmApplicationController app = null; |
139 | 143 |
TransactionStatus tx = null; |
140 | 144 |
|
141 |
app = CdmApplicationController.NewInstance(CdmDestinations.cdm_test_patricia(), hbm2dll);
|
|
145 |
app = CdmApplicationController.NewInstance(desitination, hbm2dll);
|
|
142 | 146 |
|
143 | 147 |
tx = app.startTransaction(); |
144 | 148 |
try { |
... | ... | |
434 | 438 |
* @throws URISyntaxException |
435 | 439 |
*/ |
436 | 440 |
public static void main(String[] args) throws URISyntaxException { |
437 |
URI uri = new URI("file:///home/patricia/Desktop/CDMtabular9c04a474e2_23_09_08.xls"); |
|
438 |
|
|
441 |
URI uri = CdmImportSources.SYNTHESYS_SPECIMEN(); |
|
439 | 442 |
logger.info("main method"); |
440 | 443 |
SynthesysCacheActivator abcdAct = new SynthesysCacheActivator(); |
444 |
|
|
441 | 445 |
ArrayList<HashMap<String, String>> units; |
442 | 446 |
try { |
443 | 447 |
units = ExcelUtils.parseXLS(uri); |
Also available in: Unified diff
removing all doXXX from IImportConfigurator