本文整理匯總了TypeScript中@eg/core/idl.service.IdlObject類的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.IdlObject類的具體用法?TypeScript service.IdlObject怎麽用?TypeScript service.IdlObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了service.IdlObject類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: exportQueue
// Download a queue as a MARC file.
exportQueue(queue: IdlObject, nonImported?: boolean) {
const etype = queue.queue_type().match(/auth/) ? 'auth' : 'bib';
let url =
`${VANDELAY_EXPORT_PATH}?type=${etype}&queueid=${queue.id()}`;
let saveName = queue.name();
if (nonImported) {
url += '&nonimported=1';
saveName += '_nonimported';
}
saveName += '.mrc';
this.http.get(url, {responseType: 'text'}).subscribe(
data => {
saveAs(
new Blob([data], {type: 'application/octet-stream'}),
saveName
);
},
err => {
console.error(err);
}
);
}
示例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;
}
示例3: saveTree
// Server API deletes and recreates the tree on update.
// It manages parent/child relationships via the children array.
// We only need send the current tree in a form the API recognizes.
saveTree(): Promise<any> {
const compileTree = (node?: TreeNode) => {
if (!node) { node = this.tree.rootNode; }
const point = node.callerData.point;
node.children.forEach(child =>
point.children().push(compileTree(child)));
return point;
};
const rootPoint: IdlObject = compileTree();
return this.net.request(
'open-ils.vandelay',
'open-ils.vandelay.match_set.update',
this.auth.token(), this.matchSet_.id(), rootPoint
).toPromise().then(
ok => this.refreshTree(),
err => console.error(err)
);
}
示例4: matchSet
@Input() set matchSet(ms: IdlObject) {
this.matchSet_ = ms;
if (ms && !this.initDone) {
this.matchSetType = ms.mtype();
this.initDone = true;
this.refreshTree();
}
}
示例5:
(part: IdlObject) => {
this.editDialog.mode = 'update';
this.editDialog.recId = part.id();
this.editDialog.open().then(
ok => this.partsGrid.reload(),
err => {}
);
}
示例6:
(matchSet: IdlObject) => {
this.editDialog.mode = 'update';
this.editDialog.recId = matchSet.id();
this.editDialog.open({size: 'lg'}).then(
ok => this.grid.reload(),
err => {}
);
}
示例7: 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();
});
});
});
示例8: ingest
ingest() {
this.compileDisplayFields();
this.compileRecordAttrs();
// Normalize some data for JS consistency
this.record.creator(Number(this.record.creator()));
this.record.editor(Number(this.record.editor()));
}
示例9: holdForChanged
holdForChanged() {
this.user = null;
if (this.holdFor === 'patron') {
if (this.userBarcode) {
this.userBarcodeChanged();
}
} else {
// To bypass the dupe check.
this.currentUserBarcode = '_' + this.requestor.id();
this.getUser(this.requestor.id());
}
}
示例10: refreshTree
refreshTree(): Promise<any> {
if (!this.matchSet_) { return Promise.resolve(); }
return this.pcrud.search('vmsp',
{match_set: this.matchSet_.id()}, {},
{atomic: true, authoritative: true}
).toPromise().then(points => this.ingestMatchPoints(points));
}