use of io.vertigo.studio.plugins.mda.domain.ts.model.TSDtDefinitionModel in project vertigo by KleeGroup.
the class TSGeneratorPlugin method generateDtResourcesTS.
/**
* Génère les ressources JS pour les traductions.
* @param fileGeneratorConfig Configuration du domaine.
*/
private static void generateDtResourcesTS(final String targetSubDir, final FileGeneratorConfig fileGeneratorConfig, final MdaResultBuilder mdaResultBuilder) {
final Map<String, List<TSDtDefinitionModel>> packageMap = new HashMap<>();
for (final TSDtDefinitionModel dtDefinitionModel : getTsDtDefinitionModels()) {
final String packageName = dtDefinitionModel.getFunctionnalPackageName();
packageMap.computeIfAbsent(packageName, o -> new ArrayList<>()).add(dtDefinitionModel);
}
final String simpleClassName = "DtDefinitions" + "Label";
for (final Entry<String, List<TSDtDefinitionModel>> entry : packageMap.entrySet()) {
final Map<String, Object> model = new MapBuilder<String, Object>().put("packageName", entry.getKey()).put("simpleClassName", simpleClassName).put("dtDefinitions", entry.getValue()).build();
FileGenerator.builder(fileGeneratorConfig).withModel(model).withFileName(entry.getKey() + ".ts").withGenSubDir(targetSubDir).withPackageName(fileGeneratorConfig.getProjectPackageName() + ".ui." + entry.getKey() + ".i18n.generated").withTemplateName("domain/ts/template/propertiesTS.ftl").build().generateFile(mdaResultBuilder);
}
}
Aggregations