sap-commerce-cloudimpex

Media is not importing correctly when importing using import script


I need to create one import script along with media folder which will create necessary banners in db.

I have created a zip file which contains importscript.impex file and media folder with required jsp files.

When I am importing zip file though import script, it starts complaining about media path issue.

Sample Impex -

INSERT_UPDATE Media ; $contentCV[unique=true] ; code[unique=true]                                 ; mediaFormat(qualifier) ; realfilename   ; @media[translator=de.hybris.platform.impex.jalo.media.MediaDataTranslator] ; mime[default='image/jpeg'] ; folder(qualifier)[default='images'] ; altText         
                    ;                         ; /images/banners/site/Default/abc.jpg              ; Default                ; abc.jpg        ; /media/abc.jpg        ;                            ;                                     ; ""

How can i give my folder media reference in script ?


Solution

  • Just try using only media name (abc.jpg) without any path in the import script and upload your media zip folder while running your import script.


    Go to HMC/Backoffice import tools then upload importsript.impex or *.csv which has the data to import

    Import file looks like:

    INSERT_UPDATE Media ; &Item ; @media[translator=de.hybris.platform.impex.jalo.media.MediaDataTranslator] ; catalog(id)[allownull=true] ; catalogVersion(catalog(id),version)[unique=true,allownull=true] ; code[unique=true,allownull=true]   ; folder(qualifier)[forceWrite=true] ; mediaContainer(catalogVersion(catalog(id),version),qualifier) ; mediaFormat(qualifier) ; realFileName                          
                        ; Item0 ; 8797897457694.gif                                                          ; testContentCatalog          ; testContentCatalog:Staged                                       ; ContentPageModel__function_preview ; root                               ;                                                               ;                        ; ContentPageModel__function_preview.gif
    

    enter image description here

    Now in the next screen, you can see the option to upload the associated media folder. There you need to upload a zip file containing the media with the same name you have mentioned in the script.

    enter image description here

    Click on Start to trigger the job and check it's status from cronJob.