0

I am trying to get PageModelData for a page using TestContentArea page template, screenshot below. Exception occurs while creating RegionModelData for following

controllerAreaName=Framework, controllerName=Region, actionName=Region, areaName=Core, viewName=Main, regionAreaName=null, regionName=null, routeValues={}, metadata={}

What config is missing related to Region 'Main' view model?

//Get PageModel for a given page path.

contentProvider.getPageModel(clientPagePath, localization).getRegions().get("").getEntities();

Registered View Model

@Configuration
public class ContentServiceInitializer {

@RegisteredViewModels({
        @RegisteredViewModel(viewName = "TestContentArea", modelClass = TestContentAreaPageModel.class) })

@Component
@ModuleInfo(name = "Content Service", areaName = "content", description = "Content Service Module")
public static class ContentServiceViewInitializer extends AbstractModuleInitializer {
    @Override
    protected String getAreaName() {
        return "content";
    }
}

}

Page Template enter image description here

Exception

com.sdl.webapp.common.exceptions.DxaException: Cannot find a view model type for MvcDataImpl(controllerAreaName=Framework, controllerName=Region, actionName=Region, areaName=Core, viewName=Main, regionAreaName=null, regionName=null, routeValues={}, metadata={})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.