From ecbabc8f93d196d4ab4a02daa5a228a3c43ed422 Mon Sep 17 00:00:00 2001
From: Johannes Hoermann <j.hoermann@adito.de>
Date: Tue, 19 Nov 2019 08:40:43 +0100
Subject: [PATCH] WsValidation docu improvement and links to docu in lib

---
 entity/Address_entity/Address_entity.aod               |  5 +++++
 entity/Address_entity/documentation.adoc               |  4 +++-
 .../entityfields/address_ws/documentation.adoc         |  3 +++
 .../entityfields/addresssearch/documentation.adoc      |  3 +++
 .../entityfields/city_ws/documentation.adoc            |  3 +++
 .../entityfields/zip_ws/documentation.adoc             |  3 +++
 process/WsValidation_lib/process.js                    | 10 +++++++---
 7 files changed, 27 insertions(+), 4 deletions(-)
 create mode 100644 entity/Address_entity/entityfields/address_ws/documentation.adoc
 create mode 100644 entity/Address_entity/entityfields/addresssearch/documentation.adoc
 create mode 100644 entity/Address_entity/entityfields/city_ws/documentation.adoc
 create mode 100644 entity/Address_entity/entityfields/zip_ws/documentation.adoc

diff --git a/entity/Address_entity/Address_entity.aod b/entity/Address_entity/Address_entity.aod
index 789b4875c2..d8b0338b83 100644
--- a/entity/Address_entity/Address_entity.aod
+++ b/entity/Address_entity/Address_entity.aod
@@ -361,6 +361,7 @@
     </entityConsumer>
     <entityField>
       <name>AddressSearch</name>
+      <documentation>%aditoprj%/entity/Address_entity/entityfields/addresssearch/documentation.adoc</documentation>
       <title>Search</title>
       <consumer>FullAddressValidation</consumer>
       <stateProcess>%aditoprj%/entity/Address_entity/entityfields/addresssearch/stateProcess.js</stateProcess>
@@ -417,6 +418,7 @@
     </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>
@@ -432,6 +434,7 @@
     </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>
@@ -446,7 +449,9 @@
     </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" />
diff --git a/entity/Address_entity/documentation.adoc b/entity/Address_entity/documentation.adoc
index 3df0a5a5e2..e50f759d6a 100644
--- a/entity/Address_entity/documentation.adoc
+++ b/entity/Address_entity/documentation.adoc
@@ -8,4 +8,6 @@ The entity manages storing postal addresses and provides features like validatio
 
 Every `CONTACT` has one standard address value that is used by default for some actions. Keep in mind that this standard address has a special status and therefore may cannot be deleted.
 
-Webservice Validation: See WsValidation_lib
\ No newline at end of file
+Webservice Validation: See WsValidation_lib
+To enable the nominatim webservice: go to Preferences -> _____PREFERENCES_PROJECT -> _____PREFERENCES_PROJECT
+and enable the nominatim.enable checkbox
\ No newline at end of file
diff --git a/entity/Address_entity/entityfields/address_ws/documentation.adoc b/entity/Address_entity/entityfields/address_ws/documentation.adoc
new file mode 100644
index 0000000000..f15b5e5649
--- /dev/null
+++ b/entity/Address_entity/entityfields/address_ws/documentation.adoc
@@ -0,0 +1,3 @@
+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
diff --git a/entity/Address_entity/entityfields/addresssearch/documentation.adoc b/entity/Address_entity/entityfields/addresssearch/documentation.adoc
new file mode 100644
index 0000000000..f15b5e5649
--- /dev/null
+++ b/entity/Address_entity/entityfields/addresssearch/documentation.adoc
@@ -0,0 +1,3 @@
+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
diff --git a/entity/Address_entity/entityfields/city_ws/documentation.adoc b/entity/Address_entity/entityfields/city_ws/documentation.adoc
new file mode 100644
index 0000000000..f15b5e5649
--- /dev/null
+++ b/entity/Address_entity/entityfields/city_ws/documentation.adoc
@@ -0,0 +1,3 @@
+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
diff --git a/entity/Address_entity/entityfields/zip_ws/documentation.adoc b/entity/Address_entity/entityfields/zip_ws/documentation.adoc
new file mode 100644
index 0000000000..f15b5e5649
--- /dev/null
+++ b/entity/Address_entity/entityfields/zip_ws/documentation.adoc
@@ -0,0 +1,3 @@
+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
diff --git a/process/WsValidation_lib/process.js b/process/WsValidation_lib/process.js
index 4fb75a4407..53fd37c614 100644
--- a/process/WsValidation_lib/process.js
+++ b/process/WsValidation_lib/process.js
@@ -16,6 +16,10 @@ import("AddressEntity_lib");
 /******************************************************************************/
 /******************************************************************************/
 /*
+
+To enable the nominatim webservice: go to Preferences -> _____PREFERENCES_PROJECT -> _____PREFERENCES_PROJECT
+and enable the nominatim.enable checkbox
+
 1. How to add a new Webservice type
 -----------------------------------
 - Scroll down to WsValidationType.get
@@ -503,7 +507,7 @@ WsValidationFieldUtils.mainFieldMandatoryProcess = function(pWsType, pMandatory)
  * Note: may call result.string(...)
  *
  * @param {WsValidationType} pWsType
- * @param {String} field-variable from the main field. e.g. "$field.ZIP"
+ * @param {String} pMainField field-variable from the main field. e.g. "$field.ZIP"
  */
 WsValidationFieldUtils.wsValueProcess = function(pWsType, pMainField)
 {//vars.get("$this.value") == null && 
@@ -517,7 +521,7 @@ WsValidationFieldUtils.wsValueProcess = function(pWsType, pMainField)
  * Note: may call result.string(...)
  *
  * @param {WsValidationType} pWsType
- * @param {String} field-variable from the main field. e.g. "$field.ZIP"
+ * @param {String} pMainField field-variable from the main field. e.g. "$field.ZIP"
  */
 WsValidationFieldUtils.wsDisplayValueProcess = function(pWsType, pMainField)
 {
@@ -532,7 +536,7 @@ WsValidationFieldUtils.wsDisplayValueProcess = function(pWsType, pMainField)
  * Note: may call result.string(...)
  *
  * @param {WsValidationType} pWsType
- * @param {String} field-variable from the main field. e.g. "$field.ZIP"
+ * @param {String} pMainField field-variable from the main field. e.g. "$field.ZIP"
  */
 WsValidationFieldUtils.wsOnValueChangeProcess = function(pWsType, pMainField)
 {
-- 
GitLab