Project

General

Profile

Download (1.9 KB) Statistics
| Branch: | Revision:
1
/**
2
* Copyright (C) 2019 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
package eu.etaxonomy.cdm.io.pesi.euromed;
10

    
11
import eu.etaxonomy.cdm.database.ICdmDataSource;
12
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase;
13
import eu.etaxonomy.cdm.model.reference.Reference;
14
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
15

    
16
/**
17
 * @author a.mueller
18
 * @since 08.10.2019
19
 */
20
public class EuroMedSourcesImportConfigurator
21
            extends ImportConfiguratorBase<EuroMedSourcesImportState, ICdmDataSource>{
22

    
23
    private static final long serialVersionUID = 2306216658307408917L;
24

    
25
    public static EuroMedSourcesImportConfigurator NewInstance(ICdmDataSource cdmDB) {
26
        return new EuroMedSourcesImportConfigurator(cdmDB);
27
    }
28

    
29
    protected EuroMedSourcesImportConfigurator(ICdmDataSource cdmDB) {
30
        super(null);
31
        setDestination(cdmDB);
32
    }
33

    
34
    @SuppressWarnings("unchecked")
35
    @Override
36
    public EuroMedSourcesImportState getNewState() {
37
        return new EuroMedSourcesImportState(this);
38
    }
39

    
40
    @SuppressWarnings("unchecked")
41
    @Override
42
    protected void makeIoClassList() {
43
        ioClassList = new Class[]{
44
                EuroMedSourcesImport.class
45
        };
46
    }
47

    
48
    Reference sourceRef;
49
    @Override
50
    public Reference getSourceReference() {
51
        if (sourceRef == null){
52
            sourceRef = ReferenceFactory.newDatabase();
53
    //        result.setTitle(getSourceReferenceTitle());
54
            sourceRef.getTitleCache();
55
            sourceRef.setUuid(getSourceRefUuid());
56
        }
57
        return sourceRef;
58
    }
59

    
60
    @Override
61
    public boolean isValid(){
62
        //we should make this a normal script, not an Import (it is only an update, not an import)
63
        return true;
64
    }
65

    
66
}
(2-2/3)