本文整理汇总了TypeScript中@eg/core/org.service.OrgService类的典型用法代码示例。如果您正苦于以下问题:TypeScript service.OrgService类的具体用法?TypeScript service.OrgService怎么用?TypeScript service.OrgService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service.OrgService类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: resolve
/**
* Loads pre-auth data common to all applications.
* No auth token is available at this level. When needed, auth is
* enforced by application/group-specific resolvers at lower levels.
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Promise<void> {
OpenSRF.locale = this.locale.currentLocaleCode();
this.idl.parseIdl();
return this.org.fetchOrgs(); // anonymous PCRUD.
}
示例2: getItemImportDefs
getItemImportDefs(): Promise<IdlObject[]> {
if (this.importItemAttrDefs) {
return Promise.resolve(this.importItemAttrDefs);
}
const owners = this.org.ancestors(this.auth.user().ws_ou(), true);
return this.pcrud.search('viiad', {owner: owners}, {}, {atomic: true})
.toPromise().then(defs => {
this.importItemAttrDefs = defs;
return defs;
});
}
示例3: getBillingTypes
// Fetch-cache billing types
async getBillingTypes(): Promise<any> {
if (this.billingTypes.length > 1) {
return Promise.resolve();
}
return this.pcrud.search('cbt',
{owner: this.org.fullPath(this.auth.user().ws_ou(), true)},
{}, {atomic: true}
).toPromise().then(bts => {
this.billingTypes = bts
.sort((a, b) => a.name() < b.name() ? -1 : 1)
.map(bt => ({id: bt.id(), label: bt.name()}));
});
}
示例4: getMergeProfiles
getMergeProfiles(): Promise<IdlObject[]> {
if (this.mergeProfiles) {
return Promise.resolve(this.mergeProfiles);
}
const owners = this.org.ancestors(this.auth.user().ws_ou(), true);
return this.pcrud.search('vmp',
{owner: owners}, {order_by: {vmp: ['name']}}, {atomic: true})
.toPromise().then(profiles => {
this.mergeProfiles = profiles;
return profiles;
});
}
示例5: loadStartupData
/**
* Fetches data common to all staff interfaces.
*/
loadStartupData(): Promise<void> {
// Fetch settings needed globally. This will cache the values
// in the org service.
return this.org.settings([
'lib.timezone',
'webstaff.format.dates',
'webstaff.format.date_and_time',
'ui.staff.max_recent_patrons'
]).then(settings => {
this.format.wsOrgTimezone = settings['lib.timezone'];
this.format.dateFormat = settings['webstaff.format.dates'];
this.format.dateTimeFormat = settings['webstaff.format.date_and_time'];
});
}
示例6: getBibTrashGroups
getBibTrashGroups(): Promise<any> {
if (this.bibTrashGroups) {
return Promise.resolve(this.bibTrashGroups);
}
const owners = this.org.ancestors(this.auth.user().ws_ou(), true);
return this.pcrud.search('vibtg',
{always_apply : 'f', owner: owners},
{vibtg : ['label']},
{atomic: true}
).toPromise().then(groups => {
this.bibTrashGroups = groups;
return groups;
});
}
示例7: ngOnInit
ngOnInit() {
this.org.settings('sms.enable').then(sets => {
this.smsEnabled = sets['sms.enable'];
if (!this.smsEnabled) { return; }
this.pcrud.search('csc', {active: 't'}, {order_by: {csc: 'name'}})
.subscribe(carrier => {
this.smsCarriers.push({
id: carrier.id(),
label: carrier.name()
});
});
});
this.fetchHold();
}
示例8: applyUrlParams
applyUrlParams(context: CatalogSearchContext, params: ParamMap): void {
// Reset query/filter args. The will be reconstructed below.
context.reset();
// These fields can be copied directly into place
['format', 'sort', 'available', 'global', 'identQuery', 'identQueryType']
.forEach(field => {
const val = params.get(field);
if (val !== null) {
context[field] = val;
}
});
if (params.get('limit')) {
context.pager.limit = +params.get('limit');
}
if (params.get('offset')) {
context.pager.offset = +params.get('offset');
}
['query', 'fieldClass', 'joinOp', 'matchOp'].forEach(field => {
const arr = params.getAll(field);
if (arr && arr.length) {
context[field] = arr;
}
});
CATALOG_CCVM_FILTERS.forEach(code => {
const val = params.get(code);
if (val) {
context.ccvmFilters[code] = val.split(/,/);
} else {
context.ccvmFilters[code] = [''];
}
});
params.getAll('facets').forEach(blob => {
const facet = JSON.parse(blob);
context.addFacet(new FacetFilter(facet.c, facet.n, facet.v));
});
if (params.get('org')) {
context.searchOrg = this.org.get(+params.get('org'));
}
}
示例9: getMatchSets
// todo: differentiate between biblio and authority a la queue api
getMatchSets(mtype: string): Promise<IdlObject[]> {
const mstype = mtype.match(/bib/) ? 'biblio' : 'authority';
if (this.matchSets[mtype]) {
return Promise.resolve(this.matchSets[mtype]);
} else {
this.matchSets[mtype] = [];
}
const owners = this.org.ancestors(this.auth.user().ws_ou(), true);
return this.pcrud.search('vms',
{owner: owners, mtype: mstype}, {}, {atomic: true})
.toPromise().then(sets => {
this.matchSets[mtype] = sets;
return sets;
});
}
示例10: ngOnInit
ngOnInit() {
this.locale.supportedLocales().subscribe(
l => this.locales.push(l),
err => {},
() => {
this.currentLocale = this.locales.filter(
l => l.code() === this.locale.currentLocaleCode())[0];
}
);
// NOTE: this can eventually go away.
// Avoid attempts to fetch org settings if the user has not yet
// logged in (e.g. this is the login page).
if (this.user()) {
this.org.settings('ui.staff.angular_catalog.enabled')
.then(settings => this.showAngularCatalog =
Boolean(settings['ui.staff.angular_catalog.enabled']));
}
}