From 370280f3df7bb2aa3d7412c340110785aff73aa2 Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Mon, 18 Dec 2023 22:09:46 -0700 Subject: [PATCH] Add new ProjectHelper to copy static files recursively from platform --- src/main/java/org/computate/frFR/java/ConfigCles.java | 3 ++- .../java/org/computate/frFR/java/EcrireApiClasse.java | 8 ++++---- .../java/org/computate/frFR/java/EcrireGenClasse.java | 7 ++++++- src/main/resources/org/computate/i18n/i18n_enUS.yml | 3 ++- src/main/resources/org/computate/i18n/i18n_frFR.yml | 3 ++- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/computate/frFR/java/ConfigCles.java b/src/main/java/org/computate/frFR/java/ConfigCles.java index c4ce88eb..2c9a66f3 100644 --- a/src/main/java/org/computate/frFR/java/ConfigCles.java +++ b/src/main/java/org/computate/frFR/java/ConfigCles.java @@ -70,7 +70,6 @@ public class ConfigCles { public static final String var_ACTIVER_SUPPRIME = "var_ACTIVER_SUPPRIME"; public static final String var_ACTIVER_UTILISATEUR_CLE = "var_ACTIVER_UTILISATEUR_CLE"; public static final String var_ACTIVER_VERTX = "var_ACTIVER_VERTX"; - public static final String var_CLASSE_API_ADDRESSE = "var_CLASSE_API_ADDRESSE"; public static final String var_addresse = "var_addresse"; public static final String var_Adjectif = "var_Adjectif"; public static final String var_AdjectifPluriel = "var_AdjectifPluriel"; @@ -118,6 +117,8 @@ public class ConfigCles { public static final String var_CLASSE_NOM_SIMPLE = "var_CLASSE_NOM_SIMPLE"; public static final String var_classe = "var_classe"; public static final String var_Classe = "var_Classe"; + public static final String var_CLASSE_API_ADDRESSE = "var_CLASSE_API_ADDRESSE"; + public static final String var_ClasseApiAddresse = "var_ClasseApiAddresse"; public static final String var_classeNomCanonique = "var_classeNomCanonique"; public static final String var_classeNomsCanoniques = "var_classeNomsCanoniques"; public static final String var_classeNomSimple = "var_classeNomSimple"; diff --git a/src/main/java/org/computate/frFR/java/EcrireApiClasse.java b/src/main/java/org/computate/frFR/java/EcrireApiClasse.java index 07368d11..e2a4f051 100644 --- a/src/main/java/org/computate/frFR/java/EcrireApiClasse.java +++ b/src/main/java/org/computate/frFR/java/EcrireApiClasse.java @@ -296,7 +296,7 @@ public void ecrireGenApiService(String classeLangueNom) throws Exception { tl(8, "protected WebClient ", classeLangueConfig.getString(ConfigCles.var_clientWeb), ";"); auteurGenApiService.tl(1, "static void ", classeLangueConfig.getString(ConfigCles.var_enregistrer), "Service(EventBus eventBus, JsonObject config, WorkerExecutor ", classeLangueConfig.getString(ConfigCles.var_executeurTravailleur), ", PgPool pgPool, KafkaProducer kafkaProducer, WebClient ", classeLangueConfig.getString(ConfigCles.var_clientWeb), activerOpenIdConnect ? ", OAuth2Auth oauth2AuthenticationProvider, AuthorizationProvider authorizationProvider" : "", classePage ? ", HandlebarsTemplateEngine templateEngine" : "", ", Vertx vertx) {"); - auteurGenApiService.tl(2, "new ServiceBinder(vertx).setAddress(", classeNomSimple, ".", classeLangueConfig.getString(ConfigCles.var_CLASSE_API_ADDRESSE), ").register(", classeNomSimpleGenApiService, ".class, new ", classeNomSimpleApiServiceImpl, "(eventBus, config, ", classeLangueConfig.getString(ConfigCles.var_executeurTravailleur), ", pgPool, kafkaProducer, ", classeLangueConfig.getString(ConfigCles.var_clientWeb), activerOpenIdConnect ? ", oauth2AuthenticationProvider, authorizationProvider" : "", classePage ? ", templateEngine" : "", "));"); + auteurGenApiService.tl(2, "new ServiceBinder(vertx).setAddress(", classeNomSimple, ".get", classeLangueConfig.getString(ConfigCles.var_ClasseApiAddresse), "()).register(", classeNomSimpleGenApiService, ".class, new ", classeNomSimpleApiServiceImpl, "(eventBus, config, ", classeLangueConfig.getString(ConfigCles.var_executeurTravailleur), ", pgPool, kafkaProducer, ", classeLangueConfig.getString(ConfigCles.var_clientWeb), activerOpenIdConnect ? ", oauth2AuthenticationProvider, authorizationProvider" : "", classePage ? ", templateEngine" : "", "));"); auteurGenApiService.tl(1, "}"); auteurGenApiService.l(); for(String classeApiMethode : classeApiMethodes) { @@ -1905,7 +1905,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception { tl(6, "params.put(\"query\", query);"); tl(6, "JsonObject context = new JsonObject().put(\"params\", params).put(\"user\", ", classeLangueConfig.getString(ConfigCles.var_requeteSite), ".getUserPrincipal());"); tl(6, "JsonObject json = new JsonObject().put(\"context\", context);"); - tl(6, "eventBus.request(", classeNomSimple, ".", classeLangueConfig.getString(ConfigCles.var_CLASSE_API_ADDRESSE), ", json, new DeliveryOptions().addHeader(\"action\", \"", classeApiOperationIdMethode, "Future\")).onSuccess(a -> {"); + tl(6, "eventBus.request(", classeNomSimple, ".get", classeLangueConfig.getString(ConfigCles.var_ClasseApiAddresse), "(), json, new DeliveryOptions().addHeader(\"action\", \"", classeApiOperationIdMethode, "Future\")).onSuccess(a -> {"); tl(7, "JsonObject responseMessage = (JsonObject)a.body();"); tl(7, "JsonObject responseBody = new JsonObject(Buffer.buffer(JsonUtil.BASE64_DECODER.decode(responseMessage.getString(\"payload\"))));"); if(classeModele) @@ -2253,7 +2253,7 @@ else if(classeApiMethode.equals(classeLangueConfig.getString(ConfigCles.var_PUTF tl(5, "params.put(\"query\", query);"); tl(5, "JsonObject context = new JsonObject().put(\"params\", params).put(\"user\", ", classeLangueConfig.getString(ConfigCles.var_requeteSite), ".getUserPrincipal());"); tl(5, "JsonObject json = new JsonObject().put(\"context\", context);"); - tl(5, "eventBus.request(", classeNomSimple, ".", classeLangueConfig.getString(ConfigCles.var_CLASSE_API_ADDRESSE), ", json, new DeliveryOptions().addHeader(\"action\", \"", classeApiOperationIdMethode, "Future\")).onSuccess(a -> {"); + tl(5, "eventBus.request(", classeNomSimple, ".get", classeLangueConfig.getString(ConfigCles.var_ClasseApiAddresse), "(), json, new DeliveryOptions().addHeader(\"action\", \"", classeApiOperationIdMethode, "Future\")).onSuccess(a -> {"); tl(6, "promise1.complete();"); tl(5, "}).onFailure(ex -> {"); tl(6, "LOG.error(String.format(\"", classeLangueConfig.getString(ConfigCles.var_liste), classeApiMethode, classeNomSimple, " ", classeLangueConfig.getString(ConfigCles.str_a_échoué), ". \"), ex);"); @@ -3917,7 +3917,7 @@ public void ecrireGenApiServiceImpl3(String classeLangueNom) throws Exception { tl(5, "params.put(\"query\", query);"); tl(5, "JsonObject context = new JsonObject().put(\"params\", params).put(\"user\", ", classeLangueConfig.getString(ConfigCles.var_requeteSite), ".getUserPrincipal());"); tl(5, "JsonObject json = new JsonObject().put(\"context\", context);"); - tl(5, "eventBus.request(", classeNomSimple, ".", classeLangueConfig.getString(ConfigCles.var_CLASSE_API_ADDRESSE), ", json, new DeliveryOptions().addHeader(\"action\", \"patch", classeNomSimple, "Future\")).onSuccess(c -> {"); + tl(5, "eventBus.request(", classeNomSimple, ".get", classeLangueConfig.getString(ConfigCles.var_ClasseApiAddresse), "(), json, new DeliveryOptions().addHeader(\"action\", \"patch", classeNomSimple, "Future\")).onSuccess(c -> {"); tl(6, "JsonObject responseMessage = (JsonObject)c.body();"); tl(6, "Integer statusCode = responseMessage.getInteger(\"statusCode\");"); tl(6, "if(statusCode.equals(200))"); diff --git a/src/main/java/org/computate/frFR/java/EcrireGenClasse.java b/src/main/java/org/computate/frFR/java/EcrireGenClasse.java index f4c4455f..93f30dbb 100644 --- a/src/main/java/org/computate/frFR/java/EcrireGenClasse.java +++ b/src/main/java/org/computate/frFR/java/EcrireGenClasse.java @@ -6027,7 +6027,12 @@ public void genCodeClasseFin(String langueNom, YAMLConfiguration langueConfig) t l(); tl(1, "public static final String ", langueConfig.getString(ConfigCles.var_CLASSE_NOM_SIMPLE), " = \"", classeNomSimple, "\";"); - tl(1, "public static final String ", classeLangueConfig.getString(ConfigCles.var_CLASSE_API_ADDRESSE), " = \"", siteNom, "-", classeLangueNom, "-", classeNomSimple, "\";"); + if(classeApi) { + tl(0, "public static final String ", classeLangueConfig.getString(ConfigCles.var_CLASSE_API_ADDRESSE), "_", classeNomSimple, " = \"", siteNom, "-", classeLangueNom, "-", classeNomSimple, "\";"); + tl(1, "public static String get", classeLangueConfig.getString(ConfigCles.var_ClasseApiAddresse), "() {"); + tl(2, "return ", classeLangueConfig.getString(ConfigCles.var_CLASSE_API_ADDRESSE), "_", classeNomSimple, ";"); + tl(1, "}"); + } s(wVarsStatic); if(classeIndexe) { diff --git a/src/main/resources/org/computate/i18n/i18n_enUS.yml b/src/main/resources/org/computate/i18n/i18n_enUS.yml index 6feece82..cfbba9a4 100644 --- a/src/main/resources/org/computate/i18n/i18n_enUS.yml +++ b/src/main/resources/org/computate/i18n/i18n_enUS.yml @@ -283,7 +283,6 @@ var_ACTIVER_SESSION_ID: "ENABLE_SESSION_ID" var_ACTIVER_SUPPRIME: "ENABLE_DELETED" var_ACTIVER_UTILISATEUR_CLE: "ENABLE_USER_KEY" var_ACTIVER_VERTX: "ENABLE_VERTX" -var_CLASSE_API_ADDRESSE: "CLASS_API_ADDRESS" var_addresse: "address" var_a_démarré: "started" var_Adjectif: "Adjective" @@ -336,6 +335,8 @@ var_CLASSE_CHEMIN_ABSOLU: "CLASS_ABSOLUTE_PATH" var_CLASSE_NOM_SIMPLE: "CLASS_SIMPLE_NAME" var_classe: "class" var_Classe: "Class" +var_CLASSE_API_ADDRESSE: "CLASS_API_ADDRESS" +var_ClasseApiAddresse: "ClassApiAddress" var_classeNomCanonique: "classCanonicalName" var_classeNomsCanoniques: "classCanonicalNames" var_classeNomSimple: "classSimpleName" diff --git a/src/main/resources/org/computate/i18n/i18n_frFR.yml b/src/main/resources/org/computate/i18n/i18n_frFR.yml index c5ef9895..889eaa4f 100644 --- a/src/main/resources/org/computate/i18n/i18n_frFR.yml +++ b/src/main/resources/org/computate/i18n/i18n_frFR.yml @@ -52,7 +52,6 @@ var_ACTIVER_SESSION_ID: "ACTIVER_SESSION_ID" var_ACTIVER_SUPPRIME: "ACTIVER_SUPPRIMER" var_ACTIVER_UTILISATEUR_CLE: "ACTIVER_UTILISATEUR_CLE" var_ACTIVER_VERTX: "ACTIVER_VERTX" -var_CLASSE_API_ADDRESSE: "CLASSE_API_ADDRESSE" var_addresse: "addresse" var_Adjectif: "Adjectif" var_AdjectifPluriel: "AdjectifPluriel" @@ -101,6 +100,8 @@ var_CLASSE_CHEMIN_ABSOLU: "CLASSE_CHEMIN_ABSOLU" var_CLASSE_NOM_SIMPLE: "CLASSE_NOM_SIMPLE" var_classe: "classe" var_Classe: "Classe" +var_CLASSE_API_ADDRESSE: "CLASSE_API_ADDRESSE" +var_ClasseApiAddresse: "ClasseApiAddresse" var_classeNomCanonique: "classeNomCanonique" var_classeNomsCanoniques: "classeNomsCanoniques" var_classeNomSimple: "classeNomSimple"