on 01-15-2007 10:58 AM
Hi guru,
I have a problem for insert a document (word,excel,txt and so on...) in Binary Object table (use a MDM 5.5 SP4 fix 2) with Java Api.
this is my code:
<b>A2iFields flds = new A2iFields();</b>
//add data_ID
<b>flds.Add(new A2iField("Data_ID", new Value(myDataId)));</b>
//adding the "DataGroupId"
// I have only one data group
<b>flds.Add(new A2iField("Data_Group_ID", new Value(1)));</b>
//adding the name
<b>flds.Add(new A2iField("Name", new Value(myName)));</b>
//adding the Original Name
<b>flds.Add(new A2iField("Original_Name", new Value(myOriginalName)));</b>
// adding Description
<b>flds.Add(new A2iField("Description", new Value(myDescr)));</b>
//the name of Binary Object table is :"Binary_Object"
<b>int newImageId = repData.AddRecord("Binary_Object", flds, 0, 0)</b>
This code return always this error:
<b>ERROR e.GetErrorCode()=-5586944 STRINGEXCEPTION_MSG= e.message=AddRecord error a2i.core.StringException: AddRecord error</b>
I found in this forum this thread and I set the propeties of the Mdm repository:
<i>"....
Right-Click on the Repository and select Properties...
In this window change the value of the following:
Allow invalid images -> Yes
You may first have to change the setting Prohibit Photoshop Images -> No
...
"</i>
But my code goes always in error.
Can someone help me?
Hi Rocco,
There are a few fields that are mandatory while inserting data in the Binary Object table.
1. <b>Data ID</b>: wherein data in <b>Bytes</b> is provided
2. <b>Data Group ID</b>: Provides the Data Group ID in which the Binary Object will be stored
3. <b>Name</b>: Name to be assigned to the object
4. <b>Original Name</b>: Original File Name
5. <b>Original Location ID</b>: This is the ID of the Binary Object in the <b>Data Location Table</b>.(Internal to MDM)
In your code, you have not provided Original Location ID.
So first you will have to add a new record to the Data Location Table and then use AddRecord to add the Binary Object.
For adding a record to the Data Location Table you can use <b>AddDataLocation method of the Catalogdata class.
</b>
Hope this will solve your problem.
Let me know the result.
Regards,
<b>Rashmi Jadhav</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I have used this thread to add images via the java api and it works great, however from the data manager and image manager I am unable to generate thumbnails of images that have been added via the API. There is no error message. Any help on this? Should images be added another way via the API?
Thanks
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.