on 05-12-2009 3:03 PM
How to i import images into the Images table with the mdm java api? The images should not be stored as a blob in mdm, just a reference to the file system. How to i have to set the different fields of the ImagesBlobRecord.
i tried something like this:
final ImageBlobRecord record = RecordFactory.createEmptyImageRecord(imagesTableSchema.getTable().getId());
try {
final byte[] demoPicture = { 0x10, 0x10 };
record.setName(new StringValue("8400 Gruppe unten.tif"));
record.setOriginalName(new StringValue("8400 Gruppe unten.tif"));
record.setHasOriginal(new BooleanValue(false));
record.setDataLocationId(new GroupNodeId("
cde271489
d:
Document and Settings
Spilker
My Documents"));
record.setDataGroupId(new GroupNodeId(1));
record.setBinary(new BinaryValue(demoPicture));
record.setWidth(new IntegerValue(400));
record.setHeight(new IntegerValue(300));
record.setIsVector(new BooleanValue(false));
record.setFormat(null);
} catch (final IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (final MdmValueTypeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
this gives an invalid ID format.
I´m also not sure about all the other fields where IDßs are required, which ID´s to use. Do i have to use third party libraries to get for example width and height of the pictures before using the setWidth and setHeight methods or are these values automatically filled during the import.
Some code snippet about how to use the various set functions would be really nice.
Hi Joerg,
I think that what you are trying to do (save a file location as a new image) via the API's is not possible.
Walter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.