Search in sources :

Example 16 with Instance

use of org.collectionspace.chain.csp.schema.Instance in project application by collectionspace.

the class ServiceBindingsGeneration method doAuthorityInstanceList.

private void doAuthorityInstanceList(Record r, Element el, Namespace nsservices2) {
    Instance[] allInstances = r.getAllInstances();
    if (r.getID().equalsIgnoreCase(RECORD_ID_TERMLIST) == true) {
        // 
        // Records "termlist" and "vocab" have special relationship, so we need to do things a little differently.
        // 
        Record vocabRecord = this.spec.getRecord(RECORD_ID_VOCAB);
        allInstances = vocabRecord.getAllInstances();
    }
    if (allInstances.length > 0) {
        Element authorityInstanceList = el.addElement(new QName("AuthorityInstanceList", nsservices2));
        for (Instance instance : allInstances) {
            Element authorityInstance = authorityInstanceList.addElement(new QName("AuthorityInstance", nsservices2));
            doAuthorityInstance(instance, r, authorityInstance, nsservices2);
        }
    }
}
Also used : Instance(org.collectionspace.chain.csp.schema.Instance) QName(org.dom4j.QName) Element(org.dom4j.Element) Record(org.collectionspace.chain.csp.schema.Record)

Aggregations

Instance (org.collectionspace.chain.csp.schema.Instance)16 JSONObject (org.json.JSONObject)12 Record (org.collectionspace.chain.csp.schema.Record)11 JSONArray (org.json.JSONArray)7 UnderlyingStorageException (org.collectionspace.csp.api.persistence.UnderlyingStorageException)6 UIException (org.collectionspace.csp.api.ui.UIException)6 JSONException (org.json.JSONException)6 Field (org.collectionspace.chain.csp.schema.Field)5 ConfigException (org.collectionspace.chain.csp.config.ConfigException)3 FieldSet (org.collectionspace.chain.csp.schema.FieldSet)3 Option (org.collectionspace.chain.csp.schema.Option)3 ExistException (org.collectionspace.csp.api.persistence.ExistException)3 UnimplementedException (org.collectionspace.csp.api.persistence.UnimplementedException)3 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 ConnectionException (org.collectionspace.chain.csp.persistence.services.connection.ConnectionException)2 Structure (org.collectionspace.chain.csp.schema.Structure)2 AuthoritiesVocabulariesInitialize (org.collectionspace.chain.csp.webui.authorities.AuthoritiesVocabulariesInitialize)2 AuthoritiesVocabulariesSearchList (org.collectionspace.chain.csp.webui.authorities.AuthoritiesVocabulariesSearchList)2 RecordSearchList (org.collectionspace.chain.csp.webui.record.RecordSearchList)2