migrate document list to new api

This commit is contained in:
Eugenio Romano
2016-06-29 15:56:32 +01:00
parent aa848e271e
commit 7396a57e5c
9 changed files with 27 additions and 20 deletions

View File

@@ -68,26 +68,21 @@ export class DocumentListService {
) {
}
private getAlfrescoClient() {
return AlfrescoApi.getClientWithTicket(this.settings.getApiBaseUrl(), this.authService.getToken());
private getAlfrescoApi() {
return this.authService.getAlfrescoApi();
}
private getNodesPromise(folder: string) {
let alfrescoClient = this.getAlfrescoClient();
let apiInstance = new AlfrescoApi.Core.NodesApi(alfrescoClient);
let nodeId = '-root-';
let opts = {
relativePath: folder,
include: ['path']
};
return apiInstance.getNodeChildren(nodeId, opts);
return this.getAlfrescoApi().getNodeChildren(nodeId, opts);
}
deleteNode(nodeId: string) {
let client = this.getAlfrescoClient();
let nodesApi = new AlfrescoApi.Core.NodesApi(client);
let opts = {};
return Observable.fromPromise(nodesApi.deleteNode(nodeId, opts));
return Observable.fromPromise(this.getAlfrescoApi().deleteNode(nodeId));
}
/**