cancel
Showing results for 
Search instead for 
Did you mean: 

custom services with config.xml

jgdamron
Explorer
0 Kudos
464

We use successfully several commerce provided beans to help configure our backoffice configuration inside mybackoffice-backoffice-config.xml including the following:

<wz:assignproperty="newProduct.catalogVersion"value="@catalogVersionService.getCatalogVersion('myProductCatalog', 'Staged')"/>

<wz:assignproperty="newPrice.currency"value="@commonI18NService.getCurrency('USD')"/>

<wz:assignproperty="newPrice.unit"value="@unitService.getUnitForCode('pieces')"/>

<wz:assignproperty="newStockLevel.warehouse"value="@warehouseService.getDefWarehouse().get(0)"/>

All the above work great and help us set default values when customizing create-wizards. However, we would like to be able to use our own custom services for similar needs. For example:

<wz:assignproperty="newProduct.name"value="@myCustomService.getName('myInput')"/>

However, even if we define myCustomService as a bean inside mybackoffice-spring.xml or mybackoffice-backoffice-spring.xml it seems this is not available to the Spring context used by backoffice when processing mybackoffice-backoffice-config.xml.

Are there special configuration steps necessary to allow a custom bean/service to be accessible by config.xml? I could not find any special setup for the above OOTB beans that are working fine.

Accepted Solutions (1)

Accepted Solutions (1)

StefanKruk
Active Participant
0 Kudos

To use your own beans there you need to add your bean to the property

platformbackoffice.available.bean.names.for.spel=labelService,enumerationService,exceptionTranslationService,productCodeGenerator

See "hybris\bin\ext-platform-backoffice\platformbackoffice\project.properties"

jgdamron
Explorer
0 Kudos

Thank you so much stefankruk I completely missed the usage of platformbackoffice.available.bean.names.for.spel and that is exactly what I needed.

Answers (0)