Alfresco / alfresco-js-api

This project provides a JavaScript client API into the Alfresco REST API and Activiti REST API.
Apache License 2.0
117 stars 63 forks source link

Thumbnail ask for regenerate and Add image preview #36

Closed eromano closed 8 years ago

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

Maybe we can add inside the alfrescoContent api a system that call the renditions api:

POST /nodes/{nodeId}/renditions

when one of thumbnail link return 404 in order to ask to regenerate 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