当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript idl.service.IdlObject类代码示例

本文整理汇总了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);
            }
        );
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:29,代码来源:vandelay.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

示例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)
        );
    }
开发者ID:evergreen-library-system,项目名称:Evergreen,代码行数:29,代码来源:match-set-expression.component.ts

示例4: matchSet

 @Input() set matchSet(ms: IdlObject) {
     this.matchSet_ = ms;
     if (ms && !this.initDone) {
         this.matchSetType = ms.mtype();
         this.initDone = true;
         this.refreshTree();
     }
 }
开发者ID:evergreen-library-system,项目名称:Evergreen,代码行数:8,代码来源:match-set-expression.component.ts

示例5:

 (part: IdlObject) => {
     this.editDialog.mode = 'update';
     this.editDialog.recId = part.id();
     this.editDialog.open().then(
         ok => this.partsGrid.reload(),
         err => {}
     );
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:8,代码来源:parts.component.ts

示例6:

 (matchSet: IdlObject) => {
     this.editDialog.mode = 'update';
     this.editDialog.recId = matchSet.id();
     this.editDialog.open({size: 'lg'}).then(
         ok => this.grid.reload(),
         err => {}
     );
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:8,代码来源:match-set-list.component.ts

示例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();
                });
            });
        });
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:33,代码来源:bib-record.service.ts

示例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()));
    }
开发者ID:jamesrf,项目名称:Evergreen,代码行数:8,代码来源:bib-record.service.ts

示例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());
        }
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:13,代码来源:hold.component.ts

示例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));
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:8,代码来源:match-set-expression.component.ts


注:本文中的@eg/core/idl.service.IdlObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。