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
.io
.common
;
12 import org
.apache
.log4j
.Logger
;
14 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
21 public class CdmDefaultImport
<T
extends IImportConfigurator
> extends CdmDefaultIOBase
<IImportConfigurator
> implements ICdmImporter
<T
> {
22 @SuppressWarnings("unused")
23 private static final Logger logger
= Logger
.getLogger(CdmDefaultImport
.class);
25 public boolean invoke(T config
){
26 ICdmDataSource destination
= config
.getDestination();
27 boolean omitTermLoading
= false;
28 return invoke(config
, destination
, omitTermLoading
);
31 public boolean invoke(IImportConfigurator config
, ICdmDataSource destination
, boolean omitTermLoading
){
32 boolean createNew
= false;
34 if (startApplicationController(config
, destination
, omitTermLoading
, createNew
) == false){
37 CdmApplicationAwareDefaultImport
<?
> defaultImport
= (CdmApplicationAwareDefaultImport
<?
>)getCdmAppController().getBean("defaultImport");
38 return defaultImport
.invoke(config
);
43 * Starts the CdmApplicationController if not yet started
44 * @param config Configuration
45 * @param destination destination
46 * @return false if start not successful
48 public boolean startController(IImportConfigurator config
, ICdmDataSource destination
){
49 boolean omitTermLoading
= false;
50 boolean createNew
= false;
51 return startApplicationController(config
, destination
, omitTermLoading
, createNew
);