cancel
Showing results for 
Search instead for 
Did you mean: 

How to use properties of local.properties in composition handler in datahub

Former Member
0 Kudos

Hi All,

Is there any way to use property which is defined in local.properties of datahub in compostion handler o grouping handler? for example if we define property like below datahub.category = abc

how to use datahub.category in handler class ??

Regards, Rasika

Accepted Solutions (1)

Accepted Solutions (1)

VinayKumarS
Active Contributor
0 Kudos

Add the property and value into the local.properties and inject the value using spring xml file.

For example we have datahub clean up properties defined in local.properties. which are injected in spring bean class.. sample given below.

 -<bean class="com.hybris.datahub.cleanup.jdbc.AbstractJdbcCleanupService" abstract="true" id="abstractJdbcCleanupService">
 
 <property name="jdbcTemplate" ref="jdbcTemplate"/>
 
 <property name="namedParameterJdbcTemplate" ref="namedParameterJdbcTemplate"/>
 
 <property name="dataSourceMetaData" ref="dataSourceMetaData"/>
 
 <property name="maxUpdateBatchSize" value="${datahub.sql.maxUpdateBatchSize}"/>
 
 <property name="platformTransactionManager" ref="transactionManager"/>
 
 </bean>

Similarly you can do the same.

Answers (1)

Answers (1)

0 Kudos

Injecting the property in spring xml.And using it as a field in your class will allow you to access it.Also there is another way of loading the context object and accessing all the properties out of it.But the spring injection is the better one.