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 credentials or via ticket.
I am trying to open an attachment from a task. I know the js-api provides some function for that purpose.
Basically, I see two possibilities:
- I download the content of the file through the js-api and then trying to view it “manually”
- I provide the direct url (raw url) to the attachment and by clicking on that link the attachment will be opened.
I tried both and both ways have some problems.
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.
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.
And that’s basically my question. Is there any possibility to authorize to Activiti through a hyperlink whether via credentials or via ticket?
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.
Can anybody explain how to properly display an attachment?
Again, the webapp is not based on ADF.
Thanks