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
.api
.application
.CdmApplicationController
;
15 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
22 public class CdmDefaultImport
<T
extends IImportConfigurator
> extends CdmDefaultIOBase
<IImportConfigurator
> implements ICdmImporter
<T
> {
23 @SuppressWarnings("unused")
24 private static final Logger logger
= Logger
.getLogger(CdmDefaultImport
.class);
26 public boolean invoke(T config
){
27 ICdmDataSource destination
= config
.getDestination();
28 boolean omitTermLoading
= false;
29 return invoke(config
, destination
, omitTermLoading
);
32 public boolean invoke(IImportConfigurator config
, ICdmDataSource destination
, boolean omitTermLoading
){
33 boolean createNew
= false;
35 if (startApplicationController(config
, destination
, omitTermLoading
, createNew
) == false){
38 CdmApplicationAwareDefaultImport
<?
> defaultImport
= (CdmApplicationAwareDefaultImport
<?
>)getCdmAppController().applicationContext
.getBean("defaultImport");
39 return defaultImport
.invoke(config
);
44 * Starts the CdmApplicationController if not yet started
45 * @param config Configuration
46 * @param destination destination
47 * @return false if start not successful
49 public boolean startController(IImportConfigurator config
, ICdmDataSource destination
){
50 boolean omitTermLoading
= false;
51 boolean createNew
= false;
52 return startApplicationController(config
, destination
, omitTermLoading
, createNew
);