cancel
Showing results for 
Search instead for 
Did you mean: 

problem importing images to MDM with API

Former Member
0 Kudos

Hello,

with the following code I try to import (create) images in the MDM image table. The original should NOT be stored in the MDM.

When I run the code, the Image will be created in the images table but there it shows no thumbnail of the image. If the image is imported manually the thumbnail appears.

I there anything I forgot?


ImageBlobRecord r;
r = RecordFactory.createEmptyImageRecord(rSchema.getTableId("Images"));

r.setDataLocationId(location);
r.setDataGroupId(datagroup);
r.setOriginalName(new StringValue(filename));
r.setHasOriginal(new BooleanValue(false));
r.setBinary(new BinaryValue(data));
r.setFormat(new IntegerValue(3));
r.setCode(filename);
r.setName(new StringValue(filename));
r.setDescription(new StringValue("description"));
r.setHasThumbnail(new BooleanValue(true));

try{
     CreateRecordCommand crc = new CreateRecordCommand(usc);
     crc.setRecord(r);
     crc.execute();
} catch (Exception e){
...
}

I use MDM 5.5.

Thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Dennis,

I want to upload an image in MDM via Java APIs. Can you please tell me what is DataLocationId and DataGoupId? What values should i set for these parameters?

The other thing i want to ask is, can I save this image as a Lookup Value in Main Table?

Any help would be great.

Regards,

Sruti

Former Member
0 Kudos

Hi,

thanks for your hint Walter!

I also found the [SAP Note 1235244|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_mdm/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d31323335323434%7d] on this topic.

When I import an image there is the option either to store the original in the repository or just to create a link to the original on the filesystem. After I generate the thumbnails with the datamanager as mentioned above, the attribute "original in repository" is "YES".

As we do not store our images in the rep, is there any possibility to avoid this?

Cheers, Dennis

Former Member
0 Kudos

Hi Dennis,

This sounds like a bug. Please report it via the normal channel.

Regards,

Walter

Former Member
0 Kudos

Hi,

The behaviour you are seeing is not an error. The MDM API's do not generate thumbnails for uploaded images. If you wish to create thumbnails for images not imported via the MDM Data Manager, you will need open the Data Manager and generate the thumbnails for the images which were uploaded via the API.

Walter