cancel
Showing results for 
Search instead for 
Did you mean: 

Can cmis atom binding generate a thumbnail, just like webservices?

alfresco-jan
Champ in-the-making
Champ in-the-making
I successfully used the webpreview (cmis:thumbnail rendition) with Alfresco 4.2.c

To connect my cmis client with the repository, I used this URL:

http://localhost:8080/alfresco/service/cmis

Now I upgrade to Alfresco 4.2f and I tried the "more or less" new atom-binding with this URL:

http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom

Now I get "only" a downloadable link for my content and not a preview thumbnail.

If I switch back to the old URL, everything works fine, but I cannot use the "newer" features implemented in the CMIS-API ;-(.

Is there a way to get thumbnails as a preview with the new interface?
Nevertheless I also like some advice to dig deeper into the query.
Maybe a good way to debug this would be to just query cmis via curl.



Here are the different output-urls I get for my query:

old URL (alfresco/service/cmis): <b> WORKING! </b>



http://localhost:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/bda076b2-1d20-4121-81d2-423d71...


new URL (alfresco/api/-default-/public/cmis/versions/1.0/atom)  <b> NOT WORKING! </b>

http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/content/SomeNme%202014001...


If I dump all available renditions, I also see different renditionDocumentId(s):


http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom

          'c8a32a3e-acad-44b9-8f73-0496f49cf341' => {
                                                    'kind' => 'alf:webpreview',
                                                    'length' => '69675',
                                                    'renditionDocumentId' => 'c8a32a3e-acad-44b9-8f73-0496f49cf341',
                                                    'title' => 'webpreview',
                                                    'mimetype' => 'application/x-shockwave-flash',
                                                    'streamId' => 'c8a32a3e-acad-44b9-8f73-0496f49cf341'
                                                  },
          '9742cf09-80de-488f-a348-3f9014ee5716' => {
                                                    'width' => '100',
                                                    'renditionDocumentId' => '9742cf09-80de-488f-a348-3f9014ee5716',
                                                    'height' => '100',
                                                    'length' => '35368',
                                                    'kind' => 'cmis:thumbnail',
                                                    'title' => 'doclib',
                                                    'streamId' => '9742cf09-80de-488f-a348-3f9014ee5716',
                                                    'mimetype' => 'image/png'
                                                  }



http://localhost:8080/alfresco/service/cmis

{
          'alf:icon32' => {
                          'width' => '32',
                          'kind' => 'alf:icon32',
                          'length' => '-1',
                          'height' => '32',
                          'mimetype' => 'image/gif',
                          'streamId' => 'alf:icon32'
                        },
          'workspace://SpacesStore/c8a32a3e-acad-44b9-8f73-0496f49cf341' => {
                                                                            'kind' => 'alf:webpreview',
                                                                            'length' => '69675',
                                                                            'title' => 'webpreview',
                                                                            'mimetype' => 'application/x-shockwave-flash',
                                                                            'streamId' => 'workspace://SpacesStore/c8a32a3e-acad-44b9-8f73-0496f49cf341'
                                                                          },
          'alf:icon16' => {
                          'width' => '16',
                          'kind' => 'alf:icon16',
                          'length' => '-1',
                          'height' => '16',
                          'mimetype' => 'image/gif',
                          'streamId' => 'alf:icon16'
                        },
          'workspace://SpacesStore/9742cf09-80de-488f-a348-3f9014ee5716' => {
                                                                            'width' => '100',
                                                                            'kind' => 'cmis:thumbnail',
                                                                            'length' => '35368',
                                                                            'title' => 'doclib',
                                                                            'height' => '100',
                                                                            'mimetype' => 'image/png',
                                                                            'streamId' => 'workspace://SpacesStore/9742cf09-80de-488f-a348-3f9014ee5716'
                                                                          }
        }


Perhaps some deeper insight into this would be great. I am wondering why the different bindings (URL) give different results …
2 REPLIES 2

alfresco-jan
Champ in-the-making
Champ in-the-making
Ah, ok.
The CMIS REST Client interferes with the CMIS REST API
And the CMIS WS Client interferes with the CMIS Web Services.

Hmmm. Therefore there is a Alfresco WebService which generates the thumbnail and this is not known to the REST API.
I read (cmis-article.pdf -> Getting Started with CMIS).

jpotts
World-Class Innovator
World-Class Innovator

The two different URLs you reference are completely different implementations. The newer releases of Alfresco actually use OpenCMIS under the covers rather than Alfresco's own CMIS implementation. That's why the behavior is different and why it is important to use the proper service URL when working with CMIS and Alfresco. (It looks like you are using the right service URL).

Your URL looks a little funky, though. You've got an extra question mark in there that you don't need, for one thing.

Here's something you ought to be able to re-create...

In my local 4.2.f install I dropped some JPEGs into a test folder then clicked around the UI to trigger a rendition generation. I went to my Node Browser in Alfresco Share and verified that I can see the renditions--they are stored as children of the node they are renditions of.

Then, I opened up OpenCMIS Workbench. On the renditions tab I can see the following renditions:
"doclib","cmis:thumbnail","image/png",12391,"fa398f93-a53d-4a6f-80b1-ffa0dbbf6ec6"
"imgpreview","alf:webpreview","image/jpeg",337980,"e012a915-ad26-4212-a2b1-9dae628c6944"

If I click on the "Object" tab (or the Properties tab, it doesn't matter) I can see that the CMIS object ID is:
"Object Id","cmisSmiley SurprisedbjectId","id",["f1661175-99e5-481b-8097-48943664095d;1.0"]

I can look at either rendition by clicking on them within OpenCMIS Workbench, but if I want to fetch the rendition in my browser with a URL, the appropriate URL for the doclib rendition would be:
http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/at...

So that's how you can get the renditions via URL in Alfresco 4.2.

Jeff

Hire my team for your next project! Metaversant
Blog: ecmarchitect.com | Twitter: jeffpotts01
CMIS APIs: Apache Chemistry | CMIS and Apache Chemistry in Action
Alfresco tutorials: Alfresco Developer Series