24 |
24 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES;
|
25 |
25 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.EDITOR;
|
26 |
26 |
import eu.etaxonomy.cdm.io.common.Source;
|
|
27 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
|
28 |
import eu.etaxonomy.cdm.model.common.Language;
|
27 |
29 |
import eu.etaxonomy.cdm.model.description.Feature;
|
28 |
30 |
import eu.etaxonomy.cdm.model.description.FeatureNode;
|
29 |
31 |
import eu.etaxonomy.cdm.model.description.FeatureTree;
|
... | ... | |
44 |
46 |
private static final Logger logger = Logger.getLogger(EuroMedActivator.class);
|
45 |
47 |
|
46 |
48 |
//database validation status (create, update, validate ...)
|
47 |
|
static DbSchemaValidation hbm2dll = DbSchemaValidation.VALIDATE;
|
|
49 |
static DbSchemaValidation hbm2dll = DbSchemaValidation.CREATE;
|
48 |
50 |
// static final Source berlinModelSource = BerlinModelSources.euroMed();
|
49 |
|
static final Source berlinModelSource = BerlinModelSources.PESI3_euroMed();
|
|
51 |
static final Source berlinModelSource = BerlinModelSources.euroMed_PESI3();
|
50 |
52 |
|
51 |
53 |
// static final ICdmDataSource cdmDestination = CdmDestinations.cdm_pesi_euroMed();
|
52 |
54 |
static final ICdmDataSource cdmDestination = CdmDestinations.cdm_test_local_euromed();
|
... | ... | |
94 |
96 |
|
95 |
97 |
static String taxonTable = "v_cdm_exp_taxaAll";
|
96 |
98 |
static String classificationQuery = " SELECT DISTINCT t.PTRefFk, r.RefCache FROM PTaxon t INNER JOIN Reference r ON t.PTRefFk = r.RefId WHERE t.PTRefFk = " + sourceSecId;
|
97 |
|
static String relPTaxonIdQuery = " SELECT r.RelPTaxonId " +
|
|
99 |
static String relPTaxonIdQuery = " SELECT TOP (100) PERCENT r.RelPTaxonId " +
|
98 |
100 |
" FROM RelPTaxon AS r INNER JOIN v_cdm_exp_taxaDirect AS a ON r.PTNameFk2 = a.PTNameFk AND r.PTRefFk2 = a.PTRefFk" +
|
99 |
101 |
" ORDER BY r.RelPTaxonId "; // AND r.RelQualifierFk =1
|
100 |
102 |
static String nameIdTable = " v_cdm_exp_namesAll ";
|
... | ... | |
111 |
113 |
|
112 |
114 |
// **************** ALL *********************
|
113 |
115 |
|
114 |
|
// static final boolean doUser = true;
|
115 |
|
// //authors
|
116 |
|
// static final boolean doAuthors = true;
|
117 |
|
// //references
|
118 |
|
// static final DO_REFERENCES doReferences = DO_REFERENCES.ALL;
|
119 |
|
// //names
|
120 |
|
// static final boolean doTaxonNames = true;
|
121 |
|
// static final boolean doRelNames = true;
|
122 |
|
// static final boolean doNameStatus = true;
|
123 |
|
// static final boolean doTypes = false; //serious types do not exist in E+M
|
124 |
|
// static final boolean doNameFacts = true;
|
125 |
|
//
|
126 |
|
// //taxa
|
127 |
|
// static final boolean doTaxa = true;
|
128 |
|
// static final boolean doRelTaxa = true;
|
129 |
|
// static final boolean doFacts = true;
|
130 |
|
// static final boolean doOccurences = true;
|
131 |
|
// static final boolean doCommonNames = true;
|
132 |
|
//
|
133 |
|
// //etc.
|
134 |
|
// static final boolean doMarker = true;
|
135 |
|
|
136 |
|
|
137 |
|
// **************** SELECTED *********************
|
138 |
|
|
139 |
|
static final boolean doUser = false;
|
|
116 |
static final boolean doUser = true;
|
140 |
117 |
//authors
|
141 |
|
static final boolean doAuthors = false;
|
|
118 |
static final boolean doAuthors = true;
|
142 |
119 |
//references
|
143 |
|
static final DO_REFERENCES doReferences = DO_REFERENCES.NONE;
|
|
120 |
static final DO_REFERENCES doReferences = DO_REFERENCES.ALL;
|
144 |
121 |
//names
|
145 |
|
static final boolean doTaxonNames = false;
|
146 |
|
static final boolean doRelNames = false;
|
147 |
|
static final boolean doNameStatus = false;
|
148 |
|
static final boolean doTypes = false;
|
149 |
|
static final boolean doNameFacts = false;
|
|
122 |
static final boolean doTaxonNames = true;
|
|
123 |
static final boolean doRelNames = true;
|
|
124 |
static final boolean doNameStatus = true;
|
|
125 |
static final boolean doTypes = false; //serious types do not exist in E+M
|
|
126 |
static final boolean doNameFacts = true;
|
150 |
127 |
|
151 |
|
//taxa
|
152 |
|
static final boolean doTaxa = false;
|
|
128 |
//taxa
|
|
129 |
static final boolean doTaxa = true;
|
153 |
130 |
static final boolean doRelTaxa = false;
|
154 |
|
static final boolean doFacts = false;
|
|
131 |
static final boolean doFacts = true;
|
155 |
132 |
static final boolean doOccurences = true;
|
156 |
|
static final boolean doCommonNames = false;
|
157 |
|
|
|
133 |
static final boolean doCommonNames = true;
|
|
134 |
|
158 |
135 |
//etc.
|
159 |
|
static final boolean doMarker = false;
|
|
136 |
static final boolean doMarker = true;
|
|
137 |
|
|
138 |
|
|
139 |
// **************** SELECTED *********************
|
|
140 |
|
|
141 |
// static final boolean doUser = false;
|
|
142 |
// //authors
|
|
143 |
// static final boolean doAuthors = false;
|
|
144 |
// //references
|
|
145 |
// static final DO_REFERENCES doReferences = DO_REFERENCES.NONE;
|
|
146 |
// //names
|
|
147 |
// static final boolean doTaxonNames = false;
|
|
148 |
// static final boolean doRelNames = false;
|
|
149 |
// static final boolean doNameStatus = false;
|
|
150 |
// static final boolean doTypes = false;
|
|
151 |
// static final boolean doNameFacts = false;
|
|
152 |
//
|
|
153 |
// //taxa
|
|
154 |
// static final boolean doTaxa = false;
|
|
155 |
// static final boolean doRelTaxa = true;
|
|
156 |
// static final boolean doFacts = false;
|
|
157 |
// static final boolean doOccurences = false;
|
|
158 |
// static final boolean doCommonNames = false;
|
|
159 |
//
|
|
160 |
// //etc.
|
|
161 |
// static final boolean doMarker = false;
|
160 |
162 |
|
161 |
163 |
|
162 |
164 |
public void importEm2CDM (Source source, ICdmDataSource destination, DbSchemaValidation hbm2dll){
|
... | ... | |
240 |
242 |
FeatureNode commonNameNode = FeatureNode.NewInstance(Feature.COMMON_NAME());
|
241 |
243 |
tree.getRoot().addChild(commonNameNode, 3);
|
242 |
244 |
app.getFeatureTreeService().saveOrUpdate(tree);
|
|
245 |
|
|
246 |
//Change common name label
|
|
247 |
DefinedTermBase<?> commonNameFeature = app.getTermService().find(Feature.COMMON_NAME().getUuid());
|
|
248 |
commonNameFeature.setLabel("Common Names", Language.ENGLISH());
|
|
249 |
commonNameFeature.setTitleCache(null, false); //to definetely update the titleCache also
|
|
250 |
app.getTermService().saveOrUpdate(commonNameFeature);
|
243 |
251 |
}
|
244 |
252 |
|
245 |
253 |
System.out.println("End import from BerlinModel ("+ source.getDatabase() + ")...");
|
update sources and make Common Name plural for E+M