Project

General

Profile

Download (2.95 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2017 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.media.in;
10

    
11
import java.net.URI;
12
import java.util.ArrayList;
13
import java.util.List;
14

    
15
import eu.etaxonomy.cdm.database.ICdmDataSource;
16
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer;
17
import eu.etaxonomy.cdm.io.excel.common.ExcelImportConfiguratorBase;
18
import eu.etaxonomy.cdm.model.common.Language;
19

    
20
/**
21
 * @author a.mueller
22
 \* @since 30.10.2017
23
 *
24
 */
25
public class MediaExcelImportConfigurator
26
        extends ExcelImportConfiguratorBase{
27

    
28
    private static final long serialVersionUID = -6403743396163163359L;
29

    
30
    private List<URI> baseUrls = new ArrayList<>();
31
    private Language descriptionLanguage;
32
    private Language titleLanguage;
33

    
34
    private boolean readMediaData = true;
35
    private MediaTitleEnum mediaTitle = MediaTitleEnum.NAME_TITLE_CACHE;
36

    
37
    public static MediaExcelImportConfigurator NewInstance(URI uri, ICdmDataSource destination){
38
        return new MediaExcelImportConfigurator(uri, destination, null);
39
    }
40

    
41
    /**
42
     * How to fill the media title if not explicit value is given.
43
     */
44
    public enum MediaTitleEnum{
45
        NONE,
46
        NAME_CACHE,  //use name cache
47
        NAME_TITLE_CACHE,  //use name title cache
48
        TAXON_TITLE_CACHE,   //use taxon title
49
        FILE_NAME    //use file name
50
    }
51

    
52
    /**
53
     * @param uri
54
     * @param destination
55
     * @param transformer
56
     */
57
    private MediaExcelImportConfigurator(URI uri, ICdmDataSource destination, IInputTransformer transformer) {
58
        super(uri, destination, transformer);
59
    }
60

    
61
    /**
62
     * {@inheritDoc}
63
     */
64
    @Override
65
    public MediaExcelImportState getNewState() {
66
        return new MediaExcelImportState(this);
67
    }
68

    
69
    /**
70
     * {@inheritDoc}
71
     */
72
    @Override
73
    protected void makeIoClassList() {
74
        ioClassList = new Class[]{
75
                MediaExcelImport.class,
76
        };
77

    
78
    }
79

    
80
    /**
81
     * @return
82
     */
83
    public List<URI> getBaseUrls() {
84
        return baseUrls ;
85
    }
86

    
87

    
88
    public Language getDescriptionLanguage() {
89
        return this.descriptionLanguage;
90
    }
91
    public void setDescriptionLanguage(Language descriptionLanguage) {
92
        this.descriptionLanguage = descriptionLanguage;
93
    }
94

    
95
    public Language getTitleLanguage() {
96
        return titleLanguage;
97
    }
98
    public void setTitleLanguage(Language titleLanguage) {
99
        this.titleLanguage = titleLanguage;
100
    }
101

    
102
    public boolean isReadMediaData() {
103
        return readMediaData;
104
    }
105
    public void setReadMediaData(boolean readMediaData) {
106
        this.readMediaData = readMediaData;
107
    }
108

    
109
    public MediaTitleEnum getMediaTitle() {
110
        return mediaTitle;
111
    }
112
    public void setMediaTitle(MediaTitleEnum mediaTitle) {
113
        this.mediaTitle = mediaTitle;
114
    }
115

    
116

    
117
}
(2-2/4)