Search in sources :

Example 1 with UserStorage

use of org.collectionspace.chain.csp.persistence.services.user.UserStorage 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);
    }
}
Also used : AuthorizationStorage(org.collectionspace.chain.csp.persistence.services.authorization.AuthorizationStorage) CSPDependencyException(org.collectionspace.csp.api.core.CSPDependencyException) ServicesConnection(org.collectionspace.chain.csp.persistence.services.connection.ServicesConnection) Record(org.collectionspace.chain.csp.schema.Record) ConfiguredVocabStorage(org.collectionspace.chain.csp.persistence.services.vocab.ConfiguredVocabStorage) UserStorage(org.collectionspace.chain.csp.persistence.services.user.UserStorage) ServicesRelationStorage(org.collectionspace.chain.csp.persistence.services.relation.ServicesRelationStorage) UIException(org.collectionspace.csp.api.ui.UIException) CSPDependencyException(org.collectionspace.csp.api.core.CSPDependencyException)

Aggregations

AuthorizationStorage (org.collectionspace.chain.csp.persistence.services.authorization.AuthorizationStorage)1 ServicesConnection (org.collectionspace.chain.csp.persistence.services.connection.ServicesConnection)1 ServicesRelationStorage (org.collectionspace.chain.csp.persistence.services.relation.ServicesRelationStorage)1 UserStorage (org.collectionspace.chain.csp.persistence.services.user.UserStorage)1 ConfiguredVocabStorage (org.collectionspace.chain.csp.persistence.services.vocab.ConfiguredVocabStorage)1 Record (org.collectionspace.chain.csp.schema.Record)1 CSPDependencyException (org.collectionspace.csp.api.core.CSPDependencyException)1 UIException (org.collectionspace.csp.api.ui.UIException)1