ajax calls
This commit is contained in:
parent
bdeaef3b8e
commit
4e92795b4a
|
@ -12,64 +12,40 @@ export class ISService {
|
|||
constructor(public client: HttpClient, public snackBar: MatSnackBar) { }
|
||||
|
||||
loadResourceTypes(onSuccess: Function): void {
|
||||
this.client.get<ResourceType[]>("/ajax/resourceTypes").subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<ResourceType[]>("/ajax/resourceTypes", onSuccess);
|
||||
}
|
||||
|
||||
loadResourceType(id: string, onSuccess: Function): void {
|
||||
this.client.get<ResourceType>("/ajax/resourceTypes/" + encodeURIComponent(id)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<ResourceType>("/ajax/resourceTypes/" + encodeURIComponent(id), onSuccess);
|
||||
}
|
||||
|
||||
loadInfo(onSuccess: Function): void {
|
||||
this.client.get<any[]>("/ajax/info/").subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<any[]>("/ajax/info/", onSuccess);
|
||||
}
|
||||
|
||||
loadProtocols(onSuccess: Function): void {
|
||||
this.client.get<Protocol[]>("/ajax/protocols/").subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<Protocol[]>("/ajax/protocols/", onSuccess);
|
||||
}
|
||||
|
||||
loadSimpleResources(type: string, onSuccess: Function): void {
|
||||
this.client.get<SimpleResource[]>("/ajax/resources/" + encodeURIComponent(type)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<SimpleResource[]>("/ajax/resources/" + encodeURIComponent(type), onSuccess);
|
||||
}
|
||||
|
||||
loadSimpleResourceContent(id: any, onSuccess: Function): void {
|
||||
const headers = new HttpHeaders().set('Content-Type', 'text/plain; charset=utf-8');
|
||||
this.client.get<string>("/ajax/resources/" + encodeURIComponent(id) + '/content', {
|
||||
this.httpGetWithOptions<string>("/ajax/resources/" + encodeURIComponent(id) + '/content', {
|
||||
headers, responseType: 'text' as 'json'
|
||||
}).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
}, onSuccess);
|
||||
}
|
||||
|
||||
saveSimpleResourceMedatata(res: SimpleResource, onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
this.client.post<void>('/ajax/resources/' + encodeURIComponent(res.id) + '/metadata', res).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error, relatedForm)
|
||||
});
|
||||
this.httpPost('/ajax/resources/' + encodeURIComponent(res.id) + '/metadata', res, onSuccess, relatedForm);
|
||||
}
|
||||
|
||||
saveSimpleResourceContent(id: string, content: string, onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')
|
||||
let body = new HttpParams().set('content', content);
|
||||
this.client.post<void>('/ajax/resources/' + encodeURIComponent(id) + '/content', body, { headers: headers }).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error, relatedForm)
|
||||
});
|
||||
this.httpPostWithOptions('/ajax/resources/' + encodeURIComponent(id) + '/content', body, { headers: headers }, onSuccess, relatedForm);
|
||||
}
|
||||
|
||||
addSimpleResource(name: string, type: string, subtype: string, description: string, content: string, onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
|
@ -80,17 +56,11 @@ export class ISService {
|
|||
.set('subtype', subtype)
|
||||
.set('description', description)
|
||||
.set('content', content);
|
||||
this.client.post<void>('/ajax/resources/', body, { headers: headers }).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error, relatedForm)
|
||||
});
|
||||
this.httpPostWithOptions('/ajax/resources/', body, { headers: headers }, onSuccess, relatedForm);
|
||||
}
|
||||
|
||||
deleteSimpleResource(resourceId: string, onSuccess: Function): void {
|
||||
this.client.delete<void>('/ajax/resources/' + encodeURIComponent(resourceId)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpDelete('/ajax/resources/' + encodeURIComponent(resourceId), onSuccess);
|
||||
}
|
||||
|
||||
loadWfHistory(total: number, from: number, to: number, onSuccess: Function): void {
|
||||
|
@ -99,140 +69,83 @@ export class ISService {
|
|||
if (from && from > 0) { params = params.append('from', from); }
|
||||
if (to && to > 0) { params = params.append('to', to); }
|
||||
|
||||
this.client.get<WfHistoryEntry[]>('/ajax/wf_history/', { params: params }).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGetWithOptions<WfHistoryEntry[]>('/ajax/wf_history/', { params: params }, onSuccess);
|
||||
}
|
||||
|
||||
loadContexts(onSuccess: Function): void {
|
||||
this.client.get<Context[]>('./ajax/contexts/').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<Context[]>('./ajax/contexts/', onSuccess);
|
||||
}
|
||||
|
||||
loadContext(ctxId: string, onSuccess: Function): void {
|
||||
this.client.get<Context>('./ajax/contexts/' + encodeURIComponent(ctxId)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<Context>('./ajax/contexts/' + encodeURIComponent(ctxId), onSuccess);
|
||||
}
|
||||
|
||||
loadContextCategories(ctxId: string, onSuccess: Function): void {
|
||||
this.client.get<ContextNode[]>('./ajax/contexts/' + encodeURIComponent(ctxId) + '/categories').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<ContextNode[]>('./ajax/contexts/' + encodeURIComponent(ctxId) + '/categories', onSuccess);
|
||||
}
|
||||
|
||||
loadContextConcepts(level: number, nodeId: string, onSuccess: Function): void {
|
||||
this.client.get<ContextNode[]>('./ajax/contexts/' + encodeURIComponent(level) + '/' + encodeURIComponent(nodeId) + '/concepts').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<ContextNode[]>('./ajax/contexts/' + encodeURIComponent(level) + '/' + encodeURIComponent(nodeId) + '/concepts', onSuccess);
|
||||
}
|
||||
|
||||
loadVocabularies(onSuccess: Function): void {
|
||||
this.client.get<Vocabulary[]>('./ajax/vocs/').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<Vocabulary[]>('./ajax/vocs/', onSuccess);
|
||||
}
|
||||
|
||||
loadVocabulary(vocId: string, onSuccess: Function): void {
|
||||
this.client.get<Vocabulary>('./ajax/vocs/' + encodeURIComponent(vocId)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<Vocabulary>('./ajax/vocs/' + encodeURIComponent(vocId), onSuccess);
|
||||
}
|
||||
|
||||
loadVocabularyTerms(vocId: string, onSuccess: Function): void {
|
||||
this.client.get<VocabularyTerm[]>('./ajax/vocs/' + encodeURIComponent(vocId) + '/terms').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<VocabularyTerm[]>('./ajax/vocs/' + encodeURIComponent(vocId) + '/terms', onSuccess);
|
||||
}
|
||||
|
||||
saveVocabulary(voc: Vocabulary, onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
this.client.post<void>('./ajax/vocs/', voc).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error, relatedForm)
|
||||
});
|
||||
this.httpPost('./ajax/vocs/', voc, onSuccess, relatedForm);
|
||||
}
|
||||
|
||||
saveVocabularyTerm(vocId: string, term: VocabularyTerm, onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
this.client.post<void>('./ajax/vocs/' + encodeURIComponent(vocId) + '/terms', term).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error, relatedForm)
|
||||
});
|
||||
this.httpPost('./ajax/vocs/' + encodeURIComponent(vocId) + '/terms', term, onSuccess, relatedForm);
|
||||
}
|
||||
|
||||
deleteVocabulary(vocId: string, onSuccess: Function): void {
|
||||
this.client.delete<void>('./ajax/vocs/' + encodeURIComponent(vocId)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpDelete('./ajax/vocs/' + encodeURIComponent(vocId), onSuccess);
|
||||
}
|
||||
|
||||
deleteVocabularyTerm(vocId: string, termCode: string, onSuccess: Function): void {
|
||||
this.client.delete<void>('./ajax/vocs/'
|
||||
this.httpDelete('./ajax/vocs/'
|
||||
+ encodeURIComponent(vocId)
|
||||
+ '/terms/'
|
||||
+ encodeURIComponent(termCode)
|
||||
).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
, onSuccess);
|
||||
}
|
||||
|
||||
dsmConf(onSuccess: Function) {
|
||||
this.client.get<DsmConf>('./ajax/dsm/conf').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<DsmConf>('./ajax/dsm/conf', onSuccess);
|
||||
}
|
||||
|
||||
dsmBrowsableFields(onSuccess: Function) {
|
||||
this.client.get<KeyValue[]>('./ajax/dsm/browsableFields').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<KeyValue[]>('./ajax/dsm/browsableFields', onSuccess);
|
||||
}
|
||||
|
||||
dsmBrowse(field: string, onSuccess: Function) {
|
||||
this.client.get<BrowseTerm[]>('./ajax/dsm/browse/' + encodeURIComponent(field)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<BrowseTerm[]>('./ajax/dsm/browse/' + encodeURIComponent(field), onSuccess);
|
||||
}
|
||||
|
||||
dsmSearchByField(field: string, value: string, page: number, pageSize: number, onSuccess: Function) {
|
||||
this.client.get<Page<Datasource>>('./ajax/dsm/searchByField/' + encodeURIComponent(field) + '/' + page + '/' + pageSize + '?value=' + encodeURIComponent(value)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<Page<Datasource>>('./ajax/dsm/searchByField/' + encodeURIComponent(field) + '/' + page + '/' + pageSize + '?value=' + encodeURIComponent(value), onSuccess);
|
||||
}
|
||||
|
||||
dsmSearch(value: string, page: number, pageSize: number, onSuccess: Function) {
|
||||
this.client.get<Page<Datasource>>('./ajax/dsm/search/' + page + '/' + pageSize + '?value=' + encodeURIComponent(value)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<Page<Datasource>>('./ajax/dsm/search/' + page + '/' + pageSize + '?value=' + encodeURIComponent(value), onSuccess);
|
||||
}
|
||||
|
||||
loadMDStores(onSuccess: Function): void {
|
||||
this.client.get<MDStore[]>("/ajax/mdstores/").subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<MDStore[]>("/ajax/mdstores/", onSuccess);
|
||||
}
|
||||
|
||||
loadMDStore(mdId: string, onSuccess: Function): void {
|
||||
this.client.get<MDStore>('./ajax/mdstores/mdstore/' + encodeURIComponent(mdId)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<MDStore>('./ajax/mdstores/mdstore/' + encodeURIComponent(mdId), onSuccess);
|
||||
}
|
||||
|
||||
addMDStore(format: string, layout: string, interpretation: string, type: string, dsName: string, dsId: string, apiId: string, onSuccess: Function, relatedForm?: FormGroup) {
|
||||
|
@ -243,7 +156,7 @@ export class ISService {
|
|||
.set('dsId', dsId)
|
||||
.set('apiId', apiId);
|
||||
|
||||
this.client.post<void>('/ajax/mdstores/new/'
|
||||
this.httpPostWithOptions('/ajax/mdstores/new/'
|
||||
+ encodeURIComponent(format)
|
||||
+ '/'
|
||||
+ encodeURIComponent(layout)
|
||||
|
@ -251,170 +164,134 @@ export class ISService {
|
|||
+ encodeURIComponent(interpretation)
|
||||
+ '/'
|
||||
+ encodeURIComponent(type),
|
||||
body, { headers: headers }).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error, relatedForm)
|
||||
});
|
||||
body, { headers: headers }, onSuccess, relatedForm);
|
||||
}
|
||||
|
||||
deleteMDStore(mdId: string, onSuccess: Function): void {
|
||||
this.client.delete<void>('./ajax/mdstores/mdstore/' + encodeURIComponent(mdId)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpDelete('./ajax/mdstores/mdstore/' + encodeURIComponent(mdId), onSuccess);
|
||||
}
|
||||
|
||||
prepareNewMDStoreVersion(mdId: string, onSuccess: Function): void {
|
||||
this.client.get<MDStoreVersion>('./ajax/mdstores/mdstore/' + encodeURIComponent(mdId) + '/newVersion').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<MDStoreVersion>('./ajax/mdstores/mdstore/' + encodeURIComponent(mdId) + '/newVersion', onSuccess);
|
||||
}
|
||||
|
||||
commitMDStoreVersion(versionId: string, size: number, onSuccess: Function) {
|
||||
this.client.get<any>('./ajax/mdstores/version/' + encodeURIComponent(versionId) + '/commit/' + size).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<any>('./ajax/mdstores/version/' + encodeURIComponent(versionId) + '/commit/' + size, onSuccess);
|
||||
}
|
||||
|
||||
abortMDStoreVersion(versionId: string, onSuccess: Function) {
|
||||
this.client.get<any>('./ajax/mdstores/version/' + encodeURIComponent(versionId) + '/abort').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<any>('./ajax/mdstores/version/' + encodeURIComponent(versionId) + '/abort', onSuccess);
|
||||
}
|
||||
|
||||
deleteMDStoreVersion(versionId: string, onSuccess: Function) {
|
||||
this.client.delete<any>('./ajax/mdstores/version/' + encodeURIComponent(versionId)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpDelete('./ajax/mdstores/version/' + encodeURIComponent(versionId), onSuccess);
|
||||
}
|
||||
|
||||
resetReadingMDStoreVersion(versionId: string, onSuccess: Function) {
|
||||
this.client.get<any>('./ajax/mdstores/version/' + encodeURIComponent(versionId) + '/resetReading').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<any>('./ajax/mdstores/version/' + encodeURIComponent(versionId) + '/resetReading', onSuccess);
|
||||
}
|
||||
|
||||
loadMDStoreVersions(mdId: string, onSuccess: Function): void {
|
||||
this.client.get<MDStoreVersion[]>('./ajax/mdstores/mdstore/' + encodeURIComponent(mdId) + '/versions').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<MDStoreVersion[]>('./ajax/mdstores/mdstore/' + encodeURIComponent(mdId) + '/versions', onSuccess);
|
||||
}
|
||||
|
||||
loadMDStoreVersion(versionId: string, onSuccess: Function): void {
|
||||
this.client.get<MDStoreVersion>('./ajax/mdstores/version/' + encodeURIComponent(versionId)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<MDStoreVersion>('./ajax/mdstores/version/' + encodeURIComponent(versionId), onSuccess);
|
||||
}
|
||||
|
||||
loadMDStoreVersionRecords(versionId: string, limit: number, onSuccess: Function): void {
|
||||
this.client.get<MDStoreRecord[]>('./ajax/mdstores/version/' + encodeURIComponent(versionId) + '/content/' + limit).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<MDStoreRecord[]>('./ajax/mdstores/version/' + encodeURIComponent(versionId) + '/content/' + limit, onSuccess);
|
||||
}
|
||||
|
||||
testCleaning(rule: string, xml: string, onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
var headers = new HttpHeaders().set('Content-Type', 'text/plain; charset=utf-8');
|
||||
|
||||
this.client.post<any>('./ajax/mapping/clean?rule=' + encodeURIComponent(rule), xml, { headers, responseType: 'text' as 'json' }).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error, relatedForm)
|
||||
});
|
||||
this.httpPostWithOptions('./ajax/mapping/clean?rule=' + encodeURIComponent(rule), xml, { headers, responseType: 'text' as 'json' }, onSuccess, relatedForm);
|
||||
}
|
||||
|
||||
loadEmailTemplates(onSuccess: Function): void {
|
||||
this.client.get<EmailTemplate[]>('./ajax/templates/email/').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
this.httpGet<EmailTemplate[]>('./ajax/templates/email/', onSuccess);
|
||||
}
|
||||
|
||||
saveEmailTemplate(email: EmailTemplate, onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
this.client.post<void>('./ajax/templates/email/', email).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error, relatedForm)
|
||||
});
|
||||
this.httpPost('./ajax/templates/email/', email, onSuccess, relatedForm);
|
||||
}
|
||||
|
||||
deleteEmailTemplate(id: string, onSuccess: Function): void {
|
||||
this.client.delete<void>('./ajax/templates/email/' + encodeURIComponent(id)).subscribe({
|
||||
this.httpDelete('./ajax/templates/email/' + encodeURIComponent(id), onSuccess);
|
||||
}
|
||||
|
||||
loadWfConfigurationSections(onSuccess: Function): void {
|
||||
this.httpGet<KeyValue[]>('./ajax/wfs/sections', onSuccess);
|
||||
}
|
||||
|
||||
loadWfConfigurations(section: string, onSuccess: Function): void {
|
||||
this.httpGet<KeyValue[]>('./ajax/wfs/search?section=' + encodeURIComponent(section), onSuccess);
|
||||
}
|
||||
|
||||
loadWfConfiguration(id: string, onSuccess: Function): void {
|
||||
this.httpGet<WfConf>('./ajax/wfs/conf/' + encodeURIComponent(id), onSuccess);
|
||||
}
|
||||
|
||||
|
||||
|
||||
saveWfConfiguration(conf: WfConf, onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
this.httpPost('./ajax/wfs/conf', conf, onSuccess, relatedForm);
|
||||
}
|
||||
|
||||
deleteWfConfiguration(id: string, onSuccess: Function): void {
|
||||
this.httpDelete('./ajax/wfs/conf/' + encodeURIComponent(id), onSuccess);
|
||||
}
|
||||
|
||||
startWfConfiguration(id: string, onSuccess: Function): void {
|
||||
this.httpGet<WfProcessStatus>('./ajax/wfs/conf/' + encodeURIComponent(id) + '/start', onSuccess);
|
||||
}
|
||||
|
||||
findProcess(id: string, onSuccess: Function): void {
|
||||
this.httpGet<WfProcessStatus>('./ajax/wfs/process/' + encodeURIComponent(id), onSuccess);
|
||||
}
|
||||
|
||||
killProcess(id: string, onSuccess: Function): void {
|
||||
this.httpDelete('./ajax/wfs/process/' + encodeURIComponent(id), onSuccess);
|
||||
}
|
||||
|
||||
findWfSubscriptions(id: string, onSuccess: Function): void {
|
||||
this.httpGet<WfSubscription[]>('./ajax/wfs/conf/' + encodeURIComponent(id) + '/subscriptions', onSuccess);
|
||||
}
|
||||
|
||||
saveWfSubscriptions(id: string, subscriptions: WfSubscription[], onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
this.httpPost('./ajax/wfs/conf/' + encodeURIComponent(id) + '/subscriptions', subscriptions, onSuccess, relatedForm);
|
||||
}
|
||||
|
||||
private httpGet<T>(url: string, onSuccess: Function) {
|
||||
this.client.get<T>(url).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
}
|
||||
|
||||
loadWfIntancesSections(onSuccess: Function): void {
|
||||
this.client.get<KeyValue[]>('./ajax/wfs/sections').subscribe({
|
||||
private httpGetWithOptions<T>(url: string, options: any, onSuccess: Function) {
|
||||
this.client.get<T>(url, options).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
}
|
||||
|
||||
loadWfIntances(section: string, onSuccess: Function): void {
|
||||
this.client.get<KeyValue[]>('./ajax/wfs/search?section=' + encodeURIComponent(section)).subscribe({
|
||||
private httpDelete(url: string, onSuccess: Function) {
|
||||
this.client.delete<void>(url).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
}
|
||||
|
||||
loadWfIntance(id: string, onSuccess: Function): void {
|
||||
this.client.get<WfConf>('./ajax/wfs/conf/' + encodeURIComponent(id)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
}
|
||||
|
||||
saveWfIntance(conf: WfConf, onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
this.client.post<void>('./ajax/wfs/conf', conf).subscribe({
|
||||
private httpPost(url: string, body: any, onSuccess: Function, relatedForm?: FormGroup) {
|
||||
this.client.post<void>(url, body).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error, relatedForm)
|
||||
});
|
||||
}
|
||||
|
||||
deleteWfIntance(id: string, onSuccess: Function): void {
|
||||
this.client.delete<void>('./ajax/wfs/conf/' + encodeURIComponent(id)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
}
|
||||
|
||||
startWfIntance(id: string, onSuccess: Function): void {
|
||||
this.client.get<WfProcessStatus>('./ajax/wfs/conf/' + encodeURIComponent(id) + '/start').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
}
|
||||
|
||||
findProcess(id: string, onSuccess: Function): void {
|
||||
this.client.get<WfProcessStatus>('./ajax/wfs/process/' + encodeURIComponent(id)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
}
|
||||
|
||||
killProcess(id: string, onSuccess: Function): void {
|
||||
this.client.delete<void>('./ajax/wfs/process/' + encodeURIComponent(id)).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
}
|
||||
|
||||
findWfSubscriptions(id: string, onSuccess: Function): void {
|
||||
this.client.get<WfSubscription[]>('./ajax/wfs/conf/' + encodeURIComponent(id) + '/subscriptions').subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error)
|
||||
});
|
||||
}
|
||||
|
||||
saveWfSubscriptions(id: string, subscriptions: WfSubscription[], onSuccess: Function, relatedForm?: FormGroup): void {
|
||||
this.client.post<void>('./ajax/wfs/conf/' + encodeURIComponent(id) + '/subscriptions', subscriptions).subscribe({
|
||||
private httpPostWithOptions(url: string, body: any, options: any, onSuccess: Function, relatedForm?: FormGroup) {
|
||||
this.client.post<void>(url, body, options).subscribe({
|
||||
next: data => onSuccess(data),
|
||||
error: error => this.showError(error, relatedForm)
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue