tridiontridion-2011core-services

Tridion core service: How to assign specific version TCM URI to a multimedia link field


While assigning values to multimedia link field of a component I want to assign TCM URI of a specific version of an Image. Tridion internally maintain version with suffix "-v" and corresponding version number for ex:- for 2nd version of a multimedia component my TCm URI will be tcm:pubNum-multiMediaCompoUniqueID-v2 and even I can open multimedia component with this "-v2" suffix URI through search functionality. Now let say I have created 5 version of a multimedia Image and around 5 version of a component and for each version of component I'm trying to assign "-v" suffix URI of image to component's multimedia link field then I'm getting the following error:-

"An expected version is found in URI: tcm:pubNum-compoUniqueID."

and xml of my component is like below:-

<imageField xmlns="uuid:e65ab5b8-babe-4146-a8e4-9b6fda694ea1" xlink:type="simple" xlink:href="tcm:pubNum-multiMediaCompoUniqueID-v1" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="HTML.zip"></imageField>

I'm getting the same error if I try to assign this manually too, I have also tried to escape double quotes and done some trouble shooting too.

So my simple quation is that if Tridion is maintaining all the version of a multimedia component then why it don't allow us to assign previous / specific version TCm URI of that multimedia component. As I'm doing an automation process for a client this might be a peculiar requirement but my client want to see for each version of component which exaclty version of Image was assigned (there can be difference in file extension of multimedia component accross version) and not the recent one. Is this possible?


Solution

  • There is no default way to do this, and even if you can use any API to retrieve an older version is not really recommended, because these old versions can be deleted when the "Purge Tool" is run

    In any case, it's not really a good practice to use Tridion Versioning system as a long term version control, if you want to keep both version, it will be better to create 2 different components.