Project

General

Profile

Download (2.74 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.specimen.abcd206.in;
11

    
12
import java.io.ByteArrayOutputStream;
13
import java.io.InputStream;
14
import java.io.PrintStream;
15
import java.util.ArrayList;
16
import java.util.List;
17

    
18
import org.apache.log4j.Logger;
19

    
20
import eu.etaxonomy.cdm.io.common.MapWrapper;
21
import eu.etaxonomy.cdm.io.specimen.SpecimenImportStateBase;
22
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
23

    
24
/**
25
 * @author a.mueller
26
 * @created 11.05.2009
27
 * @version 1.0
28
 */
29
public class Abcd206ImportState extends SpecimenImportStateBase<Abcd206ImportConfigurator<Abcd206ImportState, InputStream>, Abcd206ImportState>{
30
	@SuppressWarnings("unused")
31
	private static final Logger logger = Logger.getLogger(Abcd206ImportState.class);
32

    
33

    
34
	private String prefix;
35
	MapWrapper<TeamOrPersonBase<?>> personStore;
36

    
37
	private List<String> associatedUnitIds = new ArrayList<String>();
38

    
39

    
40

    
41

    
42
	//private Abcd206DataHolder dataHolder;
43

    
44

    
45

    
46

    
47

    
48
//****************** CONSTRUCTOR ***************************************************/
49

    
50
	/**
51
     * @return the personStore
52
     */
53
    public MapWrapper<TeamOrPersonBase<?>> getPersonStore() {
54
        return personStore;
55
    }
56

    
57
    /**
58
     * @param personStore the personStore to set
59
     */
60
    public void setPersonStore(MapWrapper<TeamOrPersonBase<?>> personStore) {
61
        this.personStore = personStore;
62
    }
63

    
64
    public Abcd206ImportState(Abcd206ImportConfigurator config) {
65
		super(config);
66
        setReport(new SpecimenImportReport());
67
        setTransformer(new AbcdTransformer());
68
	}
69

    
70
//************************ GETTER / SETTER *****************************************/
71

    
72

    
73

    
74
    @Override
75
    public Abcd206DataHolder getDataHolder() {
76
        return (Abcd206DataHolder)dataHolder;
77
    }
78

    
79
    public void setDataHolder(Abcd206DataHolder dataHolder) {
80
        this.dataHolder = dataHolder;
81
    }
82

    
83

    
84

    
85

    
86

    
87

    
88

    
89
    public void setPrefix(String prefix) {
90
        this.prefix = prefix;
91
    }
92

    
93
    public String getPrefix() {
94
        return prefix;
95
    }
96

    
97

    
98
    @Override
99
    public byte[] getReportAsByteArray() {
100
        ByteArrayOutputStream importStream = new ByteArrayOutputStream();
101
        getReport().printReport(new PrintStream(importStream));
102
        return importStream.toByteArray();
103
    }
104

    
105
    public void setAssociatedUnitIds(List<String> associatedUnitIds){
106
        this.associatedUnitIds = associatedUnitIds;
107
    }
108

    
109
    public List<String> getAssociatedUnitIds(){
110
        return this.associatedUnitIds;
111
    }
112

    
113
//
114
//    public void reset() {
115
//        getDataHolder().reset();
116
//        setDerivedUnitBase(null);
117
//    }
118
}
(4-4/14)