cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to generate files with ant-bind-impex-template.xml in customized initialdata extension?

crescenzorega
Active Participant
1,610

hello, created a custom b2b following the directions given here

Creating a Customized B2B Accelerator with Modulegen

I wanted to understand how to use the generation of impex files through ant-bind-impex-template.xml or if there is a way to avoid hand-edit all files impex (store.impex, site.impex etc etc).

I read the posts related to this topic on the forum but also following the advice I can not generate the files

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member

When generated modules via modulegen it is required to set up initialdata.

Hybris offers bindImpexTemplate which is located in initialdata/resources/initialdata/ant/ant-bind-impex-template.xml

Change following variables from default to project specific in initialdata/resources/initialdata/ant/ant-bind-impex-template.xml:

 <macrodef name="bindImpexTemplate">
     <attribute name="addonname"/>
     <attribute name="contentCatalog" default="${contentCatalogToken}"/>
     <attribute name="productCatalog" default="${productCatalogToken}"/>
     <attribute name="storeName" default="${storeNameToken}"/>
     <attribute name="classificationCatalog" default="${classificationCatalogToken}"/>
     <attribute name="storeUid" default="${storeUidToken}"/>
     <attribute name="defaultPromoGrp" default="${defaultPromoGrpToken}"/>
     <attribute name="contentCatalogName" default="${contentCatalogNameToken}"/>
     <attribute name="productCatalogName" default="${productCatalogNameToken}"/>
     <attribute name="vendor" default="${vendorToken}"/>
     <attribute name="indexedType" default="${indexedTypeToken}"/>
     <attribute name="facetSearchConfigName" default="${facetSearchConfigNameToken}"/>

Change to:

 <macrodef name="bindImpexTemplate">      
     <attribute name="addonname" default="<your_project>initialdata"/>
     <attribute name="contentCatalog" default="<your_project>ContentCatalog"/>
     <attribute name="productCatalog" default="<your_project>ProductCatalog"/>
     <attribute name="storeName" default="<your_project>"/>
     <attribute name="classificationCatalog" default="<your_project>Classification"/>
     <attribute name="storeUid" default="<your_project>"/>
     <attribute name="defaultPromoGrp" default="<your_project>PromoGrp"/>
     <attribute name="contentCatalogName" default="<your_project> Content Catalog"/>
     <attribute name="productCatalogName" default="<your_project> Product Catalog"/>
     <attribute name="vendor" default="<your_project>Vendor"/>
     <attribute name="indexedType" default="<your_project>ProductType"/>
     <attribute name="facetSearchConfigName" default="<your_project>Index"/>

Change default generated path names in initial data to :

Add following task to initialdata/buildcallbacks.xml:

 <target description="Changes default variables to defined ones" name="bindImpexTemplate">
    <bindImpexTemplate/>
 </target>

Then go to initialdata and run:

ant bindImpexTemplate

You should have the output like:

