Revision 291843d5
Added by Andreas Müller over 12 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/CdmDefaultIOBase.java | ||
---|---|---|
7 | 7 |
package eu.etaxonomy.cdm.io.common; |
8 | 8 |
|
9 | 9 |
import org.apache.log4j.Logger; |
10 |
import org.springframework.core.io.ClassPathResource; |
|
10 | 11 |
|
11 | 12 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController; |
12 | 13 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration; |
... | ... | |
22 | 23 |
*/ |
23 | 24 |
public class CdmDefaultIOBase<T extends IIoConfigurator> { |
24 | 25 |
@SuppressWarnings("unused") |
25 |
private static final Logger logger = Logger |
|
26 |
.getLogger(CdmDefaultIOBase.class); |
|
26 |
private static final Logger logger = Logger.getLogger(CdmDefaultIOBase.class); |
|
27 | 27 |
|
28 |
public static final String DEFAULT_IO_APPLICATION_CONTEXT_RESOURCE = "/eu/etaxonomy/cdm/defaultIoApplicationContext.xml"; |
|
29 |
|
|
30 |
|
|
28 | 31 |
protected ICdmApplicationConfiguration cdmApp = null; |
29 | 32 |
|
30 | 33 |
/** |
... | ... | |
52 | 55 |
} |
53 | 56 |
|
54 | 57 |
if (createNew == true || cdmApp == null) { |
55 |
cdmApp = CdmApplicationController.NewInstance(cdmSource,schemaValidation, omitTermLoading); |
|
58 |
ClassPathResource applicationContextResource = new ClassPathResource(DEFAULT_IO_APPLICATION_CONTEXT_RESOURCE); |
|
59 |
cdmApp = CdmApplicationController.NewInstance(applicationContextResource, cdmSource,schemaValidation, omitTermLoading); |
|
56 | 60 |
if (cdmApp != null) { |
57 | 61 |
return true; |
58 | 62 |
} else { |
Also available in: Unified diff
bugfix use of application context in io (until now the defaultIoApplicationContext wasn't used due to a wrong implementation