Book a Demo

Author Topic: Images ImportRefData questions  (Read 3595 times)

Michael Junkin

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Images ImportRefData questions
« on: November 01, 2014, 06:10:08 am »
Hi -

EA Version: 10.0.1007

I'm using

repository.CustomCommand("Repository", "ImportRefData", imageRefDataStream);

from a java app to import images into an EA project. The images appear to be imported correctly. Some questions remain, however:

- When I export the model images (using Project | Model Import/Export | Export Reference Data) the resulting XML contains IDs different from the ones I specified in imageRefDataStream.
- When I re-import, however, the images are not duplicated - the originals appear to be replaced (this is good.)

So:

1. How does ImportRefData determine when to add a new image vs. replace an existing one?
2. If the imageId is changed, how can I determine (programmatically via the API) what it has been replaced with? This is important as I need to associate diagram elements with the images by ImageID.
3. Has this issue been fixed in later EA versions? If so, which ones?

Thanks in advance, Michael



qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Images ImportRefData questions
« Reply #1 on: November 01, 2014, 09:30:52 am »
In an earlier version the import mangled the IDs completely. This did not get fixed for a long time so I decided to do the import completely by myself (placing the images in t_image). That way I still have full control over what is imported.

No idea how the importRefData behaves. You likely need to experiment a bit. Myself, I would not expect the result I wanted to have ;) The method you use isn't documented anyway. So using Repository.Execute gives me a bit more trust in what happens.

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Images ImportRefData questions
« Reply #2 on: November 03, 2014, 08:44:06 am »
1. Elsewhere in EA, images now use a crc of the image itself as the id as a solution to various problems with multiple repositories. I don't know if this is done when importing via reference data. If it doesn't then I suspect it would be using the name as the key.
2. I don't think there is anything available by the API.
3. I wouldn't classify it as a bug.

CustomCommand is an internal API, and despite it being consistent across a large number of builds, its could change without notice.

I assume the behavior would be the same for the GUI, but the purpose of the GUI is to transfer between models, and there's nothing about what you have described that is preventing that.