Skip to Content

Hello everyone

As you might know, since NW 7.31 it is possible to display the user photo of the initiator of a BPM Task, in the Stream View of BPM Inbox. It shows as it follows:

/wp-content/uploads/2015/11/blog1_829036.jpg

The photo which is shown is stored in the UME (User Management Engine).

On NW 7.31 and NW 7.40, the NetWeaver only provides the APIs to set the photo for each user, but does not provide a shipped UI in order to upload such a photo.

As of NW 7.5, the /useradmin application already have a User Interface to upload the photo for each user.


For NW 7.31 and NW 7.40, according to BPM Inbox documentation, a custom application can be developed to make the upload on versions prior to NW 7.5. This is stated at:

http://help.sap.com/saphelp_nw74/helpdata/en/d1/913a66f9d94b2aa103552f004d4213/content.htm?frameset=/en/CE/8421316EDD4190A19BD28988555D1C/frameset.htm&current_toc=/en/ff/165a665c16482e9c282ce6b0e67776/plain.htm&node_id=159


It’s important to mention that the method setPhoto described in this documentation receives as a parameter a byte array (byte[]).


Here is an example on how to retrieve a correct byte[] from an image residing in the file system:


File file = new File(“C:\\<path>\\<to>\\<photo>”);

byte[] buffer = new byte[4096];

ous = new ByteArrayOutputStream();

ios = new FileInputStream(file);

int read = 0;

while ((read = ios.read(buffer)) != -1) {

      ous.write(buffer, 0, read);

}

byte[] fileContent = ous.toByteArray();



After filling the fileContent variable with the resulting byte array, it can be passed as a parameter to the method setPhoto of the IUserMaint class object that you create.


In case the conversion to byte array is not properly made, the image might get corrupted and as a result the photo might not get displayed, and the following symbol is displayed instead:

/wp-content/uploads/2015/11/blog2_829070.jpg

Have that in mind in case you develop a custom UI and your photo is not appearing in BPM Inbox.

Regards,
Armando

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply