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

How to read the local.properties from backoffice-config.xml

former_member625816
Discoverer
0 Kudos
1,255

Hello Experts, I am facing issue while using the referenceSearchCondition to narrow down my results. Value of the referenceSeachCondition am trying to get from the local.properties with the below mentioned ways snippet. But i couldn't able to make out.

     </wz:editor-parameter>
     <wz:name>referenceSearchCondition_categoryLevel</wz:name> 
         <wz:value>{@configurationService.getConfiguration().getString("category.level.code")}      </wz:value>
    </wz:editor-parameter>

<wz:editor-parameter>
	<wz:name>referenceSearchCondition_categoryLevel_contains</wz:name>
    <wz:value>spring.getBean('configurationService').getConfiguration().getString(parentObject.getCategoryLevel().getCode())}</wz:value>
</wz:editor-parameter>

Can anyone please throw some light like how to call the service from the config.xml
Thanks,
Vikas B

Accepted Solutions (0)

Answers (1)

Answers (1)

arvind-kumar_avinash
Active Contributor

Please try the following code:

<wz:value>spring.getBean("configurationService").getConfiguration().getString("category.level.code")</wz:value>

Please make sure you have a value configured for the key, category.level.code in the local.properties file or your extension's project.properties file.

former_member625816
Discoverer
0 Kudos

Hi Arvind Kumar Avinash,

Thanks for quick reply.

I have tried the above code , still am not able to read am facing below issue.

de.hybris.platform.servicelayer.search.exceptions.FlexibleSearchException: SQL search error - enable the property 'flexible.search.exception.show.query.details' for more details

Caused by: java.sql.SQLDataException: data exception: invalid character value for cast

Thanks ,

Vikas B

arvind-kumar_avinash
Active Contributor
0 Kudos

Hi Vikas - The error you got might be because of some other code. Reading of config properties will not give you FlexibleSearch error.