com.jfinal.template.source.ClassPathSourceFactory Java Examples
The following examples show how to use
com.jfinal.template.source.ClassPathSourceFactory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EnjoyConfig.java From spring-boot-demo with MIT License | 6 votes |
@Bean(name = "jfinalViewResolver") public JFinalViewResolver getJFinalViewResolver() { JFinalViewResolver jfr = new JFinalViewResolver(); // setDevMode 配置放在最前面 jfr.setDevMode(true); // 使用 ClassPathSourceFactory 从 class path 与 jar 包中加载模板文件 jfr.setSourceFactory(new ClassPathSourceFactory()); // 在使用 ClassPathSourceFactory 时要使用 setBaseTemplatePath // 代替 jfr.setPrefix("/view/") JFinalViewResolver.engine.setBaseTemplatePath("/templates/"); jfr.setSessionInView(true); jfr.setSuffix(".html"); jfr.setContentType("text/html;charset=UTF-8"); jfr.setOrder(0); return jfr; }
Example #2
Source File: AppJbootServiceImplGenerator.java From jboot-admin with Apache License 2.0 | 6 votes |
@Override public void generate(List<TableMeta> tableMetas) { System.out.println("Generate base model ..."); System.out.println("Base Model Output Dir: " + baseModelOutputDir); Engine engine = Engine.create("forServiceImpl"); engine.setSourceFactory(new ClassPathSourceFactory()); engine.addSharedMethod(new StrKit()); engine.addSharedObject("getterTypeMap", getterTypeMap); engine.addSharedObject("javaKeyword", javaKeyword); for (TableMeta tableMeta : tableMetas) { genBaseModelContent(tableMeta); } writeToFile(tableMetas); }
Example #3
Source File: EnjoyConfig.java From spring-boot-demo with MIT License | 6 votes |
@Bean(name = "jfinalViewResolver") public JFinalViewResolver getJFinalViewResolver() { JFinalViewResolver jfr = new JFinalViewResolver(); // setDevMode 配置放在最前面 jfr.setDevMode(true); // 使用 ClassPathSourceFactory 从 class path 与 jar 包中加载模板文件 jfr.setSourceFactory(new ClassPathSourceFactory()); // 在使用 ClassPathSourceFactory 时要使用 setBaseTemplatePath // 代替 jfr.setPrefix("/view/") JFinalViewResolver.engine.setBaseTemplatePath("/templates/"); jfr.setSessionInView(true); jfr.setSuffix(".html"); jfr.setContentType("text/html;charset=UTF-8"); jfr.setOrder(0); return jfr; }
Example #4
Source File: JbootServiceInterfaceGenerator.java From jboot with Apache License 2.0 | 6 votes |
@Override public void generate(List<TableMeta> tableMetas) { System.out.println("Generate base model ..."); System.out.println("Base Model Output Dir: " + baseModelOutputDir); Engine engine = Engine.create("forService"); engine.setSourceFactory(new ClassPathSourceFactory()); engine.addSharedMethod(new StrKit()); engine.addSharedObject("getterTypeMap", getterTypeMap); engine.addSharedObject("javaKeyword", javaKeyword); for (TableMeta tableMeta : tableMetas) { genBaseModelContent(tableMeta); } writeToFile(tableMetas); }
Example #5
Source File: EnjoyConfig.java From spring-boot-demo with MIT License | 6 votes |
@Bean(name = "jfinalViewResolver") public JFinalViewResolver getJFinalViewResolver() { JFinalViewResolver jfr = new JFinalViewResolver(); // setDevMode 配置放在最前面 jfr.setDevMode(true); // 使用 ClassPathSourceFactory 从 class path 与 jar 包中加载模板文件 jfr.setSourceFactory(new ClassPathSourceFactory()); // 在使用 ClassPathSourceFactory 时要使用 setBaseTemplatePath // 代替 jfr.setPrefix("/view/") JFinalViewResolver.engine.setBaseTemplatePath("/templates/"); jfr.setSessionInView(true); jfr.setSuffix(".html"); jfr.setContentType("text/html;charset=UTF-8"); jfr.setOrder(0); return jfr; }
Example #6
Source File: ServiceApiGenerator.java From jpress with GNU Lesser General Public License v3.0 | 6 votes |
@Override public void generate(List<TableMeta> tableMetas) { System.out.println("Generate base model ..."); System.out.println("Base Model Output Dir: " + baseModelOutputDir); Engine engine = Engine.create("forService"); engine.setSourceFactory(new ClassPathSourceFactory()); engine.addSharedMethod(new StrKit()); engine.addSharedObject("getterTypeMap", getterTypeMap); engine.addSharedObject("javaKeyword", javaKeyword); for (TableMeta tableMeta : tableMetas) { genBaseModelContent(tableMeta); } writeToFile(tableMetas); }
Example #7
Source File: ServiceProviderGenerator.java From jpress with GNU Lesser General Public License v3.0 | 6 votes |
@Override public void generate(List<TableMeta> tableMetas) { System.out.println("Generate base model ..."); System.out.println("Base Model Output Dir: " + baseModelOutputDir); Engine engine = Engine.create("forServiceImpl"); engine.setSourceFactory(new ClassPathSourceFactory()); engine.addSharedMethod(new StrKit()); engine.addSharedObject("getterTypeMap", getterTypeMap); engine.addSharedObject("javaKeyword", javaKeyword); for (TableMeta tableMeta : tableMetas) { genBaseModelContent(tableMeta); } writeToFile(tableMetas); }
Example #8
Source File: ActiveRecordConfig.java From sdb-mall with Apache License 2.0 | 5 votes |
@Bean(initMethod="start", destroyMethod="stop") public ActiveRecordPlugin init() { ActiveRecordPlugin arp = new ActiveRecordPlugin(ds); arp.addSqlTemplate("sql/all.sql"); // arp.addMapping("user", UserModel.class); arp.getEngine().setSourceFactory(new ClassPathSourceFactory()); _MappingKit.mapping(arp); return arp; }
Example #9
Source File: SpringBootConfig.java From sdb-mall with Apache License 2.0 | 5 votes |
@Bean(name = "jfinalViewResolver") public JFinalViewResolver getJfinalViewRrsolver() { JFinalViewResolver jfr = new JFinalViewResolver(); jfr.setDevMode(true); jfr.setSourceFactory(new ClassPathSourceFactory()); jfr.setPrefix("/templates/"); jfr.setSuffix(".html"); jfr.setContentType("text/html;charset=UTF-8"); jfr.setOrder(0); // jfr.addSharedFunction("/view/common/_layout.html"); return jfr; }
Example #10
Source File: JbootServiceImplGenerator.java From jboot with Apache License 2.0 | 5 votes |
public void generate(List<TableMeta> tableMetas) { System.out.println("Generate Service Impl ..."); System.out.println("Service Impl Output Dir: " + outputDir); Engine engine = Engine.create("forServiceImpl"); engine.setSourceFactory(new ClassPathSourceFactory()); engine.addSharedMethod(new StrKit()); engine.addSharedObject("getterTypeMap", getterTypeMap); engine.addSharedObject("javaKeyword", JavaKeyword.me); for (TableMeta tableMeta : tableMetas) { genBaseModelContent(tableMeta); } writeToFile(tableMetas); }
Example #11
Source File: AddonUIGenerator.java From jpress with GNU Lesser General Public License v3.0 | 5 votes |
public AddonUIGenerator(String basePath, String moduleName, String modelPackage, List<TableMeta> tableMetaList) { this.basePath = basePath; this.tableMetaList = tableMetaList; this.moduleName = moduleName; this.modelPackage = modelPackage; this.modulePackage = modelPackage.substring(0, modelPackage.lastIndexOf(".")); modulePackage = modelPackage.substring(0, modelPackage.lastIndexOf(".")); String moduleListenerPakcage = modelPackage.substring(0, modelPackage.lastIndexOf(".")); String controllerPackage = modelPackage.substring(0, modelPackage.lastIndexOf(".")) + ".controller"; controllerOutputDir = basePath + "/src/main/java/" + controllerPackage.replace(".", "/"); htmlOutputDir = basePath + "/src/main/webapp/views/"; data = Kv.by("moduleName", moduleName);//product data.set("upcasedModuleName", StrKit.firstCharToUpperCase(moduleName));//Product data.set("modulePackage", modulePackage);//io.jpress.module.product data.set("modelPackage", modelPackage);//io.jpress.module.product.model data.set("moduleListenerPakcage", moduleListenerPakcage);//io.jpress.module.product data.set("controllerPackage", controllerPackage);//io.jpress.module.product.controller engine.setSourceFactory(new ClassPathSourceFactory()); engine.addSharedMethod(new StrKit()); }
Example #12
Source File: ModuleUIGenerator.java From jpress with GNU Lesser General Public License v3.0 | 5 votes |
public ModuleUIGenerator(String moduleName, String modelPackage, List<TableMeta> tableMetaList) { this.tableMetaList = tableMetaList; this.moduleName = moduleName; this.modelPackage = modelPackage; modulePackage = modelPackage.substring(0, modelPackage.lastIndexOf(".")); basePath = PathKit.getWebRootPath() + "/../module-" + moduleName; webPath = basePath + "/module-" + moduleName + "-web"; String upcasedModuleName = StrKit.firstCharToUpperCase(moduleName); String moduleListenerPakcage = modelPackage.substring(0, modelPackage.lastIndexOf(".")); String controllerPackage = modelPackage.substring(0, modelPackage.lastIndexOf(".")) + ".controller"; moduleListenerOutputDir = webPath + "/src/main/java/" + moduleListenerPakcage.replace(".", "/"); controllerOutputDir = webPath + "/src/main/java/" + controllerPackage.replace(".", "/"); htmlOutputDir = webPath + "/src/main/webapp/WEB-INF/views/admin/" + moduleName; data = Kv.by("moduleName", moduleName);//product data.set("upcasedModuleName", upcasedModuleName);//Product data.set("modulePackage", modulePackage);//io.jpress.module.product data.set("modelPackage", modelPackage);//io.jpress.module.product.model data.set("moduleListenerPakcage", moduleListenerPakcage);//io.jpress.module.product data.set("controllerPackage", controllerPackage);//io.jpress.module.product.controller engine.setSourceFactory(new ClassPathSourceFactory()); engine.addSharedMethod(new StrKit()); }
Example #13
Source File: SQLEnjoyRender.java From weed3 with Apache License 2.0 | 5 votes |
private void initForRuntime(){ try { engine.setBaseTemplatePath(_baseUri); engine.setSourceFactory(new ClassPathSourceFactory()); } catch (Exception ex) { ex.printStackTrace(); } }