當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript service.IdlObject.source_maps方法代碼示例

本文整理匯總了TypeScript中@eg/core/idl.service.IdlObject.source_maps方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.IdlObject.source_maps方法的具體用法?TypeScript service.IdlObject.source_maps怎麽用?TypeScript service.IdlObject.source_maps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@eg/core/idl.service.IdlObject的用法示例。


在下文中一共展示了service.IdlObject.source_maps方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: Number

        .subscribe(summary => {
            summary.metabibId = Number(metabib.id());
            summary.metabibRecords =
                metabib.source_maps().map(m => Number(m.source()));

            let promise;

            if (relatedBibIds.length > 0) {

                // Grab data for MR bib summary augmentation
                promise = this.pcrud.search('mraf', {id: relatedBibIds})
                    .pipe(tap(attr => summary.record.mattrs().push(attr)))
                    .toPromise();
            } else {

                // Metarecord has only one constituent bib.
                promise = Promise.resolve();
            }

            promise.then(() => {

                // Re-compile with augmented data
                summary.compileRecordAttrs();

                // Fetch holdings data for the metarecord
                this.getHoldingsSummary(metabib.id(), orgId, orgDepth, true)
                .then(holdingsSummary => {
                    summary.holdingsSummary = holdingsSummary;
                    observer.next(summary);
                    observer.complete();
                });
            });
        });
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:33,代碼來源:bib-record.service.ts

示例2: compileMetabib

    // 'metabib' must have its "source_maps" field fleshed.
    // Get bib summaries for all related bib records so we can
    // extract data that must be appended to the master record summary.
    compileMetabib(metabib: IdlObject,
        orgId?: number, orgDepth?: number): Observable<BibRecordSummary> {

        // TODO: Create an API similar to the one that builds a combined
        // mods blob for metarecords, except using display fields, etc.
        // For now, this seems to get the job done.

        // Non-master records
        const relatedBibIds = metabib.source_maps()
            .map(m => m.source())
            .filter(id => id !== metabib.master_record());

        let observer;
        const observable = new Observable<BibRecordSummary>(o => observer = o);

        // NOTE: getBibSummary calls getHoldingsSummary against
        // the bib record unnecessarily.  It's called again below.
        // Reconsider this approach (see also note above about API).
        this.getBibSummary(metabib.master_record(), orgId, orgDepth)
        .subscribe(summary => {
            summary.metabibId = Number(metabib.id());
            summary.metabibRecords =
                metabib.source_maps().map(m => Number(m.source()));

            let promise;

            if (relatedBibIds.length > 0) {

                // Grab data for MR bib summary augmentation
                promise = this.pcrud.search('mraf', {id: relatedBibIds})
                    .pipe(tap(attr => summary.record.mattrs().push(attr)))
                    .toPromise();
            } else {

                // Metarecord has only one constituent bib.
                promise = Promise.resolve();
            }

            promise.then(() => {

                // Re-compile with augmented data
                summary.compileRecordAttrs();

                // Fetch holdings data for the metarecord
                this.getHoldingsSummary(metabib.id(), orgId, orgDepth, true)
                .then(holdingsSummary => {
                    summary.holdingsSummary = holdingsSummary;
                    observer.next(summary);
                    observer.complete();
                });
            });
        });

        return observable;
    }
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:58,代碼來源:bib-record.service.ts


注:本文中的@eg/core/idl.service.IdlObject.source_maps方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。