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

addressValidation: preset with current value, use project preferences

parent cb641397
No related branches found
No related tags found
No related merge requests found
Showing with 55 additions and 4 deletions
......@@ -96,6 +96,11 @@
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>CurrentValue_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
......@@ -17,6 +17,9 @@ if(sysFilter.filter != null) {
filter = JSON.parse(sysFilter.filter).childs[0].value;
}
if (!filter && vars.exists("$param.CurrentValue_param") && vars.get("$param.CurrentValue_param"))
filter = vars.get("$param.CurrentValue_param");
var foundAddresses = AddressValidationUtils.validate(filter, type, country);
result.object(foundAddresses);
\ No newline at end of file
......@@ -313,6 +313,10 @@
<name>Country_param</name>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/zipvalidation/children/country_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>CurrentValue_param</name>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/zipvalidation/children/currentvalue_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
......@@ -323,6 +327,16 @@
<entityName>AddressValidation_entity</entityName>
<fieldName>CityValidation</fieldName>
</dependency>
<children>
<entityParameter>
<name>CurrentValue_param</name>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/cityvalidation/children/currentvalue_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>Country_param</name>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/cityvalidation/children/country_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
......
import("system.result");
import("system.vars");
result.string(vars.get("$field.COUNTRY"))
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.CITY"))
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.ZIP"))
\ No newline at end of file
......@@ -6,6 +6,8 @@ import("KeywordRegistry_basic");
import("system.neon");
import("PostalAddress_lib");
// TODO: put into AddressValidation_lib
var addr = vars.get("$this.value");
if (addr)
......
......@@ -33,4 +33,18 @@
<indexsearchIncrementingIndexerInterval v="1000" />
<indexsearchIncrementingIndexerBunchSize v="250" />
<indexsearchMaximumHits v="50000" />
<customProperties>
<customStringProperty>
<name>addressValidation.url</name>
<property>https://services.aditosoftware.local/services/rest/ws_checkAddress</property>
</customStringProperty>
<customStringProperty>
<name>addressValidation.user</name>
<property>Admin</property>
</customStringProperty>
<customStringProperty>
<name>addressValidation.pw</name>
<property>a</property>
</customStringProperty>
</customProperties>
</preferences>
import("system.logging");
import("system.project");
import("system.vars");
import("system.neon");
import("system.net");
......@@ -61,10 +63,9 @@ function AddressValidationUtils() {}
*/
AddressValidationUtils.validate = function(pValue, pType, pCountry)
{
// TODO: Options for url, user, pw
var userName = "Admin";
var pw = "a";
var url = "https://services.aditosoftware.local/services/rest/ws_checkAddress";
var userName = project.getPreferenceValue("custom.addressValidation.user");
var pw = project.getPreferenceValue("custom.addressValidation.pw");
var url = project.getPreferenceValue("custom.addressValidation.url");
var actionType = "GET";
// get AddressValidationType-Object if it is only the key
......
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