protected void storeCmsPageInModel(final Model model, final AbstractPageModel cmsPage) {
   if (model != null && cmsPage != null) {
     model.addAttribute(CMS_PAGE_MODEL, cmsPage);
     if (cmsPage instanceof ContentPageModel) {
       storeContentPageTitleInModel(
           model, getPageTitleResolver().resolveContentPageTitle(cmsPage.getTitle()));
     }
   }
 }
 protected String getViewForPage(final AbstractPageModel page) {
   if (page != null) {
     final PageTemplateModel masterTemplate = page.getMasterTemplate();
     if (masterTemplate != null) {
       final String targetPage = cmsPageService.getFrontendTemplateName(masterTemplate);
       if (targetPage != null && !targetPage.isEmpty()) {
         return PAGE_ROOT + targetPage;
       }
     }
   }
   return null;
 }