|
1 |
package eu.etaxonomy.cdm.io.api.application;
|
|
2 |
|
|
3 |
import java.util.List;
|
|
4 |
|
|
5 |
import org.apache.log4j.Logger;
|
|
6 |
import org.springframework.context.ApplicationListener;
|
|
7 |
import org.springframework.core.io.ClassPathResource;
|
|
8 |
import org.springframework.core.io.Resource;
|
|
9 |
|
|
10 |
import eu.etaxonomy.cdm.api.application.CdmApplicationController;
|
|
11 |
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
|
|
12 |
import eu.etaxonomy.cdm.database.DbSchemaValidation;
|
|
13 |
import eu.etaxonomy.cdm.database.ICdmDataSource;
|
|
14 |
|
|
15 |
public class CdmIoApplicationController extends CdmApplicationController {
|
|
16 |
@SuppressWarnings("unused")
|
|
17 |
private static final Logger logger = Logger.getLogger(CdmIoApplicationController.class);
|
|
18 |
|
|
19 |
|
|
20 |
public static final String DEFAULT_APPLICATION_CONTEXT_RESOURCE = "/eu/etaxonomy/cdm/defaultIoApplicationContext.xml";
|
|
21 |
|
|
22 |
|
|
23 |
public static CdmIoApplicationController NewInstance() {
|
|
24 |
return CdmIoApplicationController.NewInstance(getDefaultDatasource(), defaultDbSchemaValidation, false);
|
|
25 |
}
|
|
26 |
|
|
27 |
public static CdmIoApplicationController NewInstance(DbSchemaValidation dbSchemaValidation) {
|
|
28 |
return CdmIoApplicationController.NewInstance(getDefaultDatasource(), dbSchemaValidation, false);
|
|
29 |
}
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Constructor, opens an spring ApplicationContext by using the according data source and the
|
|
33 |
* default database schema validation type
|
|
34 |
* @param dataSource
|
|
35 |
*/
|
|
36 |
public static CdmIoApplicationController NewInstance(ICdmDataSource dataSource) {
|
|
37 |
return CdmIoApplicationController.NewInstance(dataSource, defaultDbSchemaValidation, false);
|
|
38 |
}
|
|
39 |
|
|
40 |
|
|
41 |
public static CdmIoApplicationController NewInstance(ICdmDataSource dataSource, DbSchemaValidation dbSchemaValidation) {
|
|
42 |
return CdmIoApplicationController.NewInstance(dataSource, dbSchemaValidation, false);
|
|
43 |
}
|
|
44 |
|
|
45 |
public static CdmIoApplicationController NewInstance(ICdmDataSource dataSource, DbSchemaValidation dbSchemaValidation, boolean omitTermLoading) {
|
|
46 |
return new CdmIoApplicationController(getClasspathResource(),dataSource, dbSchemaValidation, omitTermLoading, null);
|
|
47 |
}
|
|
48 |
|
|
49 |
/**
|
|
50 |
* @return
|
|
51 |
*/
|
|
52 |
protected static ClassPathResource getClasspathResource() {
|
|
53 |
return new ClassPathResource(DEFAULT_APPLICATION_CONTEXT_RESOURCE);
|
|
54 |
}
|
|
55 |
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Constructor.
|
|
59 |
* @param applicationContextResource
|
|
60 |
* @param dataSource
|
|
61 |
* @param dbSchemaValidation
|
|
62 |
* @param omitTermLoading
|
|
63 |
* @param progressMonitor
|
|
64 |
*/
|
|
65 |
protected CdmIoApplicationController(Resource applicationContextResource, ICdmDataSource dataSource, DbSchemaValidation dbSchemaValidation,
|
|
66 |
boolean omitTermLoading, IProgressMonitor progressMonitor) {
|
|
67 |
super(applicationContextResource, dataSource, dbSchemaValidation, omitTermLoading, progressMonitor, null);
|
|
68 |
|
|
69 |
}
|
|
70 |
|
|
71 |
}
|
bugfix for IOApplicatonControler static methods