Skip to Content
author's profile photo Former Member
Former Member

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

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 a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Feb 19, 2018 at 04:17 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 20, 2018 at 11:28 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.