Revision 087d567e
Added by Katja Luther over 14 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/jaxb/JaxbExport.java | ||
---|---|---|
27 | 27 |
import eu.etaxonomy.cdm.model.agent.AgentBase; |
28 | 28 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
29 | 29 |
import eu.etaxonomy.cdm.model.common.User; |
30 |
import eu.etaxonomy.cdm.model.description.FeatureTree; |
|
30 | 31 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
31 | 32 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
32 | 33 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase; |
... | ... | |
258 | 259 |
if (jaxbExpConfig.isDoFeatureData() == true) { |
259 | 260 |
if (featureDataRows == 0) { featureDataRows = MAX_ROWS; } |
260 | 261 |
logger.info("# Feature Tree, Feature Node"); |
262 |
List<FeatureTree> featureTrees = new ArrayList<FeatureTree>(); |
|
263 |
featureTrees= getFeatureTreeService().list(null,featureDataRows, 0, null, null); |
|
264 |
List<FeatureTree> taxTreesdeproxy = new ArrayList<FeatureTree>(); |
|
265 |
for (FeatureTree featureTree : featureTrees){ |
|
266 |
HibernateProxyHelper.deproxy(featureTree); |
|
267 |
taxTreesdeproxy.add(featureTree); |
|
268 |
} |
|
261 | 269 |
dataSet.setFeatureTrees(getFeatureTreeService().list(null,null,null,null,null)); |
262 | 270 |
} |
263 | 271 |
if (jaxbExpConfig.isDoTaxonomicTreeData() == true) { |
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/jaxb/JaxbImport.java | ||
---|---|---|
135 | 135 |
// For example, if taxa are saved all other data referenced by those taxa, such as synonyms, |
136 | 136 |
// are automatically saved as well. |
137 | 137 |
|
138 |
if ((jaxbImpConfig.isDoTermVocabularies() == true) |
|
139 |
&& (termVocabularies = dataSet.getTermVocabularies()).size() > 0) { |
|
140 |
//txStatus = startTransaction(); |
|
141 |
ret &= saveTermVocabularies(termVocabularies); |
|
142 |
|
|
143 |
} |
|
138 |
|
|
144 | 139 |
|
145 | 140 |
if ((jaxbImpConfig.isDoTerms() == true) |
146 | 141 |
&& (terms = dataSet.getTerms()).size() > 0) { |
... | ... | |
149 | 144 |
|
150 | 145 |
//commitTransaction(txStatus); |
151 | 146 |
} |
147 |
if ((jaxbImpConfig.isDoTermVocabularies() == true) |
|
148 |
&& (termVocabularies = dataSet.getTermVocabularies()).size() > 0) { |
|
149 |
//txStatus = startTransaction(); |
|
150 |
ret &= saveTermVocabularies(termVocabularies); |
|
151 |
|
|
152 |
} |
|
152 | 153 |
|
153 | 154 |
// TODO: Have separate data save methods |
154 | 155 |
|
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/jaxb/JaxbImportConfigurator.java | ||
---|---|---|
15 | 15 |
import eu.etaxonomy.cdm.database.ICdmDataSource; |
16 | 16 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator; |
17 | 17 |
import eu.etaxonomy.cdm.io.common.ImportConfiguratorBase; |
18 |
import eu.etaxonomy.cdm.io.common.IImportConfigurator.DO_REFERENCES; |
|
18 | 19 |
import eu.etaxonomy.cdm.model.reference.IDatabase; |
19 | 20 |
import eu.etaxonomy.cdm.model.reference.ReferenceBase; |
20 | 21 |
import eu.etaxonomy.cdm.model.reference.ReferenceFactory; |
... | ... | |
26 | 27 |
public class JaxbImportConfigurator extends ImportConfiguratorBase implements IImportConfigurator { |
27 | 28 |
|
28 | 29 |
private static final Logger logger = Logger.getLogger(JaxbImportConfigurator.class); |
29 |
|
|
30 |
|
|
30 | 31 |
private int maxRows = 0; |
31 |
|
|
32 |
// private boolean doAgents = true; |
|
32 |
|
|
33 |
|
|
33 | 34 |
private boolean doAgentData = true; |
34 | 35 |
private boolean doLanguageData = true; |
35 | 36 |
private boolean doFeatureData = true; |
... | ... | |
50 | 51 |
|
51 | 52 |
|
52 | 53 |
|
54 |
|
|
53 | 55 |
/* (non-Javadoc) |
54 | 56 |
* @see eu.etaxonomy.cdm.io.common.IImportConfigurator#getNewState() |
55 | 57 |
*/ |
... | ... | |
64 | 66 |
public void setMaxRows(int maxRows) { |
65 | 67 |
this.maxRows = maxRows; |
66 | 68 |
} |
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
69 | 72 |
public boolean isDoAgentData() { |
70 | 73 |
return doAgentData; |
71 | 74 |
} |
72 |
|
|
75 |
|
|
73 | 76 |
public void setDoAgentData(boolean doAgentData) { |
74 | 77 |
this.doAgentData = doAgentData; |
75 | 78 |
} |
... | ... | |
170 | 173 |
super(); |
171 | 174 |
setSource(url); |
172 | 175 |
setDestination(destination); |
173 |
setDbSchemaValidation(DbSchemaValidation.VALIDATE);
|
|
176 |
setDbSchemaValidation(DbSchemaValidation.CREATE);
|
|
174 | 177 |
} |
175 | 178 |
|
176 | 179 |
|
Also available in: Unified diff
#1277 jaxb import