<?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 APS Attachment in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/aps-attachment/m-p/2670#M665</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am developing an external webapp (based on Javascript) that is using the alfresco-js-api to communicate with Alfresco Process Services (1.6.0). I want to display an attached document in the browser.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, the js-api is working fine. I can authorize and connect to Activiti either via credentials or via ticket.&lt;/P&gt;&lt;P&gt;I am trying to open an attachment from a task. I know the js-api provides some function for that purpose.&lt;/P&gt;&lt;P&gt;Basically, I see two possibilities:&lt;/P&gt;&lt;OL style="margin-top: 0cm;"&gt;&lt;LI&gt;I download the content of the file through the js-api and then trying to view it “manually”&lt;/LI&gt;&lt;LI&gt;I provide the direct url (raw url) to the attachment and by clicking on that link the attachment will be opened.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I tried both and both ways have some problems.&lt;/P&gt;&lt;P&gt;When I am going to download the content it’s an asynchronous action. This means, when I am trying to open a new tab after the content has been downloaded, the browser will always recognize this new tab/window as pop up and blocks it. This is not specifically related to the Activiti URL, but to the fact that the download is asynchronous. So, I think it’s not a very good solution. Maybe for desktops it’s easier to make an exception for that URL for the whole landscape, but on mobile end devices it’s quite harder.&lt;/P&gt;&lt;P&gt;Then, I tried to provide the raw URL through a hyperlink. Whenever the end user clicks on it the action is synchronous and the browser does not detect this behavior as pop up. Unfortunately, I am not able to pass the credentials to this request. This is NOT done via the js-api.&lt;/P&gt;&lt;P&gt;And that’s basically my question. Is there any possibility to authorize to Activiti through a hyperlink whether via credentials or via ticket?&lt;/P&gt;&lt;P&gt;I tried to find a solution for that by calling the URL with an REST client. I passed the credentials to the request, but it is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody explain how to properly display an attachment?&lt;/P&gt;&lt;P&gt;Again, the webapp is not based on ADF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Sep 2017 08:08:10 GMT</pubDate>
    <dc:creator>phoefler</dc:creator>
    <dc:date>2017-09-26T08:08:10Z</dc:date>
    <item>
      <title>APS Attachment</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/aps-attachment/m-p/2670#M665</link>
      <description>Hallo,I am developing an external webapp (based on Javascript) that is using the alfresco-js-api to communicate with Alfresco Process Services (1.6.0). I want to display an attached document in the browser.First, the js-api is working fine. I can authorize and connect to Activiti either via credenti</description>
      <pubDate>Tue, 26 Sep 2017 08:08:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/aps-attachment/m-p/2670#M665</guid>
      <dc:creator>phoefler</dc:creator>
      <dc:date>2017-09-26T08:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: APS Attachment</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/aps-attachment/m-p/2671#M666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note on the downloading. You can invoke a download action without any popups or user interaction. The "traditional" workaround is to create a hyperlink dynamically and invoke the action, here's one of the examples:&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-core/src/dialogs/download-zip.dialog.ts#L129" title="https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-core/src/dialogs/download-zip.dialog.ts#L129" rel="nofollow noopener noreferrer"&gt;alfresco-ng2-components/download-zip.dialog.ts at master · Alfresco/alfresco-ng2-components · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We also got&amp;nbsp;several helper&amp;nbsp;functions to invoke the download of the raw data when fetched from the ACS/APS in the ContentService:&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-core/src/services/content.service.ts" title="https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-core/src/services/content.service.ts" rel="nofollow noopener noreferrer"&gt;alfresco-ng2-components/content.service.ts at master · Alfresco/alfresco-ng2-components · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can refer to the code for some snippets or ideas how to do that with just js-api.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 11:20:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/aps-attachment/m-p/2671#M666</guid>
      <dc:creator>dvuika</dc:creator>
      <dc:date>2017-09-27T11:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: APS Attachment</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/aps-attachment/m-p/2672#M667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo Denys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if I understand your suggestion completely.&lt;/P&gt;&lt;P&gt;As far as I understood you would recommend generating an dynamic hyperlink to the raw URL of the content.&lt;/P&gt;&lt;P&gt;For example this URL can look like this: &lt;A class="unlinked"&gt;https://HOST/activiti-app/app/rest/content/2002/raw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can generate such a url and show the hyperlink to the user. Then, the problem is, that the request is not authorized.&lt;/P&gt;&lt;P&gt;This is exactly the solution I've described with point 2 in my initial post. Maybe I do not get your suggestion at this point. When calling this URL with a REST client a HTTP401 is returned even when the Basic Auth is set.&lt;IMG alt="REST Client calling raw URL" class="image-1 jive-image j-img-original" src="https://connect.hyland.com/legacyfs/online/alfresco/16542_snipaste_20170927_133627.png" style="width: 620px; height: 575px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other requests like tasks/query are working fine this way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Sep 2017 11:37:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/aps-attachment/m-p/2672#M667</guid>
      <dc:creator>phoefler</dc:creator>
      <dc:date>2017-09-27T11:37:26Z</dc:date>
    </item>
  </channel>
</rss>

