Skip to main content

Posts

Showing posts from April, 2016

Troubleshoot a DXA Java Module

I was asked recently to troubleshoot a DXA 1.5 module that was not behaving properly. The apparent issue was that nested embedded fields in all models were not filled in with values once the Semantic Mapper would execute and create the models. This prompted me to do a little bit of digging into the Semantic Mapper and its registries of model entities, property and field maps. It turned out the models in the custom module were not being scanned and as such not registered as entities by the Semantic Mapper. The Semantic Mapper is DXA's de facto model factory that converts a Generic Page or Component into a specific page or component model, by mapping fields in the generic object to properties in the specific object. The solution was to simply call method registerEntities on the SemanticMapperRegistry singleton and pass it the base package name. The logic will then scan for entity models (i.e. classes that extend DXA's  AbstractEntityModel class) in sub-packages and regis