Search in sources :

Example 1 with ViewContext

use of org.springframework.roo.addon.web.mvc.views.ViewContext in project spring-roo by spring-projects.

the class ThymeleafMVCViewResponseService method install.

@Override
public void install(Pom module) {
    // Is necessary to install thymeleaf dependencies
    addThymeleafDependencies(module);
    // Add JasperReport dependencies
    addJasperReportsDependencies(module);
    // Add JasperReport export classes
    addJasperReportExportClasses(module);
    // Is necessary to generate the main controller
    addMainController(module);
    // Thymeleaf needs Datatables component to list
    // data, so is necessary to install Datatables resources
    addThymeleafDatatablesResources(module);
    // Is necessary to copy static resources
    copyStaticResources(module);
    // Add application properties
    addApplicationProperties(module);
    // Add all available WebJar containing required static resources
    addWebJars(module);
    // Delegate on view generation to create view elements
    ViewContext<ThymeleafMetadata> ctx = new ViewContext<ThymeleafMetadata>();
    ctx.setProjectName(getProjectOperations().getProjectName(""));
    ctx.setVersion(getProjectOperations().getPomFromModuleName("").getVersion());
    getViewGenerationService().addIndexView(module.getModuleName(), ctx);
    getViewGenerationService().addLoginView(module.getModuleName(), ctx);
    getViewGenerationService().addErrorView(module.getModuleName(), ctx);
    getViewGenerationService().addDefaultLayout(module.getModuleName(), ctx);
    getViewGenerationService().addDefaultLayoutNoMenu(module.getModuleName(), ctx);
    getViewGenerationService().addHomeLayout(module.getModuleName(), ctx);
    getViewGenerationService().addDefaultListLayout(module.getModuleName(), ctx);
    getViewGenerationService().addFooter(module.getModuleName(), ctx);
    getViewGenerationService().addHeader(module.getModuleName(), ctx);
    getViewGenerationService().addMenu(module.getModuleName(), ctx);
    getViewGenerationService().addModal(module.getModuleName(), ctx);
    getViewGenerationService().addModalConfirm(module.getModuleName(), ctx);
    getViewGenerationService().addModalConfirmDelete(module.getModuleName(), ctx);
    getViewGenerationService().addModalExportEmptyError(module.getModuleName(), ctx);
    getViewGenerationService().addModalConfirmDeleteBatch(module.getModuleName(), ctx);
    getViewGenerationService().addSessionLinks(module.getModuleName(), ctx);
    getViewGenerationService().addLanguages(module.getModuleName(), ctx);
    getViewGenerationService().addAccessibilityView(module.getModuleName(), ctx);
    getViewGenerationService().addDefaultLayoutNoMenu(module.getModuleName(), ctx);
    // Add i18n support for english language and use it as default
    getI18nOperations().installLanguage(new EnglishLanguage(), true, module);
}
Also used : ViewContext(org.springframework.roo.addon.web.mvc.views.ViewContext) EnglishLanguage(org.springframework.roo.addon.web.mvc.i18n.languages.EnglishLanguage)

Aggregations

EnglishLanguage (org.springframework.roo.addon.web.mvc.i18n.languages.EnglishLanguage)1 ViewContext (org.springframework.roo.addon.web.mvc.views.ViewContext)1