use of org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator in project application by collectionspace.
the class TenantServlet method register_csps.
/* Not in the constructor because errors during construction of servlets tend to get lost in a mess of startup.
* Better present it on first request.
*/
protected void register_csps(String tenantId) throws IOException, DocumentException {
if (!tenantCSPM.containsKey(tenantId)) {
tenantCSPM.put(tenantId, new CSPManagerImpl());
}
tenantCSPM.get(tenantId).register(new CoreConfig());
tenantCSPM.get(tenantId).register(new FileStorage());
tenantCSPM.get(tenantId).register(new ServicesStorageGenerator());
tenantCSPM.get(tenantId).register(new WebUI());
tenantCSPM.get(tenantId).register(new Spec());
}
use of org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator in project application by collectionspace.
the class ServiceConfigGeneration method getServiceManager.
private CSPManager getServiceManager(File configFile) throws Exception {
CSPManager result = null;
CSPManager cspm = new CSPManagerImpl();
cspm.register(new CoreConfig());
cspm.register(new Spec());
cspm.register(new ServicesStorageGenerator());
// Do more initialization of our CSPManagerImpl instance (i.e., cspm)
cspm.go();
File configBase = configFile.getParentFile();
// Saves a copy of the base config directory
cspm.setConfigBase(configBase);
cspm.configure(getSource(configFile), new ConfigFinder(null, configBase), true);
this.setConfigBase(configBase);
this.setConfigFile(configFile);
result = cspm;
return result;
}
use of org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator in project application by collectionspace.
the class ServiceConfigGeneration method getTenantData.
private TenantSpec getTenantData(CSPManager cspm) {
ServicesStorageGenerator gen = (ServicesStorageGenerator) cspm.getStorage("service");
TenantSpec td = gen.getTenantData();
return td;
}
use of org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator in project application by collectionspace.
the class TestServices method getServiceManager.
private CSPManager getServiceManager(String filename) {
CSPManager cspm = new CSPManagerImpl();
cspm.register(new CoreConfig());
cspm.register(new Spec());
cspm.register(new ServicesStorageGenerator());
try {
cspm.go();
cspm.configure(getSource(filename), new ConfigFinder(null), false);
} catch (CSPDependencyException e) {
log.error("CSPManagerImpl failed");
log.error(e.getLocalizedMessage());
}
return cspm;
}
use of org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator in project application by collectionspace.
the class TestServices method getTenantData.
private TenantSpec getTenantData(CSPManager cspm) {
ServicesStorageGenerator gen = (ServicesStorageGenerator) cspm.getStorage("service");
TenantSpec td = gen.getTenantData();
return td;
}
Aggregations