Skip to content

Commit

Permalink
WIP converting from handlebars to Jinja
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Jul 7, 2024
1 parent 43fbdb9 commit b5b2d20
Show file tree
Hide file tree
Showing 2 changed files with 1,181 additions and 1,281 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/computate/frFR/java/EcrireApiClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public void ecrireGenApiService(String classeLangueNom) throws Exception {
auteurGenApiService.l("import io.vertx.ext.web.api.service.WebApiServiceGen;");
auteurGenApiService.l("import io.vertx.ext.web.api.service.ServiceRequest;");
auteurGenApiService.l("import io.vertx.ext.web.api.service.ServiceResponse;");
auteurGenApiService.l("import io.vertx.ext.web.templ.handlebars.HandlebarsTemplateEngine;");
auteurGenApiService.l("import com.hubspot.jinjava.Jinjava;");
auteurGenApiService.l("import io.vertx.core.WorkerExecutor;");
auteurGenApiService.l("import io.vertx.pgclient.PgPool;");
auteurGenApiService.l("import io.vertx.kafka.client.producer.KafkaProducer;");
Expand Down Expand Up @@ -373,7 +373,7 @@ public void ecrireApiServiceImpl(String classeLangueNom) throws Exception {
auteurApiServiceImpl.l("import io.vertx.pgclient.PgPool;");
auteurApiServiceImpl.l("import io.vertx.kafka.client.producer.KafkaProducer;");
if(classePage)
auteurApiServiceImpl.l("import io.vertx.ext.web.templ.handlebars.HandlebarsTemplateEngine;");
auteurApiServiceImpl.l("import com.hubspot.jinjava.Jinjava;");
// auteurGenApiService.l("import ", classeNomEnsemble, ".", classeNomSimple, "ApiServiceVertxEBProxy;");
auteurApiServiceImpl.l();
auteurApiServiceImpl.l("/**");
Expand Down Expand Up @@ -3123,7 +3123,7 @@ else if(classeApiMethode.equals(classeLangueConfig.getString(ConfigCles.var_PUTC
if(classePageNomCanoniqueMethode != null) {
l();
tl(1, "public String ", classeLangueConfig.getString(ConfigCles.var_template), classeApiMethode, classeNomSimple, "() {");
tl(2, "return Optional.ofNullable(config.getString(", classePartsConfigCles.nomSimple(classeLangueNom), ".TEMPLATE_PATH)).orElse(\"templates\") + \"/", classeLangueNom, "/", classePageNomSimpleMethode, "\";");
tl(2, "return \"/", classeLangueNom, "/", classePageNomSimpleMethode, ".htm\";");
t(1, "}");
}
l();
Expand Down Expand Up @@ -3167,7 +3167,7 @@ else if(classeApiMethode.contains(classeLangueConfig.getString(ConfigCles.var_Re
tl(3, "String pageTemplateUri = ", classeLangueConfig.getString(ConfigCles.var_template), classeApiMethode, classeNomSimple, "();");
tl(3, "String siteTemplatePath = config.getString(ComputateConfigKeys.TEMPLATE_PATH);");
tl(3, "Path resourceTemplatePath = Path.of(siteTemplatePath, pageTemplateUri);");
tl(3, "String template = siteTemplatePath == null ? Files.readString(resourceTemplatePath, Charset.forName(\"UTF-8\")) : Resources.toString(Resources.getResource(resourceTemplatePath.toString()), StandardCharsets.UTF_8);");
tl(3, "String template = siteTemplatePath == null ? Resources.toString(Resources.getResource(resourceTemplatePath.toString()), StandardCharsets.UTF_8) : Files.readString(resourceTemplatePath, Charset.forName(\"UTF-8\"));");
tl(3, classePageNomSimpleMethode, " page = new ", classePageNomSimpleMethode, "();");
tl(3, "MultiMap ", classeLangueConfig.getString(ConfigCles.var_requeteEnTetes), " = MultiMap.caseInsensitiveMultiMap();");
tl(3, classeLangueConfig.getString(ConfigCles.var_requeteSite), ".set", classeLangueConfig.getString(ConfigCles.var_RequeteEnTetes), "(", classeLangueConfig.getString(ConfigCles.var_requeteEnTetes), ");");
Expand Down
Loading

0 comments on commit b5b2d20

Please sign in to comment.