Project

General

Profile

Download (1.6 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.common;
11

    
12
import java.util.HashMap;
13
import java.util.Map;
14
import java.util.UUID;
15

    
16
import org.apache.log4j.Logger;
17

    
18
import eu.etaxonomy.cdm.io.common.mapping.out.IExportTransformer;
19
import eu.etaxonomy.cdm.model.common.CdmBase;
20

    
21
/**
22
 * @author a.mueller
23
 * @created 11.05.2009
24
 * @version 1.0
25
 */
26
public class XmlExportState<CONFIG extends XmlExportConfiguratorBase<?>> extends ExportStateBase<CONFIG, IExportTransformer> {
27
	private static final Logger logger = Logger.getLogger(XmlExportState.class);
28

    
29
	private Map<UUID, String> xmlIdMap = new HashMap<UUID, String>();
30

    
31
	
32
//	/* (non-Javadoc)
33
//	 * @see eu.etaxonomy.cdm.io.common.IoStateBase#initialize(eu.etaxonomy.cdm.io.common.IoConfiguratorBase)
34
//	 */
35
//	@Override
36
//	public void initialize(XmlExportConfiguratorBase config) {
37
//				
38
//	}
39

    
40
	
41
	public XmlExportState(CONFIG config) {
42
		super(config);
43
	}
44

    
45
	public void putDbId(CdmBase cdmBase, String xmlId){
46
		if (cdmBase != null){
47
			xmlIdMap.put(cdmBase.getUuid(), xmlId);
48
		}else{
49
			logger.warn("CdmBase was (null) and could not be added to xmlIdMap");
50
		}
51
	}
52
	
53
	public String getDbId(CdmBase cdmBase){
54
		if (cdmBase != null){
55
			return xmlIdMap.get(cdmBase.getUuid());
56
		}else{
57
			logger.warn("CdmBase was (null). No entries in xmlIdMap available");
58
			return null;
59
		}
60
	}
61

    
62
	
63

    
64
}
(58-58/61)