[ADF-793] Ability to create PDF renditions in case of non supported formats (#1994)

* Style changes and button

* Convert to PDF button

* Convert to PDF button part II.

* Convert within the Not Supported Format component

* Rendition loading skeleton

* Conversion is working.

* Convert button behaviour tests

* Rebasing fix.
This commit is contained in:
Popovics András
2017-06-20 21:02:22 +01:00
committed by Eugenio Romano
parent 0ff4ff5f24
commit b457024cab
11 changed files with 331 additions and 49 deletions

View File

@@ -76,6 +76,19 @@ export class RenditionsService {
.catch(err => this.handleError(err));
}
convert(nodeId: string, encoding: string, pollingInterval: number|undefined) {
return this.createRendition(nodeId, encoding)
.concatMap(() => this.pollRendition(nodeId, encoding, pollingInterval));
}
private pollRendition(nodeId: string, encoding: string, interval: number = 1000) {
return Observable.interval(interval)
.switchMap(() => this.getRendition(nodeId, encoding))
.takeWhile((data) => {
return (data.entry.status !== 'CREATED');
});
}
private handleError(error: any): Observable<any> {
this.logService.error(error);
return Observable.throw(error || 'Server error');