bindImpexTemplate:

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_NAME__] was replaced by [<your_project>ContentCatalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_NAME__] was replaced by [<your_project>ProductCatalog]

  [echo] <your_project>initialdata: token [__STORE_NAME__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__CLASSIFICATION_CATALOG_NAME__] was replaced by [<your_project>Classification]

  [echo] <your_project>initialdata: token [__STORE_UID__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__DEFAULT_PROMO_GRP__] was replaced by [<your_project>PromoGrp]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_FULL_NAME__] was replaced by [<your_project> Content Catalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_FULL_NAME__] was replaced by [<your_project> Product Catalog]

  [echo] <your_project>initialdata: token [__VENDOR_NAME__] was replaced by [<your_project>Vendor]

  [echo] <your_project>initialdata: token [__INDEXED_TYPE__] was replaced by [<your_project>ProductType]

  [echo] <your_project>initialdata: token [__FACET_SEARCH_CONFIG_NAME__] was replaced by [<your_project>Index]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_NAME__] was replaced by [<your_project>ContentCatalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_NAME__] was replaced by [<your_project>ProductCatalog]

  [echo] <your_project>initialdata: token [__STORE_NAME__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__CLASSIFICATION_CATALOG_NAME__] was replaced by [<your_project>Classification]

  [echo] <your_project>initialdata: token [__STORE_UID__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__DEFAULT_PROMO_GRP__] was replaced by [<your_project>PromoGrp]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_FULL_NAME__] was replaced by [<your_project> Content Catalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_FULL_NAME__] was replaced by [<your_project> Product Catalog]

  [echo] <your_project>initialdata: token [__VENDOR_NAME__] was replaced by [<your_project>Vendor]

  [echo] <your_project>initialdata: token [__INDEXED_TYPE__] was replaced by [<your_project>ProductType]

  [echo] <your_project>initialdata: token [__FACET_SEARCH_CONFIG_NAME__] was replaced by [<your_project>Index]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_NAME__] was replaced by [<your_project>ContentCatalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_NAME__] was replaced by [<your_project>ProductCatalog]

  [echo] <your_project>initialdata: token [__STORE_NAME__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__CLASSIFICATION_CATALOG_NAME__] was replaced by [<your_project>Classification]

  [echo] <your_project>initialdata: token [__STORE_UID__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__DEFAULT_PROMO_GRP__] was replaced by [<your_project>PromoGrp]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_FULL_NAME__] was replaced by [<your_project> Content Catalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_FULL_NAME__] was replaced by [<your_project> Product Catalog]

  [echo] <your_project>initialdata: token [__VENDOR_NAME__] was replaced by [<your_project>Vendor]

  [echo] <your_project>initialdata: token [__INDEXED_TYPE__] was replaced by [<your_project>ProductType]

  [echo] <your_project>initialdata: token [__FACET_SEARCH_CONFIG_NAME__] was replaced by [<your_project>Index]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_NAME__] was replaced by [<your_project>ContentCatalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_NAME__] was replaced by [<your_project>ProductCatalog]

  [echo] <your_project>initialdata: token [__STORE_NAME__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__CLASSIFICATION_CATALOG_NAME__] was replaced by [<your_project>Classification]

  [echo] <your_project>initialdata: token [__STORE_UID__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__DEFAULT_PROMO_GRP__] was replaced by [<your_project>PromoGrp]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_FULL_NAME__] was replaced by [<your_project> Content Catalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_FULL_NAME__] was replaced by [<your_project> Product Catalog]

  [echo] <your_project>initialdata: token [__VENDOR_NAME__] was replaced by [<your_project>Vendor]

  [echo] <your_project>initialdata: token [__INDEXED_TYPE__] was replaced by [<your_project>ProductType]

  [echo] <your_project>initialdata: token [__FACET_SEARCH_CONFIG_NAME__] was replaced by [<your_project>Index]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_NAME__] was replaced by [<your_project>ContentCatalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_NAME__] was replaced by [<your_project>ProductCatalog]

  [echo] <your_project>initialdata: token [__STORE_NAME__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__CLASSIFICATION_CATALOG_NAME__] was replaced by [<your_project>Classification]

  [echo] <your_project>initialdata: token [__STORE_UID__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__DEFAULT_PROMO_GRP__] was replaced by [<your_project>PromoGrp]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_FULL_NAME__] was replaced by [<your_project> Content Catalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_FULL_NAME__] was replaced by [<your_project> Product Catalog]

  [echo] <your_project>initialdata: token [__VENDOR_NAME__] was replaced by [<your_project>Vendor]

  [echo] <your_project>initialdata: token [__INDEXED_TYPE__] was replaced by [<your_project>ProductType]

  [echo] <your_project>initialdata: token [__FACET_SEARCH_CONFIG_NAME__] was replaced by [<your_project>Index]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_NAME__] was replaced by [<your_project>ContentCatalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_NAME__] was replaced by [<your_project>ProductCatalog]

  [echo] <your_project>initialdata: token [__STORE_NAME__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__CLASSIFICATION_CATALOG_NAME__] was replaced by [<your_project>Classification]

  [echo] <your_project>initialdata: token [__STORE_UID__] was replaced by [<your_project>]

  [echo] <your_project>initialdata: token [__DEFAULT_PROMO_GRP__] was replaced by [<your_project>PromoGrp]

  [echo] <your_project>initialdata: token [__CONTENT_CATALOG_FULL_NAME__] was replaced by [<your_project> Content Catalog]

  [echo] <your_project>initialdata: token [__PRODUCT_CATALOG_FULL_NAME__] was replaced by [<your_project> Product Catalog]

  [echo] <your_project>initialdata: token [__VENDOR_NAME__] was replaced by [<your_project>Vendor]

  [echo] <your_project>initialdata: token [__INDEXED_TYPE__] was replaced by [<your_project>ProductType]

  [echo] <your_project>initialdata: token [__FACET_SEARCH_CONFIG_NAME__] was replaced by [<your_project>Index]


jivan_sanchez
Discoverer

Hello

