on 02-19-2018 2:31 PM - last edited on 02-04-2024 4:28 AM by postmig_api_4
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.