use of org.collectionspace.chain.csp.persistence.services.authorization.AuthorizationStorage in project application by collectionspace.
the class ServicesStorageGenerator method real_init.
private void real_init(CSPManager cspManager, Spec spec, boolean forXsdGeneration) throws CSPDependencyException {
try {
ServicesConnection conn = new ServicesConnection(base_url, ims_url);
for (Record r : spec.getAllRecords()) {
if (r.isType("blob") || r.isType("report") || r.isType("batch"))
addChild(r.getID(), new BlobStorage(spec.getRecord(r.getID()), conn));
else if (r.isType("userdata"))
addChild(r.getID(), new UserStorage(spec.getRecord(r.getID()), conn));
else if (r.isType("record") || r.isType("searchall"))
addChild(r.getID(), new RecordStorage(spec.getRecord(r.getID()), conn));
else if (r.isType("authority"))
addChild(r.getID(), new ConfiguredVocabStorage(spec.getRecord(r.getID()), conn));
else if (r.isType("authorizationdata"))
addChild(r.getID(), new AuthorizationStorage(spec.getRecord(r.getID()), conn));
}
addChild("direct", new DirectRedirector(spec));
addChild("id", new ServicesIDGenerator(conn, spec));
addChild("relations", new ServicesRelationStorage(conn, spec));
//
if (forXsdGeneration == false) {
initializeAuthorities(cspManager, spec);
}
} catch (Exception e) {
e.printStackTrace();
// XXX wrong type
throw new CSPDependencyException("Could not set target", e);
}
}
Aggregations