2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.io
.cuba
;
13 import java
.util
.UUID
;
15 import org
.apache
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
18 import eu
.etaxonomy
.cdm
.io
.common
.ImportStateBase
;
19 import eu
.etaxonomy
.cdm
.io
.common
.mapping
.IInputTransformer
;
20 import eu
.etaxonomy
.cdm
.io
.excel
.common
.ExcelImportConfiguratorBase
;
21 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalCode
;
22 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
23 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceFactory
;
30 public class CubaImportConfigurator
extends ExcelImportConfiguratorBase
{
32 private static final long serialVersionUID
= 5590553979984931651L;
34 @SuppressWarnings("unused")
35 private static Logger logger
= Logger
.getLogger(CubaImportConfigurator
.class);
37 private String cubaReferenceTitle
;
39 private UUID uuidCyprusReference
= UUID
.fromString("b5281cd3-9d5d-4ae2-8d55-b62a592ce846");
41 private boolean isDoTaxa
;
43 private boolean doVocabularies
;
44 public void setDoVocabularies(boolean doVocabularies
) {this.doVocabularies
= doVocabularies
;}
45 public boolean isDoVocabularies() {return doVocabularies
;}
47 private static IInputTransformer defaultTransformer
= new CubaTransformer();
49 public static CubaImportConfigurator
NewInstance(URI source
, ICdmDataSource destination
){
50 return new CubaImportConfigurator(source
, destination
);
54 protected void makeIoClassList(){
55 ioClassList
= new Class
[]{
56 CubaVocabularyImport
.class,
62 public ImportStateBase
getNewState() {
63 return new CubaImportState(this);
68 private CubaImportConfigurator(URI source
, ICdmDataSource destination
) {
69 super(source
, destination
, defaultTransformer
);
70 setNomenclaturalCode(NomenclaturalCode
.ICNAFP
);
72 setDestination(destination
);
77 public URI
getSource() {
78 return super.getSource();
81 public void setSource(URI source
) {
82 super.setSource(source
);
86 public Reference
getSourceReference() {
87 if (sourceReference
== null){
88 sourceReference
= ReferenceFactory
.newDatabase();
89 if (getSource() != null){
90 sourceReference
.setTitleCache(getCubaReferenceTitle(), true);
93 return sourceReference
;
97 public String
getSourceNameString() {
98 return getSource().toString();
102 public void setUuidCyprusReference(UUID uuidCyprusReference
) {
103 this.uuidCyprusReference
= uuidCyprusReference
;
107 public UUID
getUuidCyprusReference() {
108 return uuidCyprusReference
;
112 public void setCubaReferenceTitle(String cyprusReferenceTitle
) {
113 this.cubaReferenceTitle
= cyprusReferenceTitle
;
117 public String
getCubaReferenceTitle() {
118 return cubaReferenceTitle
;
121 public void setDoTaxa(boolean isDoTaxa
) {
122 this.isDoTaxa
= isDoTaxa
;
125 public boolean isDoTaxa() {