2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.app
.sdd
;
13 import java
.util
.UUID
;
15 import org
.apache
.log4j
.Logger
;
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
.sdd
.in
.SDDImportConfigurator
;
29 public class AnthuriumActivator
{
30 @SuppressWarnings("unused")
31 private static final Logger logger
= Logger
.getLogger(ViolaActivator
.class);
33 //database validation status (create, update, validate ...)
34 static DbSchemaValidation hbm2dll
= DbSchemaValidation
.CREATE
;
35 static final URI sddSource
= SDDSources
.tdwg_expert();
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();
40 // static final ICdmDataSource cdmDestination = CdmDestinations.cdm_portal_test_localhost();
42 static final UUID secUuid
= UUID
.fromString("fc98e890-e487-4664-ac9b-8a60fda6244c");
43 static final String sourceSecId
= "viola_pub_ed_999999";
46 static final CHECK check
= CHECK
.IMPORT_WITHOUT_CHECK
;
51 public static void main(String
[] args
) {
52 System
.out
.println("Start import from SDD("+ sddSource
.toString() + ") ...");
58 ICdmDataSource destination
= cdmDestination
;
60 SDDImportConfigurator sddImportConfigurator
= SDDImportConfigurator
.NewInstance(source
, destination
);
62 sddImportConfigurator
.setSecUuid(secUuid
);
63 sddImportConfigurator
.setSourceSecId(sourceSecId
);
65 sddImportConfigurator
.setCheck(check
);
66 sddImportConfigurator
.setDbSchemaValidation(hbm2dll
);
69 CdmDefaultImport
<SDDImportConfigurator
> sddImport
= new CdmDefaultImport
<SDDImportConfigurator
>();
70 sddImport
.invoke(sddImportConfigurator
);
72 System
.out
.println("End import from SDD ("+ source
.toString() + ")...");
73 } catch (Exception e
) {