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
.net
.URISyntaxException
;
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 ValRosandraFRIDAKeyUpdateActivator
{
30 @SuppressWarnings("unused")
31 private static Logger logger
= Logger
.getLogger(ValRosandraFRIDAKeyUpdateActivator
.class);
33 //database validation status (create, update, validate ...)
34 static DbSchemaValidation hbm2dll
= DbSchemaValidation
.CREATE
;
35 static final String sddSource
= SDDSources
.ValRosandraFRIDAKey_local();
36 static final ICdmDataSource cdmDestination
= CdmDestinations
.localH2();
38 // static final ICdmDataSource cdmDestination = CdmDestinations.cdm_portal_test_localhost();
40 static final String sourceSecId
= "ValRosandraFRIDAKey_pub_ed_999999";
43 static final CHECK check
= CHECK
.IMPORT_WITHOUT_CHECK
;
48 public static void main(String
[] args
) {
49 System
.out
.println("Start import from SDD("+ sddSource
.toString() + ") ...");
54 source
= new URI(sddSource
);
56 ICdmDataSource destination
= cdmDestination
;
58 SDDImportConfigurator sddImportConfigurator
= SDDImportConfigurator
.NewInstance(source
, destination
);
60 sddImportConfigurator
.setSourceSecId(sourceSecId
);
62 sddImportConfigurator
.setCheck(check
);
63 sddImportConfigurator
.setDbSchemaValidation(hbm2dll
);
66 CdmDefaultImport
<SDDImportConfigurator
> sddImport
= new CdmDefaultImport
<SDDImportConfigurator
>();
68 sddImport
.invoke(sddImportConfigurator
);
69 System
.out
.println("End import from SDD ("+ source
.toString() + ")...");
70 } catch (URISyntaxException e
) {