Attribute translation tables
Definition
Soffid provides an easy to use mechanism to translate references or external codes into internal codes. For example, the HHRR application could be using a diferent coding scheme for business units.
To deal with this data mismatch, users can extend the data model, or can either use translation tables. This screen allows the user to create and maintain such tables. This tables can also be downloaded or uploaded as CSV files, enable the import of data contained into spreadsheets.
Usage of translation table is bound, but not restricted to, attribute translation expressions,expressions, by using trigger scripts, through the use of serverService interface.
Before using the attribute translation tables, bear in mind that Soffid offers attribute expansion for some objects, or directly allows the creation of new custom objects with their own attribute definitions. Analyse which solution best suits your needs. Consult the metadata screen.
Screen overview
Related objects
CustomMetadataobjects:: custom objects are an alternative for storing and updating data
Standard attributes
- Domain: the domain column represents the translation table name.
- Column 1: value
- Column 2: value
- Column 3: value
- Column 4: value
- Column 5: value
Column 1 to 5 meaning is user defined. Usage of translation table is bound, but not restricted to, attribute translation expressions, through the use of serverService interface.
Actions
"Query search" |
Allows to query groups through different search systems, Quick, Basic and Advanced. |
Add new |
Allows you to add a new attribute translation table. That option adds a new row on the table to fill in the data. It will be mandatory to apply changes to save the data. |
Delete translation |
Allows you to remove one or more |
Download CSV file |
Allows you to download a CSV file with the information of all attribute translation tables. |
Import |
Allows you to upload a CSV file with the attribute translation table data to add to the system. First, you need to pick up a CSV file, that CSV has to contain a specific configuration. Then you need to check the contents. And finally, you need to select the mappings for each column of the CSV file to import the data correctly and to click the Import button. |
|
Allows you to |
Apply changes |
Allows you to save new attribute translation tables or to save updated attribute translation tables. |
|
|
Examples
Example 1
lCentros = serviceLocator.getAttributeTranslationService().findByColumn1("CENTROS", "Madrid");
if (lCentros != null) {
for (var i = 0; i < lCentros.length; i++) {
if (lCentros[i] != null) {
out.println("** Centro - " + lCentros[i].column1 + " - " + lCentros[i].column2 + " - "
+ lCentros[i].column3 + " - " + lCentros[i].column4);
}
}
}
Example 2
lServer = serviceLocator.getAttributeTranslationService().findByExample("SERVER_COPIAS", null, null);
if (lServer != null) {
out.println("** SERVER_COPIAS - " + lServer);
}
Example 3
// Rename translation tables
void rename(String currentDomain, String newDomain) {
lat = serviceLocator.getAttributeTranslationService().findByExample(currentDomain, null, null);
for (at : lat) {
at.domain = newDomain;
serviceLocator.getAttributeTranslationService().update(at);
out.println("Renamed: "+at.domain+", "+at.column1+", "+at.column2+", "+at.column3);
}
}
rename("COUNTRY", "COUNTRY_COMPANY");
rename("TEST", "TEST_COMMAND");
Example 4
lt = serviceLocator.getAttributeTranslationService().findByExample("COUNTRY", null, null);
for (var i=0; i<lt.length; i++) {
var t = lt.get(i);
out.println(t.column1+" is "+t.column2+" or "+t.column3);
}