How to show a Sample Document as a Downloadable link in an Application Page

1
0
-1

Hi
I need to implement a scenario where the user can download a sample Document and then fill out the document and upload again.
I am stuck in the part where the sample document can be provided.
The page is an Application page . We use the Page to start a Process instance.
The document should be visible as a Downloadable link to the user.
When the User clicks on the Document link, the sample document is downloaded on the users computer.

What are the possible ways to do that ?

1 answer

1
0
-1
This one is the BEST answer!

The first thing is is that the Application Page is NOT part of the process and you are therefore unable to process the Bonitasoft way documents. This is as you've already found.

The upload of the document is part of the process and therefore easy enough I'm sure you've worked this out already.

How to do the sample document on the application page though requires you to think outside the confines of Bonitasoft as such and back to basic HTML.

This is how we did it:

Sample documents go into a folder on the server:

NOTE: assuming your server is server:8080/bonita

server:8080/ourBusinessSampleDocuments

We then simply create a Custom Widget (applicationSampleFile) with a Empty Controller and one parameter, fileName

the Widget Template has the following code:

<a href="http://server:8080/ourBusinessSampleDocuments/{{ properties.filename }}" target="_blank">Download</a>

Add this to the page, give it the proper file name in the Widgets parameter and viola! All done.

regards
Seán

PS: As this reply offers an answer your question, and if you like it, please Mark UP and/or as Resolved.

Comments

Submitted by Dibyajit.Roy on Tue, 04/25/2017 - 08:29

Thanks, this worked fine.

Notifications