From c91cbf564bb6bfb55560b32f7fa79d80a1cf4283 Mon Sep 17 00:00:00 2001
From: "j.goderbauer" <j.goderbauer@adito.de>
Date: Fri, 8 Feb 2019 15:22:34 +0100
Subject: [PATCH] Keyword: refactor provider-name

---
 entity/Activity_entity/Activity_entity.aod    |  2 +-
 entity/Contract_entity/Contract_entity.aod    |  6 ++--
 entity/Keyword_entity/Keyword_entity.aod      |  4 +--
 entity/Keyword_entity/documentation.adoc      | 30 ++++++++++++++++++-
 .../children/onlyactives/code.js              |  2 ++
 entity/Offer_entity/Offer_entity.aod          |  2 +-
 entity/Order_entity/Order_entity.aod          |  2 +-
 .../Organisation_entity.aod                   |  2 +-
 .../Productprice_entity.aod                   |  2 +-
 9 files changed, 41 insertions(+), 11 deletions(-)
 create mode 100644 entity/Keyword_entity/entityfields/specificcontainerkeywords/children/onlyactives/code.js

diff --git a/entity/Activity_entity/Activity_entity.aod b/entity/Activity_entity/Activity_entity.aod
index 9b08ae6812..87dacb27f6 100644
--- a/entity/Activity_entity/Activity_entity.aod
+++ b/entity/Activity_entity/Activity_entity.aod
@@ -197,7 +197,7 @@
       <dependency>
         <name>dependency</name>
         <entityName>Keyword_entity</entityName>
-        <fieldName>generic_dfi</fieldName>
+        <fieldName>SpecificContainerKeywords</fieldName>
       </dependency>
       <children>
         <entityParameter>
diff --git a/entity/Contract_entity/Contract_entity.aod b/entity/Contract_entity/Contract_entity.aod
index 83b3cbdbb8..155709bb42 100644
--- a/entity/Contract_entity/Contract_entity.aod
+++ b/entity/Contract_entity/Contract_entity.aod
@@ -208,7 +208,7 @@
       <dependency>
         <name>dependency</name>
         <entityName>Keyword_entity</entityName>
-        <fieldName>generic_dfi</fieldName>
+        <fieldName>SpecificContainerKeywords</fieldName>
       </dependency>
       <children>
         <entityParameter>
@@ -223,7 +223,7 @@
       <dependency>
         <name>dependency</name>
         <entityName>Keyword_entity</entityName>
-        <fieldName>generic_dfi</fieldName>
+        <fieldName>SpecificContainerKeywords</fieldName>
       </dependency>
       <children>
         <entityParameter>
@@ -238,7 +238,7 @@
       <dependency>
         <name>dependency</name>
         <entityName>Keyword_entity</entityName>
-        <fieldName>generic_dfi</fieldName>
+        <fieldName>SpecificContainerKeywords</fieldName>
       </dependency>
       <children>
         <entityParameter>
diff --git a/entity/Keyword_entity/Keyword_entity.aod b/entity/Keyword_entity/Keyword_entity.aod
index 1ae2d1416a..92a3e27b2b 100644
--- a/entity/Keyword_entity/Keyword_entity.aod
+++ b/entity/Keyword_entity/Keyword_entity.aod
@@ -65,7 +65,7 @@
       <documentation>%aditoprj%/entity/Keyword_entity/entityfields/containername_param/documentation.adoc</documentation>
     </entityParameter>
     <entityProvider>
-      <name>generic_dfi</name>
+      <name>SpecificContainerKeywords</name>
       <fieldType>DEPENDENCY_IN</fieldType>
       <lookupIdfield>KEYID</lookupIdfield>
       <recordContainer>db</recordContainer>
@@ -122,7 +122,7 @@
       <children>
         <entityParameter>
           <name>onlyActives</name>
-          <code>%aditoprj%/entity/Keyword_entity/entityfields/generic_dfi/children/onlyactives/code.js</code>
+          <code>%aditoprj%/entity/Keyword_entity/entityfields/specificcontainerkeywords/children/onlyactives/code.js</code>
           <expose v="true" />
         </entityParameter>
       </children>
diff --git a/entity/Keyword_entity/documentation.adoc b/entity/Keyword_entity/documentation.adoc
index 89dede6975..d883975a6c 100644
--- a/entity/Keyword_entity/documentation.adoc
+++ b/entity/Keyword_entity/documentation.adoc
@@ -1,5 +1,6 @@
 Keyword
 =======
