1

I am new to hybris. I am trying to use a key=value from project.properties in impex file.

I tried to copy the same key=value in my local.properties file as well. But it doesnt work.

My code :

project.properties/ local.properties

mykey=myvalue

coredata.impex

Insert_update User; uid[unique=true]; specialKey
;testuser;$mykey;

Where can I see any documentation for this

2 Answers2

2

You are in the right direction, just missing one intermediate step of importing property into impex macro key using correct processor.

1 - define your key in project or local properties file mykey=myvalue

2 - Import above in impex macro using ConfigPropertyImportProcesser

GenericItem[processor=de.hybris.platform.commerceservices.impex.impl.ConfigPropertyImportProcessor];pk[unique=true] 
$config-key=$mykey

3 - Run your impex with imported config macro

INSERT_UPDATE User; uid[unique=true]; specialKey
;testuser;$config-key;

NOTE : Moving key=value from project.properties to local.properties will not make a difference. The later file only has precedence over the values defined in project.properties and helps you to define/maintain/override such pairs as per application/deployment environment needs.

www.hybriscx.com
  • 1,129
  • 4
  • 22
1

This question already answered here before.

Your impex would be

# Import config properties into impex macros
UPDATE GenericItem[processor=de.hybris.platform.commerceservices.impex.impl.ConfigPropertyImportProcessor];pk[unique=true]

Insert_update User; uid[unique=true]; specialKey
;testuser;$config-mykey;
HybrisHelp
  • 5,518
  • 2
  • 27
  • 65