Skip to content

Commit

Permalink
Fixed PageTemplate model rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Jul 28, 2024
1 parent 9dadcff commit 8ff0bde
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/computate/frFR/java/EcrireApiClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -3155,7 +3155,7 @@ else if(classeApiMethode.equals(i18nGlobale.getString(I18n.var_PUTCopie)))
if(classePageNomCanoniqueMethode != null) {
l();
tl(1, "public String ", i18nGlobale.getString(I18n.var_template), classeApiMethode, classeNomSimple, "() {");
tl(2, "return \"/", classeLangueNom, "/", classePageNomSimpleMethode, ".htm\";");
tl(2, "return \"", classePageTemplate, "\";");
t(1, "}");
}
l();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/computate/frFR/java/EcrireGenClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ public class EcrireGenClasse extends EcrireClasse {
* Var.enUS: classSimpleName
*/
protected String classeNomSimple;
protected String classePageTemplate;
protected String classeGenPageTemplate;
protected String classePageSuperTemplate;

protected String uncapitalizeClasseNomSimple;

Expand Down
7 changes: 2 additions & 5 deletions src/main/java/org/computate/frFR/java/EcrirePageClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -2489,16 +2489,13 @@ else if("LocalDate".equals(entiteNomSimple)) {
}
}
}
l("{% extends \"", classeLangueNom, "/", classeGenPageNomSimple, ".htm\" %}");
l("{% extends \"", classeGenPageTemplate, "\" %}");
}

o = auteurGenPageJinja;

if(!classePageSimple) {
l("{% extends \"", classeLangueNom, "/", classePageSuperNomSimple, ".htm\" ",
// , "Object".equals(classeNomSimpleSuperGenerique) ? "" : (
// " " + StringUtils.uncapitalize(classeNomSimpleSuperGenerique) + "_=" + uncapitalizeClasseApiClasseNomSimple + "_"),
"%}");
l("{% extends \"", classePageSuperTemplate, "\" %}");
}

l();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ public void ecrireGenClasse(JsonObject doc, String langueNom) throws Exception {
classeNomCanoniqueSuper = doc.getString("classeNomCanoniqueSuper_" + langueNom + "_stored_string");
classeNomSimpleSuperGenerique = doc.getString("classeNomSimpleSuperGenerique_" + langueNom + "_stored_string");
classeNomCanoniqueSuperGenerique = doc.getString("classeNomCanoniqueSuperGenerique_" + langueNom + "_stored_string");
classePageTemplate = doc.getString("classePageTemplate_" + langueNom + "_stored_string");
classeGenPageTemplate = doc.getString("classeGenPageTemplate_" + langueNom + "_stored_string");
classePageSuperTemplate = doc.getString("classePageSuperTemplate_" + langueNom + "_stored_string");
classePageNomSimple = doc.getString("classePageNomSimple_" + langueNom + "_stored_string");
classePageNomCanonique = doc.getString("classePageNomCanonique_" + langueNom + "_stored_string");
classePageSuperNomSimple = doc.getString("classePageSuperNomSimple_" + langueNom + "_stored_string");
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/org/computate/frFR/java/IndexerClasse.java
Original file line number Diff line number Diff line change
Expand Up @@ -5259,7 +5259,7 @@ else if(i18nGlobale.getString(I18n.var_PUTFusion).equals(classeApiMethode))

String classePageCheminCss = concat(siteChemin, "-static/css/", langueNom, "/", classePageNomSimpleMethode, ".css");
String classePageCheminJs = concat(siteChemin, "-static/js/", langueNom, "/", classePageNomSimpleMethode, ".js");
String classePageCheminJinja = concat(siteChemin, "-static/template/", langueNom, "/", classePageNomSimpleMethode, ".htm");
String classePageCheminJinja = concat(siteChemin, "-static/template/", langueNom.substring(0, 2), "-", langueNom.substring(2, 4).toLowerCase(), "/", classePageNomSimpleMethode, ".htm");

indexerStockerSolr(langueNom, classeDoc, "classePageCheminCss" + classeApiMethode, classePageCheminCss);
indexerStockerSolr(langueNom, classeDoc, "classePageCheminJs" + classeApiMethode, classePageCheminJs);
Expand Down Expand Up @@ -5305,8 +5305,13 @@ else if(i18nGlobale.getString(I18n.var_PUTFusion).equals(classeApiMethode))
indexerStockerSolr(langueNomGlobale, classeDoc, "classePageChemin", classePageChemin);
indexerStockerSolr(langueNomGlobale, classeDoc, "classePageCheminCss", concat(siteChemin, "-static/css/", langueNomGlobale, "/", classePageNomSimple, ".css"));
indexerStockerSolr(langueNomGlobale, classeDoc, "classePageCheminJs", concat(siteChemin, "-static/js/", langueNomGlobale, "/", classePageNomSimple, ".js"));
indexerStockerSolr(langueNomGlobale, classeDoc, "classePageCheminJinja", concat(siteChemin, "/src/main/resources/templates/", langueNomGlobale, "/", classePageNomSimple, ".htm"));
indexerStockerSolr(langueNomGlobale, classeDoc, "classeGenPageCheminJinja", concat(siteChemin, "/src/main/resources/templates/", langueNomGlobale, "/", classeGenPageNomSimple, ".htm"));
String classePageTemplate = indexerStockerSolr(langueNomGlobale, classeDoc, "classePageTemplate", concat(langueNomGlobale.substring(0, 2), "-", langueNomGlobale.substring(2, 4).toLowerCase(), "/", classePageNomSimple, ".htm"));
String classePageCheminJinja = concat(siteChemin, "/src/main/resources/templates/", classePageTemplate);
String classeGenPageTemplate = indexerStockerSolr(langueNomGlobale, classeDoc, "classeGenPageTemplate", concat(langueNomGlobale.substring(0, 2), "-", langueNomGlobale.substring(2, 4).toLowerCase(), "/", classeGenPageNomSimple, ".htm"));
String classeGenPageCheminJinja = concat(siteChemin, "/src/main/resources/templates/", classeGenPageTemplate);
String classePageSuperTemplate = indexerStockerSolr(langueNomGlobale, classeDoc, "classePageSuperTemplate", concat(langueNomGlobale.substring(0, 2), "-", langueNomGlobale.substring(2, 4).toLowerCase(), "/", classePageSuperNomSimple, ".htm"));
indexerStockerSolr(langueNomGlobale, classeDoc, "classePageCheminJinja", classePageCheminJinja);
indexerStockerSolr(langueNomGlobale, classeDoc, "classeGenPageCheminJinja", classeGenPageCheminJinja);
indexerStockerSolr(langueNomGlobale, classeDoc, "classePageLangueNom", langueNomGlobale);

if(classePageSuperNomSimple != null) {
Expand Down

0 comments on commit 8ff0bde

Please sign in to comment.