Project

General

Profile

Download (2.1 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2007 EDIT
3
 * European Distributed Institute of Taxonomy
4
 * http://www.e-taxonomy.eu
5
 *
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.
8
 */
9

    
10
package eu.etaxonomy.cdm.io.excel.common;
11

    
12

    
13
import java.net.URI;
14

    
15
import org.apache.log4j.Logger;
16

    
17
import eu.etaxonomy.cdm.database.ICdmDataSource;
18
import eu.etaxonomy.cdm.io.common.IImportConfigurator;
19
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
20
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
21
import eu.etaxonomy.cdm.model.reference.Reference;
22
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
23

    
24
public abstract class ExcelImportConfiguratorBase extends ImportConfiguratorBase<ExcelImportState, URI> implements IImportConfigurator{
25
	private static final Logger logger = Logger.getLogger(ExcelImportConfiguratorBase.class);
26

    
27
	//TODO
28
	private static IInputTransformer defaultTransformer = null;
29

    
30
	private int batchSize = 0;
31

    
32

    
33
	/**
34
	 * @param url
35
	 * @param destination
36
	 */
37
	protected ExcelImportConfiguratorBase(URI uri, ICdmDataSource destination) {
38
		this(uri, destination, defaultTransformer);
39
	}
40

    
41
	/**
42
	 * @param url
43
	 * @param destination
44
	 */
45
	protected ExcelImportConfiguratorBase(URI uri, ICdmDataSource destination, IInputTransformer transformer) {
46
		super(transformer);
47
		setSource(uri);
48
		setDestination(destination);
49
	}
50

    
51
	/* (non-Javadoc)
52
	 * @see eu.etaxonomy.cdm.io.common.ImportConfiguratorBase#getSourceReference()
53
	 */
54
	@Override
55
	public Reference getSourceReference() {
56
		//TODO
57
		if (this.sourceReference == null){
58
			logger.warn("getSource Reference not yet fully implemented");
59
			sourceReference = ReferenceFactory.newDatabase();
60
			sourceReference.setTitleCache("Distribution data import", true);
61
		}
62
		return sourceReference;
63
	}
64

    
65
	public boolean isReuseExistingTaxaWhenPossible() {
66
		return false;
67
	}
68

    
69
	public int getBatchSize() {
70
	    return batchSize;
71
	}
72

    
73
	public void setBatchSize(int batchSize) {
74
	    this.batchSize = batchSize;
75
	}
76

    
77

    
78

    
79
}
(1-1/5)