Alfresco / alfresco-ng2-components

Alfresco Angular Components
https://www.alfresco.com/abn/adf/docs/
Apache License 2.0
294 stars 262 forks source link

The API getDocumentThumbnailUrl should return the Thumbnail #549

Closed mauriziovitale closed 8 years ago

mauriziovitale commented 8 years ago

The method getDocumentThumbnailUrl should return the thumbnail but we receive alway the error:

{"error":{"errorKey":"Thumbnail was not found for [doclib]","statusCode":404,"briefSummary":"07080503 Thumbnail was not found for [doclib]"

eromano commented 8 years ago

Due a problem in the RestApi the thumbnail could be not generated during the upload:

https://github.com/Alfresco/community-edition/blob/master/projects/remote-api/source/java/org/alfresco/rest/api/impl/NodesImpl.java#L2610

When this problem occurs , the thumbnails have to be asked with the parameter c=queue in order to be regenerated.Something like :

http://127.0.0.1:8080//share/proxy/alfresco/api/node/workspace/SpacesStore/ac1c98aa-67de-417f-af81-5ada42e16d60/content/thumbnails/doclib?c=queue&ph=true&lastModified=doclib:1471021625609

More details can be found also in this discussion in the forum:

https://forums.alfresco.com/forum/developer-discussions/repository-services/how-generate-thumbnail-use-alfresco-05162013-0415

With this parameter probably the thumbnails are regenerated every time ( this is the approach used in Share ).

https://github.com/Alfresco/community-edition/blob/master/projects/remote-api/source/java/org/alfresco/repo/web/scripts/quickshare/QuickShareThumbnailContentGet.java#L115

Despite the fact that this approach regenerate the thumbnail you need to reload it at least once in order to display it.

eromano commented 8 years ago

From the conversation with @ohej we can:

For multipart/form-data upload you can use the renditions field to create renditions (e.g. doclib) asynchronously upon upload. Note that currently only one rendition can be requested. Also, as requesting rendition is a background process, any rendition failure (e.g. No transformer is currently available) will not fail the whole upload and has the potential to silently fail.

the parameter is parsed here

https://github.com/Alfresco/community-edition/blob/master/projects/remote-api/source/java/org/alfresco/rest/api/impl/NodesImpl.java#L2524