// Open the holdings editor UI in a new browser window/tab.
    spawnAddHoldingsUi(
        recordId: number,                   // Bib record ID
        addToVols: number[] = [],           // Add copies to existing volumes
        volumeData: NewVolumeData[] = []) { // Creating new volumes

        const raw: any[] = [];

        if (addToVols) {
            addToVols.forEach(volId => raw.push({callnumber: volId}));
        } else if (volumeData) {
            volumeData.forEach(data => raw.push(data));
        }

        if (raw.length === 0) { raw.push({}); }

        this.anonCache.setItem(null, 'edit-these-copies', {
            record_id: recordId,
            raw: raw,
            hide_vols : false,
            hide_copies : false
        }).then(key => {
            if (!key) {
                console.error('Could not create holds cache key!');
                return;
            }
            setTimeout(() => {
                const url = `/eg/staff/cat/volcopy/${key}`;
                window.open(url, '_blank');
            });
        });
    }
    // TODO: Add server-side API for sorting a set of bibs by ID.
    // See EGCatLoader/Container::fetch_mylist
    getRecordIds(): Promise<number[]> {
        const cacheKey = this.store.getLoginSessionItem(BASKET_CACHE_KEY_COOKIE);
        this.idList = [];

        if (!cacheKey) { return Promise.resolve(this.idList); }

        return this.anonCache.getItem(cacheKey, BASKET_CACHE_ATTR).then(
            list => {
                if (!list) { return this.idList; }
                this.idList = list.map(id => Number(id));
                return this.idList;
            }
        );
    }
    setRecordIds(ids: number[]): Promise<number[]> {
        this.idList = ids;

        // If we have no cache key, that's OK, assume this is the first
        // attempt at adding a value and let the server create the cache
        // key for us, then store the value in our cookie.
        const cacheKey = this.store.getLoginSessionItem(BASKET_CACHE_KEY_COOKIE);

        return this.anonCache.setItem(cacheKey, BASKET_CACHE_ATTR, this.idList)
        .then(key => {
            this.store.setLoginSessionItem(BASKET_CACHE_KEY_COOKIE, key);
            this.onChange.emit(this.idList);
            return this.idList;
        });
    }