2 * Copyright (C) 2008 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
7 package eu
.etaxonomy
.cdm
.io
.jaxb
;
10 import java
.io
.FileOutputStream
;
11 import java
.io
.FileWriter
;
12 import java
.io
.OutputStreamWriter
;
13 import java
.io
.PrintWriter
;
14 import java
.io
.Writer
;
15 import java
.util
.ArrayList
;
16 import java
.util
.Collection
;
17 import java
.util
.GregorianCalendar
;
18 import java
.util
.HashSet
;
19 import java
.util
.List
;
22 import org
.apache
.log4j
.Logger
;
23 import org
.springframework
.test
.context
.ContextConfiguration
;
24 import org
.springframework
.transaction
.TransactionStatus
;
25 import org
.unitils
.database
.annotations
.TestDataSource
;
26 import org
.unitils
.database
.annotations
.Transactional
;
27 import org
.unitils
.database
.util
.TransactionMode
;
28 import org
.unitils
.spring
.annotation
.SpringApplicationContext
;
30 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationController
;
31 import eu
.etaxonomy
.cdm
.common
.AccountStore
;
32 import eu
.etaxonomy
.cdm
.database
.CdmDataSource
;
33 import eu
.etaxonomy
.cdm
.database
.DataSourceNotFoundException
;
34 import eu
.etaxonomy
.cdm
.database
.DbSchemaValidation
;
35 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
36 import eu
.etaxonomy
.cdm
.model
.agent
.Agent
;
37 import eu
.etaxonomy
.cdm
.model
.agent
.Institution
;
38 import eu
.etaxonomy
.cdm
.model
.agent
.InstitutionalMembership
;
39 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
40 import eu
.etaxonomy
.cdm
.model
.common
.AnnotatableEntity
;
41 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
42 import eu
.etaxonomy
.cdm
.model
.common
.Keyword
;
43 import eu
.etaxonomy
.cdm
.model
.common
.LanguageStringBase
;
44 import eu
.etaxonomy
.cdm
.model
.common
.ReferencedEntityBase
;
45 import eu
.etaxonomy
.cdm
.model
.common
.RelationshipBase
;
46 import eu
.etaxonomy
.cdm
.model
.common
.Representation
;
47 import eu
.etaxonomy
.cdm
.model
.common
.TermBase
;
48 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
49 import eu
.etaxonomy
.cdm
.model
.common
.TimePeriod
;
50 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
51 import eu
.etaxonomy
.cdm
.model
.common
.init
.TermNotFoundException
;
52 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
53 import eu
.etaxonomy
.cdm
.model
.name
.BotanicalName
;
54 import eu
.etaxonomy
.cdm
.model
.name
.HomotypicalGroup
;
55 import eu
.etaxonomy
.cdm
.model
.name
.NomenclaturalStatus
;
56 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
57 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
58 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
59 import eu
.etaxonomy
.cdm
.model
.reference
.Book
;
60 import eu
.etaxonomy
.cdm
.model
.reference
.Database
;
61 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
62 import eu
.etaxonomy
.cdm
.model
.reference
.StrictReferenceBase
;
63 import eu
.etaxonomy
.cdm
.model
.taxon
.Synonym
;
64 import eu
.etaxonomy
.cdm
.model
.taxon
.SynonymRelationship
;
65 import eu
.etaxonomy
.cdm
.model
.taxon
.SynonymRelationshipType
;
66 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
67 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
68 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonRelationship
;
71 * @author a.babadshanjan
74 public class CdmExporter
{
76 private static final Logger logger
= Logger
.getLogger(CdmExporter
.class);
78 private CdmDocumentBuilder cdmDocumentBuilder
= null;
80 public CdmExporter() {
83 private void retrieveData (JaxbExportImportConfigurator expImpConfig
, DataSet dataSet
) {
85 final int MAX_ROWS
= 50000;
86 int numberOfRows
= expImpConfig
.getMaxRows();
87 CdmApplicationController appCtr
=
88 expImpConfig
.getSourceAppController(expImpConfig
.getCdmSource(), false);
90 int agentRows
= numberOfRows
;
91 int definedTermBaseRows
= numberOfRows
;
92 int referenceBaseRows
= numberOfRows
;
93 int taxonNameBaseRows
= numberOfRows
;
94 int taxonBaseRows
= numberOfRows
;
95 int relationshipRows
= numberOfRows
;
96 int occurrencesRows
= numberOfRows
;
97 int mediaRows
= numberOfRows
;
98 int featureDataRows
= numberOfRows
;
99 int languageDataRows
= numberOfRows
;
100 int termVocabularyRows
= numberOfRows
;
101 int homotypicalGroupRows
= numberOfRows
;
103 if (expImpConfig
.isDoTermVocabularies() == true) {
104 if (termVocabularyRows
== 0) { termVocabularyRows
= MAX_ROWS
; }
105 logger
.info("# TermVocabulary");
106 dataSet
.setTermVocabularies(appCtr
.getTermService().getAllTermVocabularies(MAX_ROWS
, 0));;
109 if (expImpConfig
.isDoLanguageData() == true) {
110 if (languageDataRows
== 0) { languageDataRows
= MAX_ROWS
; }
111 logger
.info("# Representation, Language String");
112 dataSet
.setLanguageData(appCtr
.getTermService().getAllRepresentations(MAX_ROWS
, 0));
113 dataSet
.addLanguageData(appCtr
.getTermService().getAllLanguageStrings(MAX_ROWS
, 0));
116 if (expImpConfig
.isDoTerms() == true) {
117 if (definedTermBaseRows
== 0) { definedTermBaseRows
= appCtr
.getTermService().count(DefinedTermBase
.class); }
118 logger
.info("# DefinedTermBase: " + definedTermBaseRows
);
119 dataSet
.setTerms(appCtr
.getTermService().getAllDefinedTerms(definedTermBaseRows
, 0));
122 if (expImpConfig
.isDoAgents() == true) {
123 if (agentRows
== 0) { agentRows
= appCtr
.getAgentService().count(Agent
.class); }
124 logger
.info("# Agents: " + agentRows
);
125 //logger.info(" # Team: " + appCtr.getAgentService().count(Team.class));
126 dataSet
.setAgents(appCtr
.getAgentService().getAllAgents(agentRows
, 0));
129 if (expImpConfig
.isDoReferences() == true) {
130 if (referenceBaseRows
== 0) { referenceBaseRows
= appCtr
.getReferenceService().count(ReferenceBase
.class); }
131 logger
.info("# ReferenceBase: " + referenceBaseRows
);
132 dataSet
.setReferences(appCtr
.getReferenceService().getAllReferences(referenceBaseRows
, 0));
135 if (expImpConfig
.isDoTaxonNames() == true) {
136 if (taxonNameBaseRows
== 0) { taxonNameBaseRows
= appCtr
.getNameService().count(TaxonNameBase
.class); }
137 logger
.info("# TaxonNameBase: " + taxonNameBaseRows
);
138 //logger.info(" # Taxon: " + appCtr.getNameService().count(BotanicalName.class));
139 dataSet
.setTaxonomicNames(appCtr
.getNameService().getAllNames(taxonNameBaseRows
, 0));
142 if (expImpConfig
.isDoHomotypicalGroups() == true) {
143 if (homotypicalGroupRows
== 0) { homotypicalGroupRows
= MAX_ROWS
; }
144 logger
.info("# Homotypical Groups");
145 dataSet
.setHomotypicalGroups(appCtr
.getNameService().getAllHomotypicalGroups(homotypicalGroupRows
, 0));
148 if (expImpConfig
.isDoTaxa() == true) {
149 if (taxonBaseRows
== 0) { taxonBaseRows
= appCtr
.getTaxonService().count(TaxonBase
.class); }
150 logger
.info("# TaxonBase: " + taxonBaseRows
);
151 dataSet
.setTaxa(new ArrayList
<Taxon
>());
152 dataSet
.setSynonyms(new ArrayList
<Synonym
>());
153 List
<TaxonBase
> tb
= appCtr
.getTaxonService().getAllTaxa(taxonBaseRows
, 0);
154 for (TaxonBase taxonBase
: tb
) {
155 if (taxonBase
instanceof Taxon
) {
156 dataSet
.addTaxon((Taxon
)taxonBase
);
157 } else if (taxonBase
instanceof Synonym
) {
158 dataSet
.addSynonym((Synonym
)taxonBase
);
160 logger
.error("entry of wrong type: " + taxonBase
.toString());
166 // retrieve taxa and synonyms separately
167 // need correct count for taxa and synonyms
168 // if (taxonBaseRows == 0) { taxonBaseRows = appCtr.getTaxonService().count(TaxonBase.class); }
169 // logger.info("# Synonym: " + taxonBaseRows);
170 // dataSet.setSynonyms(new ArrayList<Synonym>());
171 // dataSet.setSynonyms(appCtr.getTaxonService().getAllSynonyms(taxonBaseRows, 0));
173 if (expImpConfig
.isDoRelationships() == true) {
174 if (relationshipRows
== 0) { relationshipRows
= MAX_ROWS
; }
175 logger
.info("# Relationships");
176 List
<RelationshipBase
> relationList
= appCtr
.getTaxonService().getAllRelationships(relationshipRows
, 0);
177 Set
<RelationshipBase
> relationSet
= new HashSet
<RelationshipBase
>(relationList
);
178 dataSet
.setRelationships(relationSet
);
181 if (expImpConfig
.isDoReferencedEntities() == true) {
182 logger
.info("# Referenced Entities");
183 dataSet
.setReferencedEntities(appCtr
.getNameService().getAllNomenclaturalStatus(MAX_ROWS
, 0));
184 dataSet
.addReferencedEntities(appCtr
.getNameService().getAllTypeDesignations(MAX_ROWS
, 0));
187 if (expImpConfig
.isDoOccurrences() == true) {
188 if (occurrencesRows
== 0) { occurrencesRows
= appCtr
.getOccurrenceService().count(SpecimenOrObservationBase
.class); }
189 logger
.info("# SpecimenOrObservationBase: " + occurrencesRows
);
190 dataSet
.setOccurrences(appCtr
.getOccurrenceService().getAllSpecimenOrObservationBases(occurrencesRows
, 0));
193 if (expImpConfig
.isDoMedia() == true) {
194 if (mediaRows
== 0) { mediaRows
= MAX_ROWS
; }
195 logger
.info("# Media");
196 dataSet
.setMedia(appCtr
.getMediaService().getAllMedia(mediaRows
, 0));
197 // dataSet.addMedia(appCtr.getMediaService().getAllMediaRepresentations(mediaRows, 0));
198 // dataSet.addMedia(appCtr.getMediaService().getAllMediaRepresentationParts(mediaRows, 0));
201 if (expImpConfig
.isDoFeatureData() == true) {
202 if (featureDataRows
== 0) { featureDataRows
= MAX_ROWS
; }
203 logger
.info("# Feature Tree, Feature Node");
204 dataSet
.setFeatureData(appCtr
.getDescriptionService().getFeatureNodesAll());
205 dataSet
.addFeatureData(appCtr
.getDescriptionService().getFeatureTreesAll());
209 /** Saves data in DB */
210 private void saveData (JaxbExportImportConfigurator expImpConfig
, DataSet dataSet
) {
212 Collection
<TaxonBase
> taxonBases
;
214 List
<DefinedTermBase
> terms
;
215 List
<ReferenceBase
> references
;
216 List
<TaxonNameBase
> taxonomicNames
;
217 List
<DescriptionBase
> descriptions
;
218 List
<ReferencedEntityBase
> referencedEntities
;
219 List
<SpecimenOrObservationBase
> occurrences
;
220 List
<VersionableEntity
> featureData
;
221 List
<VersionableEntity
> media
;
222 List
<LanguageStringBase
> languageData
= new ArrayList
<LanguageStringBase
>();
223 List
<TermVocabulary
<DefinedTermBase
>> termVocabularies
224 = new ArrayList
<TermVocabulary
<DefinedTermBase
>>();
225 List
<HomotypicalGroup
> homotypicalGroups
= new ArrayList
<HomotypicalGroup
>();
227 CdmApplicationController appCtr
=
228 //expImpConfig.getSourceAppController(expImpConfig.getCdmSource(), true);
229 expImpConfig
.getDestinationAppController(expImpConfig
.getCdmDestination(), true);
230 TransactionStatus txStatus
= appCtr
.startTransaction();
232 // If data of a certain type, such as terms, are not saved here explicitly,
233 // then only those data of this type that are referenced by other objects are saved implicitly.
234 // For example, if taxa are saved all other data referenced by those taxa, such as synonyms,
235 // are automatically saved as well.
237 // if (expImpConfig.isDoTerms() == true) {
238 // if ((terms = dataSet.getTerms()).size() > 0) {
239 // logger.info("Terms: " + terms.size());
240 // appCtr.getTermService().saveTermsAll(terms);
244 if ((terms
= dataSet
.getTerms()) != null) {
245 logger
.info("Terms: " + terms
.size());
246 appCtr
.getTermService().saveTermsAll(terms
);
249 if (expImpConfig
.isDoTermVocabularies() == true) {
250 if ((termVocabularies
= dataSet
.getTermVocabularies()).size() > 0) {
251 logger
.info("Language data: " + termVocabularies
.size());
252 appCtr
.getTermService().saveTermVocabulariesAll(termVocabularies
);
256 if (expImpConfig
.isDoAgents() == true) {
257 if ((agents
= dataSet
.getAgents()) != null) {
258 logger
.info("Agents: " + agents
.size());
259 appCtr
.getAgentService().saveAgentAll(agents
);
263 if (expImpConfig
.isDoReferences() == true) {
264 if ((references
= dataSet
.getReferences()) != null) {
265 logger
.info("References: " + references
.size());
266 appCtr
.getReferenceService().saveReferenceAll(references
);
270 if (expImpConfig
.isDoTaxonNames() == true) {
271 if ((taxonomicNames
= dataSet
.getTaxonomicNames()) != null) {
272 logger
.info("Taxonomic names: " + taxonomicNames
.size());
273 appCtr
.getNameService().saveTaxonNameAll(taxonomicNames
);
277 if (expImpConfig
.isDoHomotypicalGroups() == true) {
278 if ((homotypicalGroups
= dataSet
.getHomotypicalGroups()) != null) {
279 logger
.info("Homotypical groups: " + homotypicalGroups
.size());
280 appCtr
.getNameService().saveAllHomotypicalGroups(homotypicalGroups
);
284 // Need to get the taxa and the synonyms here.
285 if (expImpConfig
.isDoTaxa() == true) {
286 if ((taxonBases
= dataSet
.getTaxonBases()) != null) {
287 logger
.info("Taxon bases: " + taxonBases
.size());
288 appCtr
.getTaxonService().saveTaxonAll(taxonBases
);
292 // NomenclaturalStatus, TypeDesignations
293 if (expImpConfig
.isDoReferencedEntities() == true) {
294 if ((referencedEntities
= dataSet
.getReferencedEntities()) != null) {
295 logger
.info("Referenced entities: " + referencedEntities
.size());
296 appCtr
.getNameService().saveReferencedEntitiesAll(referencedEntities
);
300 // TODO: Implement dataSet.getDescriptions() and IDescriptionService.saveDescriptionAll()
301 // if ((descriptions = dataSet.getDescriptions()) != null) {
302 // logger.info("Saving " + descriptions.size() + " descriptions");
303 // appCtr.getDescriptionService().saveDescriptionAll(descriptions);
306 if (expImpConfig
.isDoOccurrences() == true) {
307 if ((occurrences
= dataSet
.getOccurrences()) != null) {
308 logger
.info("Occurrences: " + occurrences
.size());
309 appCtr
.getOccurrenceService().saveSpecimenOrObservationBaseAll(occurrences
);
313 if (expImpConfig
.isDoFeatureData() == true) {
314 if ((featureData
= dataSet
.getFeatureData()) != null) {
315 logger
.info("Feature data: " + featureData
.size());
316 appCtr
.getDescriptionService().saveFeatureDataAll(featureData
);
320 if (expImpConfig
.isDoMedia() == true) {
321 if ((media
= dataSet
.getMedia()) != null) {
322 logger
.info("Media: " + media
.size());
323 appCtr
.getMediaService().saveMediaAll(media
);
327 if (expImpConfig
.isDoLanguageData() == true) {
328 if ((languageData
= dataSet
.getLanguageData()).size() > 0) {
329 logger
.info("Language data: " + languageData
.size());
330 appCtr
.getTermService().saveLanguageDataAll(languageData
);
334 logger
.info("All data saved");
336 appCtr
.commitTransaction(txStatus
);
341 private void traverse (List
<Taxon
> taxonCollection
, DataSet dataSet
) {
343 if (taxonCollection
== null) {
347 // The following collections store data of a particular horizontal level,
348 // such as all synonyms, relationships, and children of all taxa of this level.
350 ArrayList
<Taxon
> children_
= new ArrayList
<Taxon
>();
351 Set
<Synonym
> synonyms_
= new HashSet();
352 Set
<TaxonRelationship
> taxonRelationships_
= new HashSet();
353 Set
<SynonymRelationship
> synonymRelationships_
= new HashSet();
354 // TODO: Count number of taxa etc. to restrict number of retrieved objects
355 int numberOfTaxa
= 0;
357 for (Taxon taxon
: taxonCollection
) {
363 logger
.debug("taxon: " + taxon
.toString());
365 // get the synonyms and synonym relationships
366 if (taxon
.hasSynonyms() == true) {
368 Set
<Synonym
> synonyms
= taxon
.getSynonyms();
369 Set
<SynonymRelationship
> synonymRelationships
= taxon
.getSynonymRelations();
371 for (Synonym synonym
: synonyms
) {
372 logger
.debug("synonym: " + synonym
.toString());
373 synonyms_
.add(synonym
);
376 for (SynonymRelationship synonymRelationship
: synonymRelationships
) {
377 logger
.debug("synonym relationship: " + synonymRelationship
.toString());
378 synonymRelationships_
.add(synonymRelationship
);
381 // If calling dataSet.addSynonyms() inside this for loop
382 // get ConcurrentModificationException.
385 // get the taxon relationships
386 if (taxon
.hasTaxonRelationships() == true) {
388 Set
<TaxonRelationship
> taxonRelationships
= taxon
.getTaxonRelations();
390 for (TaxonRelationship taxonRelationship
: taxonRelationships
) {
391 logger
.debug("taxon relationship: " + taxonRelationship
.toString());
392 taxonRelationships_
.add(taxonRelationship
);
397 logger
.debug("# children: " + taxon
.getTaxonomicChildrenCount());
398 if (taxon
.hasTaxonomicChildren() == true) {
400 Set
<Taxon
> children
= taxon
.getTaxonomicChildren();
402 for (Taxon child
: children
) {
403 children_
.add(child
);
404 logger
.debug("child: "+ child
.toString());
407 } catch (Exception e
) {
408 logger
.error("error retrieving taxon data");
414 if (synonyms_
!= null) {
415 dataSet
.addSynonyms(synonyms_
);
417 if (synonymRelationships_
!= null) {
418 dataSet
.addRelationships(synonymRelationships_
);
420 if (taxonRelationships_
!= null) {
421 dataSet
.addRelationships(taxonRelationships_
);
423 if (children_
!= null) {
424 dataSet
.addTaxa(children_
);
427 } catch (Exception e
) {
428 logger
.error("error setting DataSet structure");
432 if (children_
!= null && children_
.size() > 0) {
433 traverse(children_
, dataSet
);
438 /** Retrieves data from a CDM DB and serializes them CDM to XML.
439 * Starts with root taxa and traverses the taxonomic tree to retrieve children taxa, synonyms and relationships.
440 * Taxa that are not part of the taxonomic tree are not found.
446 public void doSerializeTaxonTree(JaxbExportImportConfigurator exImpConfig
, String filename
) {
448 String dbname
= exImpConfig
.getCdmSource().getName();
449 logger
.info("Serializing DB " + dbname
+ " to file " + filename
);
451 CdmApplicationController appCtr
=
452 exImpConfig
.getSourceAppController(exImpConfig
.getCdmSource(), true);
454 TransactionStatus txStatus
= appCtr
.startTransaction(true);
455 DataSet dataSet
= new DataSet();
456 List
<Taxon
> taxa
= null;
457 List
<DefinedTermBase
> terms
= null;
462 logger
.info("Load data from DB: " + dbname
);
464 taxa
= appCtr
.getTaxonService().getRootTaxa(null, null, false);
465 // CdmFetch options not yet implemented
466 //appCtr.getTaxonService().getRootTaxa(null, CdmFetch.NO_FETCH(), false);
467 dataSet
.setTaxa(taxa
);
469 dataSet
.setSynonyms(new ArrayList
<Synonym
>());
470 dataSet
.setRelationships(new HashSet
<RelationshipBase
>());
472 } catch (Exception e
) {
473 logger
.error("error setting root data");
476 // traverse the taxonomic tree
478 if (exImpConfig
.getMaxRows() <= 0) { traverse(taxa
, dataSet
); }
480 logger
.info("All data retrieved");
483 cdmDocumentBuilder
= new CdmDocumentBuilder();
484 PrintWriter writer
= new PrintWriter(new OutputStreamWriter(new FileOutputStream(filename
), "UTF8"), true);
485 cdmDocumentBuilder
.marshal(dataSet
, writer
);
487 // TODO: Split into one file per data set member to see whether performance improves?
489 logger
.info("XML file written");
490 logger
.info("Filename is: " + filename
);
492 } catch (Exception e
) {
493 logger
.error("marshalling error");
496 appCtr
.commitTransaction(txStatus
);
502 /** Retrieves data from a CDM DB and serializes them CDM to XML.
503 * Starts with root taxa and traverses the taxonomic tree to retrieve children taxa, synonyms and relationships.
504 * Taxa that are not part of the taxonomic tree are not found.
510 public void doSerialize(JaxbExportImportConfigurator expImpConfig
, String filename
) {
512 String dbname
= expImpConfig
.getCdmSource().getName();
513 logger
.info("Serializing DB " + dbname
+ " to file " + filename
);
514 logger
.debug("DbSchemaValidation = " + expImpConfig
.getCdmSourceSchemaValidation());
516 CdmApplicationController appCtr
=
517 expImpConfig
.getSourceAppController(expImpConfig
.getCdmSource(), true);
519 TransactionStatus txStatus
= appCtr
.startTransaction(true);
520 DataSet dataSet
= new DataSet();
521 List
<Taxon
> taxa
= null;
522 List
<DefinedTermBase
> terms
= null;
527 logger
.info("Retrieving data from DB");
529 retrieveData(expImpConfig
, dataSet
);
530 // retrieveAllDataFlat(appCtr, dataSet, NUMBER_ROWS_TO_RETRIEVE);
532 } catch (Exception e
) {
533 logger
.error("error setting data");
537 logger
.info("All data retrieved");
540 cdmDocumentBuilder
= new CdmDocumentBuilder();
541 PrintWriter writer
= new PrintWriter(new OutputStreamWriter(new FileOutputStream(filename
), "UTF8"), true);
542 cdmDocumentBuilder
.marshal(dataSet
, writer
);
544 // TODO: Split into one file per data set member to see whether performance improves?
546 logger
.info("XML file written");
547 logger
.info("Filename is: " + filename
);
549 } catch (Exception e
) {
550 logger
.error("marshalling error");
553 appCtr
.commitTransaction(txStatus
);
559 /** Reads data from an XML and stores them into a CDM DB.
565 public void doDeserialize(JaxbExportImportConfigurator expImpConfig
, String filename
) {
567 String dbname
= expImpConfig
.getCdmDestination().getName();
568 logger
.info("Deserializing file " + filename
+ " to DB " + dbname
);
570 DataSet dataSet
= new DataSet();
572 // unmarshalling XML file
575 cdmDocumentBuilder
= new CdmDocumentBuilder();
576 logger
.info("Unmarshalling file: " + filename
);
577 dataSet
= cdmDocumentBuilder
.unmarshal(dataSet
, new File(filename
));
579 } catch (Exception e
) {
580 logger
.error("unmarshalling error");
585 logger
.info("Saving data to DB: " + dbname
);
587 saveData(expImpConfig
, dataSet
);