[ADF-5426] Remove compatibility layer from Lib (#7110)

* remove compatibility step 1

* remove compatibility step 2

* remove compatibility step 3

* remove compatibility step 4

* remove compatibility step 5
This commit is contained in:
Eugenio Romano
2021-08-04 17:31:35 +02:00
committed by GitHub
parent 5d5b582e32
commit f30b20cc46
113 changed files with 1375 additions and 2348 deletions

View File

@@ -18,7 +18,7 @@
import { AlfrescoApiService } from '../../services/alfresco-api.service';
import { LogService } from '../../services/log.service';
import { Injectable } from '@angular/core';
import { RelatedContentRepresentation } from '@alfresco/js-api';
import { ActivitiContentApi, RelatedContentRepresentation } from '@alfresco/js-api';
import { Observable, from, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
@@ -30,12 +30,11 @@ export class ProcessContentService {
static UNKNOWN_ERROR_MESSAGE: string = 'Unknown error';
static GENERIC_ERROR_MESSAGE: string = 'Server error';
private contentApi: ActivitiContentApi;
constructor(private apiService: AlfrescoApiService,
private logService: LogService) {
}
private get contentApi(): any {
return this.apiService.getInstance().activiti.contentApi;
this.contentApi = new ActivitiContentApi(this.apiService.getInstance());
}
/**
@@ -75,7 +74,7 @@ export class ProcessContentService {
*/
getContentPreview(contentId: number): Observable<Blob> {
return new Observable((observer) => {
this.contentApi.getContentPreview(contentId).then(
this.contentApi.getRawContent(contentId).then(
(result) => {
observer.next(result);
observer.complete();
@@ -111,7 +110,7 @@ export class ProcessContentService {
* @returns Binary data of the thumbnail image
*/
getContentThumbnail(contentId: number): Observable<Blob> {
return from(this.contentApi.getContentThumbnail(contentId))
return from(this.contentApi.getRawContent(contentId, 'thumbnail'))
.pipe(catchError((err) => this.handleError(err)));
}