use of org.collectionspace.csp.api.container.CSPManager in project application by collectionspace.
the class ServicesBaseClass method getBaseUrl.
private String getBaseUrl() throws CSPDependencyException {
CSPManager cspm = getServiceManager();
ServicesStorageGenerator gen = (ServicesStorageGenerator) cspm.getStorage("service");
String baseurl = gen.getBase();
return baseurl;
}
use of org.collectionspace.csp.api.container.CSPManager in project application by collectionspace.
the class ServicesBaseClass method getServiceManager.
private CSPManager getServiceManager() throws CSPDependencyException {
CSPManager cspm = new CSPManagerImpl();
cspm.register(new CoreConfig());
cspm.register(new Spec());
cspm.register(new ServicesStorageGenerator());
cspm.go();
cspm.configure(getRootSource(), new ConfigFinder(null), false);
return cspm;
}
use of org.collectionspace.csp.api.container.CSPManager in project application by collectionspace.
the class ServicesBaseClass method makeServicesStorage.
protected Storage makeServicesStorage() throws CSPDependencyException {
CSPManager cspm = getServiceManager();
ConfigRoot root = cspm.getConfigRoot();
Spec spec = (Spec) root.getRoot(Spec.SPEC_ROOT);
assertNotNull(spec);
// XXX this is spec specific testing that will break when we rename the object in the UI
Record r_obj = spec.getRecord("collection-object");
assertNotNull(r_obj);
assertEquals("collection-object", r_obj.getID());
assertEquals("cataloging", r_obj.getWebURL());
StorageGenerator gen = cspm.getStorage("service");
CSPRequestCredentials creds = gen.createCredentials();
creds.setCredential(ServicesStorageGenerator.CRED_USERID, spec.getAdminData().getAuthUser());
creds.setCredential(ServicesStorageGenerator.CRED_PASSWORD, spec.getAdminData().getAuthPass());
return gen.getStorage(creds, new RequestCache());
}
use of org.collectionspace.csp.api.container.CSPManager in project application by collectionspace.
the class ServicesBaseClass method getIMSBaseUrl.
private String getIMSBaseUrl() throws CSPDependencyException {
CSPManager cspm = getServiceManager();
ServicesStorageGenerator gen = (ServicesStorageGenerator) cspm.getStorage("service");
String baseurl = gen.getIMSBase();
return baseurl;
}
use of org.collectionspace.csp.api.container.CSPManager in project application by collectionspace.
the class TestService method testXMLJSONConversion.
@Test
public void testXMLJSONConversion() throws Exception {
CSPManager cspm = new CSPManagerImpl();
cspm.register(new CoreConfig());
cspm.register(new Spec());
cspm.register(new ServicesStorageGenerator());
cspm.go();
// argh - test break when config changes *sob*
cspm.configure(getRootSource(), new ConfigFinder(null), false);
ConfigRoot root = cspm.getConfigRoot();
Spec spec = (Spec) root.getRoot(Spec.SPEC_ROOT);
testXMLJSON(spec, "location", "location.xml", "location.json");
testXMLJSON(spec, "concept", "concept.xml", "concept.json");
testXMLJSON(spec, "place", "placeXMLJSON.xml", "placeJSON.json");
testXMLJSON(spec, "citation", "citation.xml", "citation.json");
testXMLJSON(spec, "work", "work.xml", "work.json");
testXMLJSON(spec, "collection-object", "objectsXMLJSON.xml", "objectsJSON.json");
testXMLJSON(spec, "acquisition", "acquisitionXMLJSON.xml", "acquisitionJSON.json");
testXMLJSON(spec, "intake", "intake.xml", "intake.json");
testXMLJSON(spec, "loanin", "loanin.xml", "loanin.json");
testXMLJSON(spec, "loanout", "loanout.xml", "loanout.json");
testXMLJSON(spec, "valuationcontrol", "valuationcontrol.xml", "valuationcontrol.json");
testXMLJSON(spec, "movement", "movement.xml", "movement.json");
testXMLJSON(spec, "objectexit", "objectexit.xml", "objectexit.json");
testXMLJSON(spec, "group", "group.xml", "group.json");
testXMLJSON(spec, "media", "media.xml", "mediaJSON.json");
testXMLJSON(spec, "conditioncheck", "conditioncheck.xml", "conditioncheck.json");
testXMLJSON(spec, "conservation", "conservation.xml", "conservation.json");
testXMLJSON(spec, "exhibition", "exhibition.xml", "exhibition.json");
testXMLJSON(spec, "role", "role.xml", "role.json");
testXMLJSON(spec, "permrole", "rolepermissions.xml", "rolepermissions.json");
testXMLJSON(spec, "userrole", "accountrole.xml", "accountrole.json");
// testXMLJSON(spec,
// "permission","permissionXMLJSON.xml","permissionsJSON.json");
// testXMLJSON(spec,
// "organization","orgauthref.xml","permissionsJSON.json");
}
Aggregations