2 * Copyright (C) 2008 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.
9 package eu
.etaxonomy
.cdm
.io
.excel
.distribution
;
11 import org
.apache
.log4j
.Logger
;
12 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
13 import eu
.etaxonomy
.cdm
.io
.common
.IImportConfigurator
;
14 import eu
.etaxonomy
.cdm
.io
.common
.ImportConfiguratorBase
;
15 import eu
.etaxonomy
.cdm
.io
.common
.ImportStateBase
;
16 import eu
.etaxonomy
.cdm
.io
.excel
.common
.ExcelImportConfiguratorBase
;
17 import eu
.etaxonomy
.cdm
.io
.excel
.common
.ExcelImportState
;
18 import eu
.etaxonomy
.cdm
.model
.reference
.Database
;
19 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
22 * @author a.babadshanjan
26 public class DistributionImportConfigurator
extends ExcelImportConfiguratorBase
implements IImportConfigurator
{
28 private static final Logger logger
= Logger
.getLogger(DistributionImportConfigurator
.class);
30 @SuppressWarnings("unchecked")
31 protected void makeIoClassList() {
32 ioClassList
= new Class
[] {
33 DistributionImport
.class
37 public static DistributionImportConfigurator
NewInstance(String url
,
38 ICdmDataSource destination
){
39 return new DistributionImportConfigurator(url
, destination
);
47 private DistributionImportConfigurator(String url
, ICdmDataSource destination
) {
48 super(url
, destination
);
55 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState()
57 public ExcelImportState
getNewState() {
58 return new ExcelImportState(this);
62 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSource()
64 public String
getSource() {
65 return (String
)super.getSource();
72 public void setSource(String fileName
) {
73 super.setSource(fileName
);
78 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
81 public ReferenceBase
getSourceReference() {
83 if (this.sourceReference
== null){
84 logger
.warn("getSource Reference not yet fully implemented");
85 sourceReference
= Database
.NewInstance();
86 sourceReference
.setTitleCache("Distribution data import");
88 return sourceReference
;
93 * @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getSourceNameString()
95 public String
getSourceNameString() {
96 if (this.getSource() == null){
99 return this.getSource();