Skip to content
Snippets Groups Projects
Commit ba280ff5 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

renaming Country_lib -> CountryInfo_lib for better compability in the future

parent ef7b6d29
No related branches found
No related tags found
No related merge requests found
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
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
<?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>
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment