Search in sources :

Example 1 with ServicesStorageGenerator

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());
}
Also used : ServicesStorageGenerator(org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator) WebUI(org.collectionspace.chain.csp.webui.main.WebUI) CoreConfig(org.collectionspace.chain.csp.inner.CoreConfig) FileStorage(org.collectionspace.chain.csp.persistence.file.FileStorage) CSPManagerImpl(org.collectionspace.csp.container.impl.CSPManagerImpl) Spec(org.collectionspace.chain.csp.schema.Spec)

Example 2 with ServicesStorageGenerator

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;
}
Also used : ServicesStorageGenerator(org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator) CSPManager(org.collectionspace.csp.api.container.CSPManager) CoreConfig(org.collectionspace.chain.csp.inner.CoreConfig) CSPManagerImpl(org.collectionspace.csp.container.impl.CSPManagerImpl) TenantSpec(org.collectionspace.chain.csp.persistence.services.TenantSpec) Spec(org.collectionspace.chain.csp.schema.Spec) File(java.io.File) ConfigFinder(org.collectionspace.csp.helper.core.ConfigFinder) TestConfigFinder(org.collectionspace.csp.helper.test.TestConfigFinder)

Example 3 with ServicesStorageGenerator

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;
}
Also used : TenantSpec(org.collectionspace.chain.csp.persistence.services.TenantSpec) ServicesStorageGenerator(org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator)

Example 4 with ServicesStorageGenerator

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;
}
Also used : ServicesStorageGenerator(org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator) CSPManager(org.collectionspace.csp.api.container.CSPManager) CoreConfig(org.collectionspace.chain.csp.inner.CoreConfig) CSPDependencyException(org.collectionspace.csp.api.core.CSPDependencyException) CSPManagerImpl(org.collectionspace.csp.container.impl.CSPManagerImpl) TenantSpec(org.collectionspace.chain.csp.persistence.services.TenantSpec) Spec(org.collectionspace.chain.csp.schema.Spec) ConfigFinder(org.collectionspace.csp.helper.core.ConfigFinder) TestConfigFinder(org.collectionspace.csp.helper.test.TestConfigFinder)

Example 5 with ServicesStorageGenerator

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;
}
Also used : TenantSpec(org.collectionspace.chain.csp.persistence.services.TenantSpec) ServicesStorageGenerator(org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator)

Aggregations

ServicesStorageGenerator (org.collectionspace.chain.csp.persistence.services.ServicesStorageGenerator)5 TenantSpec (org.collectionspace.chain.csp.persistence.services.TenantSpec)4 CoreConfig (org.collectionspace.chain.csp.inner.CoreConfig)3 Spec (org.collectionspace.chain.csp.schema.Spec)3 CSPManagerImpl (org.collectionspace.csp.container.impl.CSPManagerImpl)3 CSPManager (org.collectionspace.csp.api.container.CSPManager)2 ConfigFinder (org.collectionspace.csp.helper.core.ConfigFinder)2 TestConfigFinder (org.collectionspace.csp.helper.test.TestConfigFinder)2 File (java.io.File)1 FileStorage (org.collectionspace.chain.csp.persistence.file.FileStorage)1 WebUI (org.collectionspace.chain.csp.webui.main.WebUI)1 CSPDependencyException (org.collectionspace.csp.api.core.CSPDependencyException)1