Media Items Synchronization

During the synchronization of a catalog version, all the media items in the source catalog version are copied. After synchronization, every media item is available twice: once in the source catalog version, and once in the target catalog version.

However, the files referenced by the media items will not be duplicated and are available only once. Instead of creating an individual copy of a Media-item-referenced file in the target catalog version, the Media item in the target catalog version holds a reference to the original file. The concept is similar to symbolic links. For more information, see Synchronizing Catalog Versions.

For example, in the graphic, there is one catalog version Staged, which is used as the source catalog version for synchronization. This Staged catalog version holds one product, 30124. The product 30124 holds two Media items, 30124_medium and 30124_thumbnail. Each Media item has an individual image file, 30124_medium.jpg and 30124_thumbnail.jpg, respectively.

After a synchronization from Staged to Online, the product 30124 is available twice: once in the Staged catalog version, and once more in the Online catalog version. The Media items, 30124_medium and 30124_thumbnail are also available twice. However, the actual files represented by the media items, 30124_medium.jpg and 30124_thumbnail.jpg are also available once. The media items in the Online catalog version do not have an individual copy of the files, but holds a reference to the 30124_medium.jpg and 30124_thumbnail.jpg files instead.

When you use different catalog versions in a synchronization scenario, you have to modify media every now and then to match an updated assortment. If you modify a media file in the source catalog version, SAP Commerce ensures that references to the original media file remain correct for target catalog versions. If the media file was simply overwritten and no references were updated in the process, then the target catalog version would still hold the reference to the media file of the source catalog version. As this file would have been overwritten, however, the target catalog version would then wrongly reference the new media file. In essence, you would end up with the target catalog version also showing the new media, when it should be displaying the old media.

Therefore, SAP Commerce modifies the references of the media item to hold the old media. Technically, this is done using the ensures that references to the original media file remain correct for target catalog versions. If the media file was simply overwritten and no references were updated in the process, then the target catalog version would still hold the reference to the media file of the source catalog version. As this file would have been overwritten, however, the target catalog version would then wrongly reference the new media file. In essence, you would end up with the target catalog version also showing the new media, when it should be displaying the old media.dataPK attribute of a media item. Do not modify this attribute or the reference mechanism may fail to work correctly. This reference consistency mechanism is fully automated and transparent. You do not have to worry about maintaining references manually. Just modify, upload, scale, convert your images to your liking, and SAP Commerce will deal with the references.

In the graphic, the original 30124_medium.jpg ensures that references to the original media file remain correct for target catalog versions. media file in the Staged catalog version was replaced by a modified file. The 30124_medium media item in the Online catalog version still references the original 30124_medium.jpg file. SAP Commerce now makes sure that the 30124_medium media item in the Staged catalog version and the 30124_medium media item in the Online catalog version each reference the respective 30124_medium.jpg file.

During a synchronization, the 30124_medium media item in the Online catalog version will be modified to also reference the new 30124_medium.jpg file. This means that after a synchronization, the previously used 30124_medium.jpg file will no longer be used by either catalog version.