Hey guys,
I read this: https://documentation.bonitasoft.com/6.x-7.2/documents-0 and tried to implement this but faild.
I tried two ways, that I will show you and maybe some of you can help me and say what the next steps could be.
First try:
I got the url of my pdf, its: documentDownload?fileName=BookOne.pdf&contentStorageId=1643
https://ibb.co/fPvwXJ
So on my Homepage I have a table with all requests and I thought by using the url in a link I could get the Pdf, but the url doesnt work. The variable is called dokument_id because I was to lazy to rename it, so Im saving the url in dokument_id This is how I tried on the homepage to get the pdf
https://ibb.co/kfakRd
Second try
I got the id, it is 1643. And the documentation says that I have to use this code
import org.bonitasoft.engine.bpm.document.Document;
import org.bonitasoft.engine.bpm.document.DocumentValue;
Document doc=apiAccessor.getProcessAPI().getDocument(sub_docId);
DocumentValue docValue=new DocumentValue(apiAccessor.getProcessAPI().getDocumentContent(doc.getContentStorageId()), doc.getContentMimeType(), doc.getContentFileName());
return docValue;
Im working with the UI Designer and Im new to bonita, so I dont know how to use this in the designer. Even if I paste this in a java script variable and dont know how to access this pdf to download it.
I guess the second way is the right way, but I dont know how to implement that.
help, pls