Skip to content
Snippets Groups Projects
Commit 352c3365 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Merge branch 'cm-sp-1080178-AddressValidation' into '2021.1.0'

Cm sp 1080178 address validation

See merge request xrm/basic!1018
parents 92143b8c 7f0e873a
No related branches found
No related tags found
No related merge requests found
Showing
with 73 additions and 210 deletions
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="s.pongratz" id="5974608c-488a-4be9-b404-c58dc7240f7d">
<addColumn tableName="ADDRESS">
<column name="VALIDATION_RESULT" type="NCLOB"/>
</addColumn>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<include relativeToChangelogFile="true" file="addValidationResultColumn.xml"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -7,4 +7,5 @@
<include relativeToChangelogFile="true" file="offerWorkflow/add_ab_keyword_entry_activityCategory.xml"/>
<include relativeToChangelogFile="true" file="create_standardWorkflow.xml"/>
<include relativeToChangelogFile="true" file="Advertising/changelog.xml"/>
<include relativeToChangelogFile="true" file="Addressvalidation/changelog.xml"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -1092,8 +1092,8 @@
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<size v="29" />
<scale v="9" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
......@@ -1120,8 +1120,8 @@
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<size v="29" />
<scale v="9" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
......@@ -1171,6 +1171,20 @@
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>VALIDATION_RESULT</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="2005" />
<size v="2147483647" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
</entityFields>
</entityDb>
<entityDb>
......
......@@ -14,17 +14,6 @@
<title>Address</title>
<description>UID consists of all fields as JSON. </description>
</entityField>
<entityProvider>
<name>ZipValidaton</name>
<documentation>%aditoprj%/entity/AddressValidation_entity/entityfields/zipvalidaton/documentation.adoc</documentation>
<children>
<entityParameter>
<name>Type_param</name>
<valueProcess>%aditoprj%/entity/AddressValidation_entity/entityfields/zipvalidaton/children/type_param/valueProcess.js</valueProcess>
<expose v="false" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>Type_param</name>
<expose v="true" />
......@@ -65,17 +54,6 @@
<name>VALUE</name>
<description>Final value returned</description>
</entityField>
<entityProvider>
<name>CityValidation</name>
<documentation>%aditoprj%/entity/AddressValidation_entity/entityfields/cityvalidation/documentation.adoc</documentation>
<children>
<entityParameter>
<name>Type_param</name>
<valueProcess>%aditoprj%/entity/AddressValidation_entity/entityfields/cityvalidation/children/type_param/valueProcess.js</valueProcess>
<expose v="false" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>CurrentValue_param</name>
<expose v="true" />
......@@ -109,17 +87,6 @@
<name>BUILDINGNO</name>
<title>House number</title>
</entityField>
<entityProvider>
<name>StreetValidation</name>
<documentation>%aditoprj%/entity/AddressValidation_entity/entityfields/streetvalidation/documentation.adoc</documentation>
<children>
<entityParameter>
<name>Type_param</name>
<valueProcess>%aditoprj%/entity/AddressValidation_entity/entityfields/streetvalidation/children/type_param/valueProcess.js</valueProcess>
<expose v="false" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>City_param</name>
<expose v="true" />
......
import("WsValidation_lib");
import("system.result");
result.string(WsValidationType.get().TYPE_CITY_NOMINATIM.key);
\ No newline at end of file
= AddressValidation_entity - CityValidation
Provider for validating city only
\ No newline at end of file
import("WsValidation_lib");
import("system.result");
result.string(WsValidationType.get().TYPE_STREET_NOMINATIM.key);
\ No newline at end of file
= AddressValidation_entity - StreetValidation
Provider for validating street only
\ No newline at end of file
import("WsValidation_lib");
import("system.result");
result.string(WsValidationType.get().TYPE_ZIP_NOMINATIM.key);
\ No newline at end of file
= AddressValidation_entity - ZipValidation
Provider for validating zip only
\ No newline at end of file
......@@ -12,9 +12,10 @@
<entityField>
<name>ADDRESS</name>
<title>Street</title>
<mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/address/mandatoryProcess.js</mandatoryProcess>
<textInputAllowed v="true" />
<mandatory v="true" />
<textInputAllowed v="false" />
<stateProcess>%aditoprj%/entity/Address_entity/entityfields/address/stateProcess.js</stateProcess>
<tooltip></tooltip>
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/address/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
......@@ -46,14 +47,21 @@
<name>BUILDINGNO</name>
<title>House number</title>
<stateProcess>%aditoprj%/entity/Address_entity/entityfields/buildingno/stateProcess.js</stateProcess>
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/buildingno/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>CITY</name>
<documentation>%aditoprj%/entity/Address_entity/entityfields/city/documentation.adoc</documentation>
<title>City</title>
<mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/city/mandatoryProcess.js</mandatoryProcess>
<textInputAllowed v="true" />
<mandatory v="true" />
<stateProcess>%aditoprj%/entity/Address_entity/entityfields/city/stateProcess.js</stateProcess>
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/city/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>COUNTRY</name>
......@@ -63,6 +71,10 @@
<stateProcess>%aditoprj%/entity/Address_entity/entityfields/country/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/country/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Address_entity/entityfields/country/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/country/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>DISTRICT</name>
......@@ -84,12 +96,20 @@
<title>${ADDRESS_STATE}</title>
<mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/state/mandatoryProcess.js</mandatoryProcess>
<stateProcess>%aditoprj%/entity/Address_entity/entityfields/state/stateProcess.js</stateProcess>
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/state/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>ZIP</name>
<title>Postcode</title>
<mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/zip/mandatoryProcess.js</mandatoryProcess>
<mandatory v="true" />
<stateProcess>%aditoprj%/entity/Address_entity/entityfields/zip/stateProcess.js</stateProcess>
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/zip/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
<onValidation>%aditoprj%/entity/Address_entity/entityfields/zip/onValidation.js</onValidation>
</entityField>
<entityProvider>
......@@ -262,42 +282,6 @@
<contentTypeProcess>%aditoprj%/entity/Address_entity/entityfields/is_standard_icon/contentTypeProcess.js</contentTypeProcess>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/is_standard_icon/valueProcess.js</valueProcess>
</entityField>
<entityConsumer>
<name>ZipValidation</name>
<dependency>
<name>dependency</name>
<entityName>AddressValidation_entity</entityName>
<fieldName>ZipValidaton</fieldName>
</dependency>
<children>
<entityParameter>
<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>
<name>CityValidation</name>
<dependency>
<name>dependency</name>
<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>
<entityField>
<name>AddressSearch</name>
<documentation>%aditoprj%/entity/Address_entity/entityfields/addresssearch/documentation.adoc</documentation>
......@@ -328,81 +312,11 @@
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
<name>StreetValidation</name>
<dependency>
<name>dependency</name>
<entityName>AddressValidation_entity</entityName>
<fieldName>StreetValidation</fieldName>
</dependency>
<children>
<entityParameter>
<name>City_param</name>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/streetvalidation/children/city_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>Country_param</name>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/streetvalidation/children/country_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>CurrentValue_param</name>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/streetvalidation/children/currentvalue_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityParameter>
<name>ShowDsgvoMessage_param</name>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/showdsgvomessage_param/valueProcess.js</valueProcess>
<expose v="true" />
</entityParameter>
<entityField>
<name>Zip_ws</name>
<documentation>%aditoprj%/entity/Address_entity/entityfields/zip_ws/documentation.adoc</documentation>
<title>Postcode</title>
<consumer>ZipValidation</consumer>
<mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/zip_ws/mandatoryProcess.js</mandatoryProcess>
<textInputAllowed v="true" />
<stateProcess>%aditoprj%/entity/Address_entity/entityfields/zip_ws/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/zip_ws/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Address_entity/entityfields/zip_ws/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/zip_ws/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
<onValidation>%aditoprj%/entity/Address_entity/entityfields/zip_ws/onValidation.js</onValidation>
</entityField>
<entityField>
<name>City_ws</name>
<documentation>%aditoprj%/entity/Address_entity/entityfields/city_ws/documentation.adoc</documentation>
<title>City</title>
<consumer>CityValidation</consumer>
<mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/city_ws/mandatoryProcess.js</mandatoryProcess>
<textInputAllowed v="true" />
<stateProcess>%aditoprj%/entity/Address_entity/entityfields/city_ws/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/city_ws/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Address_entity/entityfields/city_ws/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/city_ws/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>Address_ws</name>
<documentation>%aditoprj%/entity/Address_entity/entityfields/address_ws/documentation.adoc</documentation>
<title>Street</title>
<description></description>
<consumer>StreetValidation</consumer>
<mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/address_ws/mandatoryProcess.js</mandatoryProcess>
<textInputAllowed v="true" />
<stateProcess>%aditoprj%/entity/Address_entity/entityfields/address_ws/stateProcess.js</stateProcess>
<titleProcess>%aditoprj%/entity/Address_entity/entityfields/address_ws/titleProcess.js</titleProcess>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/address_ws/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Address_entity/entityfields/address_ws/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/Address_entity/entityfields/address_ws/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
</entityField>
<entityProvider>
<name>QuickEntryAdresses</name>
<documentation>%aditoprj%/entity/Address_entity/entityfields/quickentryadresses/documentation.adoc</documentation>
......@@ -434,6 +348,9 @@
<stateProcess>%aditoprj%/entity/Address_entity/entityfields/formattedaddress/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/formattedaddress/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>VALIDATION_RESULT</name>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......@@ -543,6 +460,10 @@
<name>LON.value</name>
<recordfield>ADDRESS.LON</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>VALIDATION_RESULT.value</name>
<recordfield>ADDRESS.VALIDATION_RESULT</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings>
<linkInformation>
<linkInformation>
......
import("system.vars");
import("AddressEntity_lib");
import("system.result");
import("WsValidation_lib");
result.string(WsValidationFieldUtils.mainFieldMandatoryProcess(WsValidationType.get().TYPE_STREET_NOMINATIM, AddressEntityValidation.isMandatoryField(vars.get("$field.COUNTRY"))));
\ No newline at end of file
import("system.vars");
import("WsValidation_lib");
import("system.neon");
if (WsValidationUtils.isWsEnabled(WsValidationType.get().TYPE_STREET_NOMINATIM))
WsValidationUtils.setAddressFields(vars.get("$local.value"));
\ No newline at end of file
neon.setFieldValue("$field.VALIDATION_RESULT", null);
\ No newline at end of file
import("system.neon");
import("system.vars");
import("system.result");
import("WsValidation_lib");
import("system.vars");
// The field is only displayed in edit mode because there is the "formattedAddress" field which one shows the fromated address.
// If the field has a Value it would be displayed next to the formattedAddress field in view mode, so in this case the state is set to invisible.
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_VIEW)
if (vars.get("$sys.recordstate") == "" || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW)
{
result.string(neon.COMPONENTSTATE_INVISIBLE);
else
result.string(WsValidationFieldUtils.mainFieldStateProcess(WsValidationType.get().TYPE_STREET_NOMINATIM));
\ No newline at end of file
}
\ No newline at end of file
import("WsValidation_lib");
WsValidationFieldUtils.wsDisplayValueProcess(WsValidationType.get().TYPE_STREET_NOMINATIM, "$field.ADDRESS");
\ No newline at end of file
This is a field used for the address-webservice. It is only displayed if the webservice is enabled.
See WsValidation_lib for technical implementation information.
\ No newline at end of file
import("system.vars");
import("AddressEntity_lib");
import("WsValidation_lib");
import("system.result");
result.object(WsValidationFieldUtils.wsFieldMandatoryProcess(WsValidationType.get().TYPE_STREET_NOMINATIM, AddressEntityValidation.isMandatoryField(vars.get("$field.COUNTRY"), "ADDRESS")));
\ No newline at end of file
import("WsValidation_lib");
WsValidationFieldUtils.wsOnValueChangeProcess(WsValidationType.get().TYPE_STREET_NOMINATIM, "$field.ADDRESS");
\ No newline at end of file
import("system.neon");
import("system.vars");
import("system.result");
import("WsValidation_lib");
// The field is only displayed in edit mode because there is the "formattedAddress" field which one shows the fromated address.
// If the field has a Value it would be displayed next to the formattedAddress field in view mode, so in this case the state is set to invisible.
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_VIEW)
result.string(neon.COMPONENTSTATE_INVISIBLE);
else
result.string(WsValidationFieldUtils.wsFieldStateProcess(WsValidationType.get().TYPE_STREET_NOMINATIM));
\ 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