Skip to content
Snippets Groups Projects
Commit 6b7bb2a5 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

add default parameter for custom config loading where needed

parent 2e66130e
No related branches found
No related tags found
No related merge requests found
import("system.logging");
import("system.vars");
import("system.project");
......@@ -67,11 +68,8 @@ CachedData.prototype.load = function(pDataCallbackFunction)
cachingEnabled = false;
else
{
try
{
if (JSON.parse(project.getInstanceConfigValue("custom.dataCaching.client.forceDisable")) == true)
cachingEnabled = false;
} catch (ex) {/* ignore */}
if (JSON.parse(project.getInstanceConfigValue("custom.dataCaching.client.forceDisable", "false")) == true)
cachingEnabled = false;
}
if (!cachingEnabled)
......
......@@ -199,6 +199,11 @@ WsValidationUtils.validate = function(pValue, pType, pCountry)
var url = project.getPreferenceValue("custom." + pType.webserviceName + ".url");
var countryParamName = project.getPreferenceValue("custom." + pType.webserviceName + ".countryParamName");
if (!userName || !pw || !url || !countryParamName)
{
throw new Error("if the webservice " + pType.key + " is enabled, you have to provide also userName, pw, url and countryParamName")
}
var actionType = "GET";
if (pValue && pType)
......@@ -277,12 +282,7 @@ WsValidationUtils.isWsEnabled = function(pType)
pType = WsValidationType.get(pType);
// get configurations for this type
try
{
return JSON.parse(project.getPreferenceValue("custom." + pType.webserviceName + ".enable"));
} catch (exception) {
return false;
}
return JSON.parse(project.getPreferenceValue("custom." + pType.webserviceName + ".enable", "false"));
}
/**
......
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