@@ -291,6 +291,7 @@ public void ecrireGenApiService(String classeLangueNom) throws Exception {
291291 if (classeApiMethode .contains (i18nGlobale .getString (I18n .var_PageEdition ))
292292 || classeApiMethode .contains (i18nGlobale .getString (I18n .var_PageAffichage ))
293293 || classeApiMethode .contains (i18nGlobale .getString (I18n .var_PageUtilisateur ))
294+ || classeApiMethode .contains (i18nGlobale .getString (I18n .var_Telechargement ))
294295 ) {
295296 auteurGenApiService .t (1 , "public void " , classeApiOperationIdMethode , "(" );
296297 auteurGenApiService .l ("ServiceRequest " , i18nGlobale .getString (I18n .var_requeteService ), ", Handler<AsyncResult<ServiceResponse>> " , i18nGlobale .getString (I18n .var_gestionnaireEvenements ), ");" );
@@ -1896,6 +1897,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
18961897 if (classeApiMethode .contains (i18nGlobale .getString (I18n .var_PageEdition ))
18971898 || classeApiMethode .contains (i18nGlobale .getString (I18n .var_PageAffichage ))
18981899 || classeApiMethode .contains (i18nGlobale .getString (I18n .var_PageUtilisateur ))
1900+ || classeApiMethode .contains (i18nGlobale .getString (I18n .var_Telechargement ))
18991901 ) {
19001902 l ();
19011903 tl (1 , "@Override" );
@@ -1908,6 +1910,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
19081910 StringUtils .containsAny (classeApiMethode , "POST" , "PUT" , "PATCH" , "DELETE"
19091911 , i18nGlobale .getString (I18n .var_PageEdition )
19101912 , i18nGlobale .getString (I18n .var_PageUtilisateur )
1913+ , i18nGlobale .getString (I18n .var_Telechargement )
19111914 )
19121915 && !(classeRoleSession || classeRoleUtilisateur || classeRoleChacun )
19131916 && (
@@ -1916,6 +1919,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
19161919 || !StringUtils .containsAny (classeApiMethode , "POST" , "PUT" , "PATCH" , "DELETE"
19171920 , i18nGlobale .getString (I18n .var_PageEdition )
19181921 , i18nGlobale .getString (I18n .var_PageUtilisateur )
1922+ , i18nGlobale .getString (I18n .var_Telechargement )
19191923 ) && (
19201924 BooleanUtils .isNotTrue (classeRoleSession )
19211925 && BooleanUtils .isNotTrue (classePublicLire )
@@ -1925,6 +1929,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
19251929 )
19261930 ) {
19271931 if (authPolitiqueGranulee ) {
1932+ tl (3 , "String " , classeVarId , " = " , i18nGlobale .getString (I18n .var_requeteSite ), ".get" , i18nGlobale .getString (I18n .var_RequeteService ), "().getParams().getJsonObject(\" path\" ).getString(\" " , classeVarId , "\" );" );
19281933 tl (3 , "webClient.post(" );
19291934 tl (5 , "config.getInteger(ComputateConfigKeys.AUTH_PORT)" );
19301935 tl (5 , ", config.getString(ComputateConfigKeys.AUTH_HOST_NAME)" );
@@ -1938,16 +1943,16 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
19381943 tl (7 , ".add(\" audience\" , config.getString(ComputateConfigKeys.AUTH_CLIENT))" );
19391944 tl (7 , ".add(\" response_mode\" , \" permissions\" )" );
19401945 if (classeApiMethode .equals (classeApiMethodeMethode )) {
1941- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" " , classeApiMethode , "\" ))" );
1946+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" " , classeApiMethode , "\" ))" );
19421947 } else {
1943- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , config.getString(ComputateConfigKeys." , i18nGlobale .getString (I18n .var_AUTH_PORTEE_ADMIN ), ")))" );
1944- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , config.getString(ComputateConfigKeys." , i18nGlobale .getString (I18n .var_AUTH_PORTEE_SUPER_ADMIN ), ")))" );
1945- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" GET\" ))" );
1946- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" POST\" ))" );
1947- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" DELETE\" ))" );
1948- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" PATCH\" ))" );
1949- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" PUT\" ))" );
1950- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , i18nGlobale .getString (I18n .var_requeteService ), ".getExtra().getString( \" uri \" ) , \" " , classeApiMethodeMethode , "\" ))" );
1948+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , config.getString(ComputateConfigKeys." , i18nGlobale .getString (I18n .var_AUTH_PORTEE_ADMIN ), ")))" );
1949+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , config.getString(ComputateConfigKeys." , i18nGlobale .getString (I18n .var_AUTH_PORTEE_SUPER_ADMIN ), ")))" );
1950+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" GET\" ))" );
1951+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" POST\" ))" );
1952+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" DELETE\" ))" );
1953+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" PATCH\" ))" );
1954+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" PUT\" ))" );
1955+ tl (7 , ".add(\" permission\" , String.format(\" %s-%s #%s\" , " , classeNomSimple , "." , i18nGlobale .getString (I18n .var_CLASSE_NOM_SIMPLE ), ", " , classeVarId , " , \" " , classeApiMethodeMethode , "\" ))" );
19511956 }
19521957 tl (3 , ").onFailure(ex -> {" );
19531958 tl (4 , "String msg = String.format(\" 403 FORBIDDEN user %s to %s %s\" , siteRequest.getUser().attributes().getJsonObject(\" accessToken\" ).getString(\" preferred_username\" ), serviceRequest.getExtra().getString(\" method\" ), serviceRequest.getExtra().getString(\" uri\" ));" );
@@ -2028,6 +2033,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
20282033 StringUtils .containsAny (classeApiMethode , "POST" , "PUT" , "PATCH" , "DELETE"
20292034 , i18nGlobale .getString (I18n .var_PageEdition )
20302035 , i18nGlobale .getString (I18n .var_PageUtilisateur )
2036+ , i18nGlobale .getString (I18n .var_Telechargement )
20312037 )
20322038 && !(classeRoleSession || classeRoleUtilisateur || classeRoleChacun )
20332039 && (
@@ -2036,6 +2042,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
20362042 || !StringUtils .containsAny (classeApiMethode , "POST" , "PUT" , "PATCH" , "DELETE"
20372043 , i18nGlobale .getString (I18n .var_PageEdition )
20382044 , i18nGlobale .getString (I18n .var_PageUtilisateur )
2045+ , i18nGlobale .getString (I18n .var_Telechargement )
20392046 ) && (
20402047 BooleanUtils .isNotTrue (classeRoleSession )
20412048 && BooleanUtils .isNotTrue (classePublicLire )
@@ -2109,6 +2116,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
21092116 StringUtils .containsAny (classeApiMethode , "POST" , "PUT" , "PATCH" , "DELETE"
21102117 , i18nGlobale .getString (I18n .var_PageEdition )
21112118 , i18nGlobale .getString (I18n .var_PageUtilisateur )
2119+ , i18nGlobale .getString (I18n .var_Telechargement )
21122120 )
21132121 && !(classeRoleSession || classeRoleUtilisateur || classeRoleChacun )
21142122 && (
@@ -2117,6 +2125,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
21172125 || !StringUtils .containsAny (classeApiMethode , "POST" , "PUT" , "PATCH" , "DELETE"
21182126 , i18nGlobale .getString (I18n .var_PageEdition )
21192127 , i18nGlobale .getString (I18n .var_PageUtilisateur )
2128+ , i18nGlobale .getString (I18n .var_Telechargement )
21202129 ) && (
21212130 BooleanUtils .isNotTrue (classeRoleSession )
21222131 && BooleanUtils .isNotTrue (classePublicLire )
@@ -2127,6 +2136,7 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
21272136 )
21282137 ) {
21292138 if (authPolitiqueGranulee ) {
2139+ tl (3 , "String " , classeVarId , " = " , i18nGlobale .getString (I18n .var_requeteSite ), ".get" , i18nGlobale .getString (I18n .var_RequeteService ), "().getParams().getJsonObject(\" path\" ).getString(\" " , classeVarId , "\" );" );
21302140 tl (3 , "webClient.post(" );
21312141 tl (5 , "config.getInteger(ComputateConfigKeys.AUTH_PORT)" );
21322142 tl (5 , ", config.getString(ComputateConfigKeys.AUTH_HOST_NAME)" );
@@ -2140,16 +2150,16 @@ public void ecrireGenApiServiceImpl2(String classeLangueNom) throws Exception {
21402150 tl (7 , ".add(\" audience\" , config.getString(ComputateConfigKeys.AUTH_CLIENT))" );
21412151 tl (7 , ".add(\" response_mode\" , \" permissions\" )" );
21422152 if (classeApiMethode .equals (classeApiMethodeMethode )) {
2143- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" " , classeApiMethode , "\" ))" );
2153+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" " , classeApiMethode , "\" ))" );
21442154 } else {
2145- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , config.getString(ComputateConfigKeys." , i18nGlobale .getString (I18n .var_AUTH_PORTEE_ADMIN ), ")))" );
2146- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , config.getString(ComputateConfigKeys." , i18nGlobale .getString (I18n .var_AUTH_PORTEE_SUPER_ADMIN ), ")))" );
2147- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" GET\" ))" );
2148- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" POST\" ))" );
2149- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" DELETE\" ))" );
2150- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" PATCH\" ))" );
2151- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME , \" PUT\" ))" );
2152- tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , i18nGlobale .getString (I18n .var_requeteService ), ".getExtra().getString( \" uri \" ) , \" " , classeApiMethodeMethode , "\" ))" );
2155+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , config.getString(ComputateConfigKeys." , i18nGlobale .getString (I18n .var_AUTH_PORTEE_ADMIN ), ")))" );
2156+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , config.getString(ComputateConfigKeys." , i18nGlobale .getString (I18n .var_AUTH_PORTEE_SUPER_ADMIN ), ")))" );
2157+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" GET\" ))" );
2158+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" POST\" ))" );
2159+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" DELETE\" ))" );
2160+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" PATCH\" ))" );
2161+ tl (7 , ".add(\" permission\" , String.format(\" %s#%s\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " , \" PUT\" ))" );
2162+ tl (7 , ".add(\" permission\" , String.format(\" %s-%s #%s\" , " , classeNomSimple , "." , i18nGlobale .getString (I18n .var_CLASSE_NOM_SIMPLE ), ", " , classeVarId , " , \" " , classeApiMethodeMethode , "\" ))" );
21532163 }
21542164 tl (3 , ").onFailure(ex -> {" );
21552165 tl (4 , "String msg = String.format(\" 403 FORBIDDEN user %s to %s %s\" , siteRequest.getUser().attributes().getJsonObject(\" accessToken\" ).getString(\" preferred_username\" ), serviceRequest.getExtra().getString(\" method\" ), serviceRequest.getExtra().getString(\" uri\" ));" );
@@ -2429,6 +2439,7 @@ else if(classeApiMethode.equals(i18nGlobale.getString(I18n.var_PUTFusion)) || cl
24292439 StringUtils .containsAny (classeApiMethode , "POST" , "PUT" , "PATCH" , "DELETE"
24302440 , i18nGlobale .getString (I18n .var_PageEdition )
24312441 , i18nGlobale .getString (I18n .var_PageUtilisateur )
2442+ , i18nGlobale .getString (I18n .var_Telechargement )
24322443 )
24332444 && !(classeRoleSession || classeRoleUtilisateur || classeRoleChacun )
24342445 && (
@@ -2437,6 +2448,7 @@ else if(classeApiMethode.equals(i18nGlobale.getString(I18n.var_PUTFusion)) || cl
24372448 || !StringUtils .containsAny (classeApiMethode , "POST" , "PUT" , "PATCH" , "DELETE"
24382449 , i18nGlobale .getString (I18n .var_PageEdition )
24392450 , i18nGlobale .getString (I18n .var_PageUtilisateur )
2451+ , i18nGlobale .getString (I18n .var_Telechargement )
24402452 ) && (
24412453 BooleanUtils .isNotTrue (classeRoleSession )
24422454 && BooleanUtils .isNotTrue (classePublicLire )
@@ -4505,7 +4517,7 @@ public void ecrireGenApiServiceImpl3(String classeLangueNom) throws Exception {
45054517 tl (3 , "JsonObject entityBody = new JsonObject();" );
45064518 tl (3 , "entityBody.put(\" @context\" , config.getString(ComputateConfigKeys.CONTEXT_BROKER_CONTEXT));" );
45074519 tl (3 , "entityBody.put(\" id\" , o.getId());" );
4508- tl (3 , "entityBody.put(\" type\" , " , classeNomSimple , ".CLASS_SIMPLE_NAME );" );
4520+ tl (3 , "entityBody.put(\" type\" , " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " );" );
45094521 tl (3 , "entityBody.put(\" NGSILD-Tenant\" " );
45104522 tl (5 , ", new JsonObject()" );
45114523 tl (5 , ".put(\" type\" , \" Property\" )" );
@@ -4568,7 +4580,7 @@ public void ecrireGenApiServiceImpl3(String classeLangueNom) throws Exception {
45684580 tl (2 , "Promise<JsonObject> promise = Promise.promise();" );
45694581 tl (2 , "try {" );
45704582 tl (3 , "String entityName = o.getName();" );
4571- tl (3 , "String entityType = " , classeNomSimple , ".CLASS_SIMPLE_NAME ;" );
4583+ tl (3 , "String entityType = " , classeNomSimple , "." , i18nGlobale . getString ( I18n . var_CLASSE_NOM_SIMPLE ), " ;" );
45724584 tl (3 , "String entityId = o.getId();" );
45734585 tl (3 , "String ngsildUri = String.format(\" /ngsi-ld/v1/entities/%s\" , urlEncode(entityId));" );
45744586 tl (3 , "String ngsildContext = config.getString(ComputateConfigKeys.CONTEXT_BROKER_CONTEXT);" );
0 commit comments