<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem with thumbnail REST API in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/problem-with-thumbnail-rest-api/m-p/272997#M226127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are there some restrictions while using thumbnail REST API? FireBug complains a "too many recursive calls" error while I am trying to get thumbnail of the same document from two different dashlets.&amp;nbsp; Below is the code fragment I used to retrieve thumbnail of a document.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var thumbnailUrl = Alfresco.constants.PROXY_URI + "api/node/" + issue.attachNodeRef.replace(":/", "") + "/content/thumbnails/doclib?c=queue&amp;amp;ph=true";&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;The requirement is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dashlet A will display all issues that assigned to current user. If the issue has attachments then the thumbnail will be displayed. The backend web script decides which attachment will be used. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dashlet B will display all issues that created by current user. A thumbnail will be displayed if the issue has at least one attachment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The detailed problem is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It works well if I only deploy one of them to site dashboard. But when I deploy both of them the FireFox goes dead while I am trying to enter the site dashboad.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this caused by wrong arguments ? Any clues will be appreciated. Many thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 May 2012 02:30:17 GMT</pubDate>
    <dc:creator>alex_chew</dc:creator>
    <dc:date>2012-05-16T02:30:17Z</dc:date>
    <item>
      <title>Problem with thumbnail REST API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-with-thumbnail-rest-api/m-p/272997#M226127</link>
      <description>Hi,Are there some restrictions while using thumbnail REST API? FireBug complains a "too many recursive calls" error while I am trying to get thumbnail of the same document from two different dashlets.&amp;nbsp; Below is the code fragment I used to retrieve thumbnail of a document.var thumbnailUrl = Alfresco.</description>
      <pubDate>Wed, 16 May 2012 02:30:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-with-thumbnail-rest-api/m-p/272997#M226127</guid>
      <dc:creator>alex_chew</dc:creator>
      <dc:date>2012-05-16T02:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with thumbnail REST API</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-with-thumbnail-rest-api/m-p/272998#M226128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i dont have an answer for you. but i was playing with the thumbnail REST api recently and figured i would drop a few thoughts&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;first i havent noticed many restrictions with this api&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;now when in debugging this issue realize its just a GET call so you can just put the url in your browsers address bar. then when you use firebug (or the Chrome Dev Tools which i like better) you dont have to wade through all those responses. you can just see the one you care about. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;here is an example from my dev box (localhost links wont work, i just wanted to show you the patterns)&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://localhost:8080/share/proxy/alfresco/api/node/workspace/SpacesStore/e102e92c-4894-4e9c-86c2-de107e13a3eb/content/thumbnails/" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/share/proxy/alfresco/api/node/workspace/SpacesStore/e102e92c-4894-4e9c-86c2-de107e13a3eb/content/thumbnails/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that should show you JSON with all the thumbnails that have already been generated. place the thumbnail name at the end of that url to get that thumbnail returned&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://localhost:8080/share/proxy/alfresco/api/node/workspace/SpacesStore/e102e92c-4894-4e9c-86c2-de107e13a3eb/content/thumbnails/doclib" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/share/proxy/alfresco/api/node/workspace/SpacesStore/e102e92c-4894-4e9c-86c2-de107e13a3eb/content/thumbnails/doclib&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if it hasnt been generated yet you get a 404 not found. if it has been you should get a 200 img/png&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the preview names must be valid, registered &lt;/SPAN&gt;&lt;A href="http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/repo/thumbnail/ThumbnailDefinition.html" rel="nofollow noopener noreferrer"&gt;ThumbnailDefinition&lt;/A&gt;&lt;SPAN&gt;s. default one are registered in the &lt;/SPAN&gt;&lt;A href="http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/repository/config/alfresco/thumbnail-service-context.xml" rel="nofollow noopener noreferrer"&gt;thumbnail-service-context.xml&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;using ?c=queue may return a 404 not Found until the thumbnail is generated. meaning you will have to call again. if you want to leave the connection open forcing the immediate creation and return of the thumbnail use ?c=force (subsequent calls to that url will not re-generate the preview, i dont think)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so since you are just hitting the thumbnail image preview in your browser address bar you can use your chrome dev tools or firebug to see the network responses. too many redirects error implies that the api is sending back redirects like 301 or 302. your dev tools can confirm that. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in fact i can check that right now on my box. i can find a node that has few previews…..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;GET …/content/thumbnails/ returns 200 and json array showing that doclib was already made. (alfresco does that with images)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GET …/content/thumbnails/imgpreview?c=queue returns 404 not found. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;call it again …. returns a 200 img/png. the first call said it couldnt find the preview, but since we asked it to be queued the second call found it already made. the time it takes for the thumbnail generator to get through the queue depends on the specs of your system and activity level on your install&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GET …/content/thumbnails/webpreview?c=force returns 200 with the preview. unless it couldnt make it then you get a 500. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GET …/content/thumbnails/ now shows all the previews that have been generated&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;GET …/content/thumbnails/doclib this type of call without the c arg will show it if its been made, give you a 404 not found if it hasnt been but will not trigger any sort of thumbnail generation. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i didnt see any redirects (301 or 302) in any of my testing there. maybe you can use your dev tools to determine exactly which url is giving the too many redirects&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you do not need the ph "placeholder" arg as alfresco does not currently use it according to their &lt;/SPAN&gt;&lt;A href="http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/remote-api/config/alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.desc.xml" rel="nofollow noopener noreferrer"&gt;script description&lt;/A&gt;&lt;SPAN&gt;. script details can be found at {yourinstall}/alfresco/service/script/org/alfresco/repository/thumbnail/thumbnail.get however looking at the &lt;/SPAN&gt;&lt;A href="http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/remote-api/config/alfresco/templates/webscripts/org/alfresco/repository/thumbnail/thumbnail.get.js" rel="nofollow noopener noreferrer"&gt;source code&lt;/A&gt;&lt;SPAN&gt; it appears to try to use it. i dunno i doubt you need it&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;good luck&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 May 2012 20:07:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-with-thumbnail-rest-api/m-p/272998#M226128</guid>
      <dc:creator>danlangford</dc:creator>
      <dc:date>2012-05-19T20:07:25Z</dc:date>
    </item>
  </channel>
</rss>

