mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-08-07 17:48:54 +00:00
[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:
committed by
Eugenio Romano
parent
0ff4ff5f24
commit
b457024cab
@@ -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');
|
||||
|
Reference in New Issue
Block a user