From ba280ff53153d317ebb0b65f286d23c242c6dea3 Mon Sep 17 00:00:00 2001 From: "j.goderbauer" <j.goderbauer@adito.de> Date: Mon, 3 Jun 2019 14:53:41 +0200 Subject: [PATCH] renaming Country_lib -> CountryInfo_lib for better compability in the future --- .../translate4log/property.js | 12 ++-- .../country/displayValueProcess.js | 14 ++--- .../CountryInfo_lib.aod} | 18 +++--- .../process.js | 58 +++++++++---------- 4 files changed, 51 insertions(+), 51 deletions(-) rename process/{Country_lib/Country_lib.aod => CountryInfo_lib/CountryInfo_lib.aod} (78%) rename process/{Country_lib => CountryInfo_lib}/process.js (97%) diff --git a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/address/entityfields/country/customproperties/translate4log/property.js b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/address/entityfields/country/customproperties/translate4log/property.js index b7b4c8e045..fe5b38dc6a 100644 --- a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/address/entityfields/country/customproperties/translate4log/property.js +++ b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/address/entityfields/country/customproperties/translate4log/property.js @@ -1,7 +1,7 @@ -import("system.result"); -import("Country_lib"); -import("Loghistory_lib"); - -var params = Translate4LogParams.load(); -var countryName = CountryUtils.getLatinNameByIso2(params.value, params.locale); +import("system.result"); +import("CountryInfo_lib"); +import("Loghistory_lib"); + +var params = Translate4LogParams.load(); +var countryName = CountryUtils.getLatinNameByIso2(params.value, params.locale); result.string(countryName); \ No newline at end of file diff --git a/entity/Address_entity/entityfields/country/displayValueProcess.js b/entity/Address_entity/entityfields/country/displayValueProcess.js index c6d030f60a..91e2f20f24 100644 --- a/entity/Address_entity/entityfields/country/displayValueProcess.js +++ b/entity/Address_entity/entityfields/country/displayValueProcess.js @@ -1,8 +1,8 @@ -import("system.vars"); -import("system.result"); -import("Country_lib"); - -//TODO: temporary testing code -> will be replaced with title-mechanic -var isoCode = vars.get("$field.COUNTRY"); -var countryName = CountryUtils.getLatinNameByIso2(isoCode); +import("system.vars"); +import("system.result"); +import("CountryInfo_lib"); + +//TODO: temporary testing code -> will be replaced with title-mechanic +var isoCode = vars.get("$field.COUNTRY"); +var countryName = CountryUtils.getLatinNameByIso2(isoCode); result.string(countryName); \ No newline at end of file diff --git a/process/Country_lib/Country_lib.aod b/process/CountryInfo_lib/CountryInfo_lib.aod similarity index 78% rename from process/Country_lib/Country_lib.aod rename to process/CountryInfo_lib/CountryInfo_lib.aod index 294e20f884..d078970229 100644 --- a/process/Country_lib/Country_lib.aod +++ b/process/CountryInfo_lib/CountryInfo_lib.aod @@ -1,9 +1,9 @@ -<?xml version="1.0" encoding="UTF-8"?> -<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> - <name>Country_lib</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <process>%aditoprj%/process/Country_lib/process.js</process> - <variants> - <element>LIBRARY</element> - </variants> -</process> +<?xml version="1.0" encoding="UTF-8"?> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.1"> + <name>CountryInfo_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/CountryInfo_lib/process.js</process> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/Country_lib/process.js b/process/CountryInfo_lib/process.js similarity index 97% rename from process/Country_lib/process.js rename to process/CountryInfo_lib/process.js index e6d2768305..67f674c97d 100644 --- a/process/Country_lib/process.js +++ b/process/CountryInfo_lib/process.js @@ -1,30 +1,30 @@ -import("system.db"); -import("system.translate"); -import("Sql_lib"); - -/** - * provides functions for miscellaneous interactions with countrydata - * Do not create an instance of this! - * - * @class - * @static - */ -function CountryUtils() {} - -/** -* loads the translated latin name of an entry within the countryinfos by a provided ISO2-code -* -* @param {String} pIso2 the uppercase ISO2 code whoes latin name shall be retriefed, e.g."DE" -* @param {String} [pLocale=current client/server language] specifies the locale for translating -* -* @return {String} the translated country name in the latin version -* -*/ -CountryUtils.getLatinNameByIso2 = function(pIso2, pLocale) -{ - var countryName = db.cell(SqlCondition.begin() - .andPrepare("AB_COUNTRYINFO.ISO2", pIso2) - .buildSql("select AB_COUNTRYINFO.NAME_LATIN from AB_COUNTRYINFO")); - countryName = pLocale ? translate.text(countryName, pLocale) : translate.text(countryName); - return countryName; +import("system.db"); +import("system.translate"); +import("Sql_lib"); + +/** + * provides functions for miscellaneous interactions with countrydata + * Do not create an instance of this! + * + * @class + * @static + */ +function CountryUtils() {} + +/** +* loads the translated latin name of an entry within the countryinfos by a provided ISO2-code +* +* @param {String} pIso2 the uppercase ISO2 code whoes latin name shall be retriefed, e.g."DE" +* @param {String} [pLocale=current client/server language] specifies the locale for translating +* +* @return {String} the translated country name in the latin version +* +*/ +CountryUtils.getLatinNameByIso2 = function(pIso2, pLocale) +{ + var countryName = db.cell(SqlCondition.begin() + .andPrepare("AB_COUNTRYINFO.ISO2", pIso2) + .buildSql("select AB_COUNTRYINFO.NAME_LATIN from AB_COUNTRYINFO")); + countryName = pLocale ? translate.text(countryName, pLocale) : translate.text(countryName); + return countryName; }; \ No newline at end of file -- GitLab