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.reference.endnote.in;
|
11
|
|
12
|
import org.apache.log4j.Logger;
|
13
|
import org.jdom.Element;
|
14
|
import eu.etaxonomy.cdm.io.common.CdmImportBase;
|
15
|
|
16
|
/**
|
17
|
* @author a.mueller
|
18
|
* @created 04.08.2008
|
19
|
* @version 1.0
|
20
|
*/
|
21
|
public abstract class EndNoteImportBase extends CdmImportBase<EndnoteImportConfigurator, EndnoteImportState> {
|
22
|
private static final Logger logger = Logger.getLogger(EndNoteImportBase.class);
|
23
|
|
24
|
protected Element getXmlElement(EndnoteImportConfigurator tcsConfig){
|
25
|
Element root = tcsConfig.getSourceRoot();
|
26
|
|
27
|
if (! "xml".equals(root.getName())){
|
28
|
logger.error("Root element is not 'xml'");
|
29
|
return null;
|
30
|
}
|
31
|
if (tcsConfig.getEndnoteNamespace() == null){
|
32
|
logger.error("No namespace defined for tcs");
|
33
|
return null;
|
34
|
}
|
35
|
if (! tcsConfig.getEndnoteNamespace().equals(root.getNamespace())){
|
36
|
logger.error("Wrong namespace for element 'xml'");
|
37
|
return null;
|
38
|
}
|
39
|
//TODO prevent multiple elements
|
40
|
|
41
|
return root;
|
42
|
}
|
43
|
}
|