+:toc:
 
 Simply said: A keyword is a list of key-value pairs. 
 
@@ -20,7 +21,12 @@ Keyword Entry::
 Keyword::
   Keyword describes the whole set of elements like keyword container and keyword entry. It's more like a virtual bracket for the whole construct.
   
-== Structure ==
+
+== Types of Keywords ==
+
+=== Simple Key-Value lists ===
+
+==== The Structure ====
 
 .abstract structure of keywords
 ["graphviz", subs="attributes+"]
@@ -74,4 +80,26 @@ And, to clarify an example:
 |52ce5785|2b2091eb|inactive|ContactStatus
 |=======
 
+=== Extended Key-Value lists with special Attributes ===
+
+Basically this is a extension of the <<Simple Key-Value lists>>.
+Sometimes it's neccesary to have some more propierties within a keyword-entry.
+Example:
+
+You've got a Keyword-container for Types of Communication with basically the following values:
+
+- mobile phone
+- landline phone
+- email-address
+- web-address
+
+If you want to add a general type of information like "PHONE", "MAIL", "WEB" you've to add a keyword-attribute to the keyword-entry where you can store that information.
+
+
+=== Complex Keyword as own entity ===
+
+Sometimes you've a special case where the keyword entity cannot provide all the functioality. 
+
+In that case you can always define you own entity and create your own database strucutre to represent all the information and provide all the functions you need.
 
+As an example, this could be the `Country_Entity`
\ No newline at end of file
diff --git a/entity/Keyword_entity/entityfields/specificcontainerkeywords/children/onlyactives/code.js b/entity/Keyword_entity/entityfields/specificcontainerkeywords/children/onlyactives/code.js
new file mode 100644
index 0000000000..0e7522714a
--- /dev/null
+++ b/entity/Keyword_entity/entityfields/specificcontainerkeywords/children/onlyactives/code.js
@@ -0,0 +1,2 @@
+import("system.result");
+result.string("true");//TODO: provider-code is not executed correct (did not receive the value from here)
\ No newline at end of file
diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod
index 70a044a918..4c96e366bc 100644
--- a/entity/Offer_entity/Offer_entity.aod
+++ b/entity/Offer_entity/Offer_entity.aod
@@ -323,7 +323,7 @@
       <dependency>
         <name>dependency</name>
         <entityName>Keyword_entity</entityName>
-        <fieldName>generic_dfi</fieldName>
+        <fieldName>SpecificContainerKeywords</fieldName>
       </dependency>
       <children>
         <entityParameter>
diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod
index 272dd7ab4c..7ade315812 100644
--- a/entity/Order_entity/Order_entity.aod
+++ b/entity/Order_entity/Order_entity.aod
@@ -284,7 +284,7 @@
       <dependency>
         <name>dependency</name>
         <entityName>Keyword_entity</entityName>
-        <fieldName>generic_dfi</fieldName>
+        <fieldName>SpecificContainerKeywords</fieldName>
       </dependency>
       <children>
         <entityParameter>
diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod
index 4e0032a4e0..f20931628d 100644
--- a/entity/Organisation_entity/Organisation_entity.aod
+++ b/entity/Organisation_entity/Organisation_entity.aod
@@ -434,7 +434,7 @@ Usually this is used for filtering COMM-entires by a specified contact or creati
       <dependency>
         <name>dependency</name>
         <entityName>Keyword_entity</entityName>
-        <fieldName>generic_dfi</fieldName>
+        <fieldName>SpecificContainerKeywords</fieldName>
       </dependency>
       <children>
         <entityParameter>
diff --git a/entity/Productprice_entity/Productprice_entity.aod b/entity/Productprice_entity/Productprice_entity.aod
index 69f593b0ca..b8669e264b 100644
--- a/entity/Productprice_entity/Productprice_entity.aod
+++ b/entity/Productprice_entity/Productprice_entity.aod
@@ -150,7 +150,7 @@
       <dependency>
         <name>dependency</name>
         <entityName>Keyword_entity</entityName>
-        <fieldName>generic_dfi</fieldName>
+        <fieldName>SpecificContainerKeywords</fieldName>
       </dependency>
       <children>
         <entityParameter>
-- 
GitLab