Search in sources :

Example 11 with ConfigRoot

use of org.collectionspace.chain.csp.config.ConfigRoot in project application by collectionspace.

the class TestData method getSpec.

public final Spec getSpec(ServletTester tester) {
    if (this.spec == null) {
        CSPManager cspm = new CSPManagerImpl();
        cspm.register(new CoreConfig());
        cspm.register(new Spec());
        try {
            cspm.go();
            tester.getAttribute("config-filename");
            String filename = (String) tester.getAttribute("config-filename");
            cspm.configure(getSource(filename), new ConfigFinder(null), false);
        } catch (CSPDependencyException e) {
            log.info("CSPManagerImpl failed");
            log.info(tester.getAttribute("config-filename").toString());
            log.info(e.getLocalizedMessage());
        }
        ConfigRoot root = cspm.getConfigRoot();
        Spec spec = (Spec) root.getRoot(Spec.SPEC_ROOT);
        this.spec = spec;
    }
    return this.spec;
}
Also used : ConfigRoot(org.collectionspace.chain.csp.config.ConfigRoot) 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) Spec(org.collectionspace.chain.csp.schema.Spec) ConfigFinder(org.collectionspace.csp.helper.core.ConfigFinder) TestConfigFinder(org.collectionspace.csp.helper.test.TestConfigFinder)

Example 12 with ConfigRoot

use of org.collectionspace.chain.csp.config.ConfigRoot in project application by collectionspace.

the class ServiceConfigGeneration method createSpec.

private Spec createSpec(CSPManager cspm) {
    ConfigRoot root = cspm.getConfigRoot();
    Spec spec = (Spec) root.getRoot(Spec.SPEC_ROOT);
    return spec;
}
Also used : ConfigRoot(org.collectionspace.chain.csp.config.ConfigRoot) TenantSpec(org.collectionspace.chain.csp.persistence.services.TenantSpec) Spec(org.collectionspace.chain.csp.schema.Spec)

Example 13 with ConfigRoot

use of org.collectionspace.chain.csp.config.ConfigRoot in project application by collectionspace.

the class TestServices method getSpec.

private Spec getSpec(CSPManager cspm) {
    ConfigRoot root = cspm.getConfigRoot();
    Spec spec = (Spec) root.getRoot(Spec.SPEC_ROOT);
    assertNotNull(spec);
    return spec;
}
Also used : ConfigRoot(org.collectionspace.chain.csp.config.ConfigRoot) TenantSpec(org.collectionspace.chain.csp.persistence.services.TenantSpec) Spec(org.collectionspace.chain.csp.schema.Spec)

Aggregations

ConfigRoot (org.collectionspace.chain.csp.config.ConfigRoot)13 Spec (org.collectionspace.chain.csp.schema.Spec)12 CSPManager (org.collectionspace.csp.api.container.CSPManager)6 CSPManagerImpl (org.collectionspace.csp.container.impl.CSPManagerImpl)5 ConfigFinder (org.collectionspace.csp.helper.core.ConfigFinder)5 CoreConfig (org.collectionspace.chain.csp.inner.CoreConfig)4 WebUI (org.collectionspace.chain.csp.webui.main.WebUI)4 UI (org.collectionspace.csp.api.ui.UI)4 JSONObject (org.json.JSONObject)3 Test (org.junit.Test)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 InputStream (java.io.InputStream)2 StringWriter (java.io.StringWriter)2 TeeInputStream (org.apache.commons.io.input.TeeInputStream)2 TenantSpec (org.collectionspace.chain.csp.persistence.services.TenantSpec)2 UIMapping (org.collectionspace.chain.csp.webui.external.UIMapping)2 CSPDependencyException (org.collectionspace.csp.api.core.CSPDependencyException)2 UIException (org.collectionspace.csp.api.ui.UIException)2 TestConfigFinder (org.collectionspace.csp.helper.test.TestConfigFinder)2 InputSource (org.xml.sax.InputSource)2