Hi,
The standard solution only gets the list of attached pictures without the content. When the user taps on one entry, a push notification is created and the user will receive the picture data later on.
But this requires to be online, so I want to fetch the notification pictures during the transmit and then be able to display them without the need of push requests.
Overriding the Notification.java object addDocumentArrayList(ArrayList<DocumentLink> linkedDocuments) method, I'm able to read each picture binary content. I created a Z BAPI, calling the already existing BAPI wrapper /SMERP/CORE_DOBDSDOCUMENT_GET and I get the content for each document link existing for each notification.
My problem is that I don't know how exactly I should store this binary data and other attributes in the Agentry DocumentLink Object in order to be able to display the picture.
Having already the basic DocumentLink properties set by the standard, I just set the picture field with the contents read from SAP with the method setPicture() in base64. Something like this:
byte[] fileDataFromBAPI = getDataAsByteArray(documentBAPI.getBinaryContent());
String fileDataInBase64 = dl.encodeBase64(fileDataFromBAPI);
dl.setPicture(fileDataInBase64);
I also modified the rules in Agentry to not create the push request for the already read document.
But when I try to open this picture, I just get the following error, is like the client is trying to access to the picture physically in the device, where it is not:
Do you have any ideas of what should I do when I store the picture data to the document link object and then how should I display the picture in the Agentry client?
Thank you in advance.
- Marçal