Page tree
Skip to end of metadata
Go to start of metadata

Note

Feature available only starting with the SWAT 21.14 Release


In Akioma.Crm.MasterData.System.ApplicationSettingsBT, a new method was added: GetApplicationSettingsByDomain. This method can be used for retrieving the backend properties based on an input domain/key. We only allow returning properties based on a domain for security reasons. so we don't expose all the application settings by default. Also, as it is right now, there is no way to access the application settings in the root of the file.

Like GetTranslationSettings method, this new method expects as input the ApplicationSettingsParameter.

In the ApplicationSettingsParameter, a new property was added: ApplicationSettingsDomain. This MUST BE SPECIFIED WHEN CALLING GetApplicationSettingsByDomain. If no ApplicationSettingsDomain is specified when calling the new method, nothing will be returned.

How to call the new method

New method can be called using akioma.invokeServerTask, like in the example below, by specifying the desired settings domain in the request:

akioma.invokeServerTask({
      name: "Akioma.Crm.MasterData.System.ApplicationSettingsBT",
      methodName: "GetApplicationSettingsByDomain",
      paramObj: { plcParameter: {ApplicationSettingsDomain: "ckEditor"} }
    }).then((response) => {
     console.log(response);
});

The above call will return all the settings under the "ckEditor" domain.


The response would look like this:

{
?? ?? "SerializedType": "Akioma.Crm.MasterData.System.ApplicationSettingsParameter",
?? ?? "ApplicationSettingsDomain": "ckEditor",
?? ?? "ApplicationSettings": {
?? ?? ?? ?? "ckEditor": {
?? ?? ?? ?? ?? ?? "fontSize_defaultLabel": "10",
?? ?? ?? ?? ?? ?? "font_defaultLabel": "Arial",
?? ?? ?? ?? ?? ?? "listStyle_afterTextSpace": "-.25",
?? ?? ?? ?? ?? ?? "fontSize_sizes": "val",
?? ?? ?? ?? ?? ?? "styles": "",
?? ?? ?? ?? ?? ?? "specialChars": "",
?? ?? ?? ?? ?? ?? "listStyle_beforeTextSpace": ".25",
?? ?? ?? ?? ?? ?? "font_names": "Arial;Comic Sans MS;Courier New;Georgia;Lucida Sans Unicode;Tahoma;Times New Roman;Trebuchet MS;Verdana",
?? ?? ?? ?? ?? ?? "uiColor": "#DDDDDD",
?? ?? ?? ?? ?? ?? "toolbar": "Standard",
?? ?? ?? ?? ?? ?? "listStyle_defaultName": "MsoListParagraph",
?? ?? ?? ?? ?? ?? "editorAdvancedSettings": "{}",
?? ?? ?? ?? ?? ?? "templates": ""
?? ?? ?? ?? }
?? ?? }
}

All of the returned properties are available under: response.ApplicationSettings.ApplicationSettingsDomain (in our case, ApplicationSettings is ckEditor).


NOTE: The existing GetTranslationSettings method was also refactored to make use of the GetApplicationSettingsByDomain method.

Here, nothing needs to be changed. The ApplicationSettingsDomain property will be filled automatically from the backend.


Note: Specifying a root property/domain name will not return anything.

For example, if our .restapplicationsettings file looks like below and we specify in the request the "rootProp1" as the ApplicationSettingsDomain, nothing will be returned.

{
?? ?? "rootProp1": "rootValue1",
?? ?? "rootProp2": "rootValue2",
?? ?? "rootProp3": {
?? ?? ?? ?? "subProp1": "subValue1"
?? ?? }
}
  • No labels