For all of them who still are looking for solution to this, this is what worked for me:

https://www.linkedin.com/pulse/hybris-tips-1101-erhan-%C3%A7etin/

Former Member
0 Kudos

I got this and variables do not change

Trying to override old definition of task groovy_compile Trying to override old definition of task groovynature_compile_core Trying to override old definition of task groovynature_compile_web [taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.

runantbind: [echo] No impex templates found for mystoreinitaldata, location: /home/caner/Projects/bbbb/hybris/bin/custom/bbb/mystoreinitaldata/resources/mystoreinitaldata/import/coredata/contentCatalogs/yourcustomUKContentCatalog/ [echo] No impex templates found for mystoreinitaldata, location: /home/caner/Projects/bbbb/hybris/bin/custom/bbb/mystoreinitaldata/resources/mystoreinitaldata/import/coredata/productCatalogs/yourcustomUKProductCatalog/ [echo] No impex templates found for mystoreinitaldata, location: /home/caner/Projects/bbbb/hybris/bin/custom/bbb/mystoreinitaldata/resources/mystoreinitaldata/import/coredata/stores/yourcustomstoreName/ [echo] No impex templates found for mystoreinitaldata, location: /home/caner/Projects/bbbb/hybris/bin/custom/bbb/mystoreinitaldata/resources/mystoreinitaldata/import/sampledata/contentCatalogs/yourcustomUKContentCatalog/ [echo] No impex templates found for mystoreinitaldata, location: /home/caner/Projects/bbbb/hybris/bin/custom/bbb/mystoreinitaldata/resources/mystoreinitaldata/import/sampledata/productCatalogs/yourcustomUKProductCatalog/ [echo] No impex templates found for mystoreinitaldata, location: /home/caner/Projects/bbbb/hybris/bin/custom/bbbb/mystoreinitaldata/resources/mystoreinitaldata/import/sampledata/stores/yourcustomstoreName/ [echo] finished bind config

0 Kudos

Hi, This may help.

Additionally, you may either need to copy impex folders for product catalog, content catalog and stores for both core and sample data into the name of the catalogs that you are having after changing the bind file OR change the following line in that file: <for list="contentCatalogs/@{contentCatalog},productCatalogs/@{productCatalog},stores/@{storeName}" param="catalog"> and update your binding attributes

 <attribute name="contentCatalog" default="${contentCatalogToken}"/>
 <attribute name="productCatalog" default="${productCatalogToken}"/>

to point to your custom values.

Lastly, add a callback during build of your initialdata extension

 <macrodef name="**initialdata_before_build">
         <sequential> <bindImpexTemplate addonname="${extname}" /> </sequential>
 </macrodef>

The build will now update contents of the impex files.

Former Member
0 Kudos

I got this and variables do not change

Trying to override old definition of task groovy_compile Trying to override old definition of task groovynature_compile_core Trying to override old definition of task groovynature_compile_web [taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.

runantbind: [echo] No impex templates found for mystoreinitaldata, location: /home/caner/Projects/bbbb/hybris/bin/custom/bbb/mystoreinitaldata/resources/mystoreinitaldata/import/coredata/contentCatalogs/yourcustomUKContentCatalog/

crescenzorega
Active Participant
0 Kudos

Hi , I've already tried this solution but the files are not updated

raghavendra_desu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi ,

Please add the below content after the import tag in buildcallbacks.xml from your initialdata extension and run ant all, then all the files should be updated with respective values.

 <bindImpexTemplate
         addonname="merchandiseinitialdata"
         contentCatalog="hybrisContentCatalog"
         productCatalog="hybrisProductCatalog"
         storeName="Merchandise"
         classificationCatalog="hybrisClassification"
         storeUid="hybris"
         defaultPromoGrp="hybrisPromoGroup"
         contentCatalogName="Merchandise Content Catalog"
         productCatalogName="Merchandise Product Catalog"
         vendor="Default Vendor"
         indexedType="hybrisProductType"
         facetSearchConfigName="hybrisIndex" />

Regards,

Raghavendra.

Former Member
0 Kudos

I got this and variables do not change

Trying to override old definition of task groovy_compile Trying to override old definition of task groovynature_compile_core Trying to override old definition of task groovynature_compile_web [taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.

runantbind: [echo] No impex templates found for mystoreinitaldata, location: /home/caner/Projects/bbbb/hybris/bin/custom/bbb/mystoreinitaldata/resources/mystoreinitaldata/import/coredata/contentCatalogs/yourcustomUKContentCatalog/