本文整理匯總了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();
});
});
});
示例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;
}