diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 69d86391e6dbd99c682c92a4d95cd5251b9afc3d..49f121e1a5c32f3a0b06a4ac0d950cf8e2d8f2ed 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -49,6 +49,7 @@ <name>SALUTATION</name> <title>Salutation</title> <consumer>Salutations</consumer> + <possibleItemsProcess>%aditoprj%/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js</possibleItemsProcess> </entityField> <entityField> <name>TITLE</name> @@ -551,6 +552,10 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <name>Language_param</name> <code>%aditoprj%/entity/Person_entity/entityfields/salutations/children/language_param/code.js</code> </entityParameter> + <entityParameter> + <name>uIdDefinition_param</name> + <code>%aditoprj%/entity/Person_entity/entityfields/salutations/children/uiddefinition_param/code.js</code> + </entityParameter> </children> </entityConsumer> <entityConsumer> @@ -584,6 +589,12 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <entityName>Salutation_entity</entityName> <fieldName>Titles</fieldName> </dependency> + <children> + <entityParameter> + <name>uIdDefinition_param</name> + <code>%aditoprj%/entity/Person_entity/entityfields/salutationtitles/children/uiddefinition_param/code.js</code> + </entityParameter> + </children> </entityConsumer> </entityFields> <recordContainers> diff --git a/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js b/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Person_entity/entityfields/salutations/children/uiddefinition_param/code.js b/entity/Person_entity/entityfields/salutations/children/uiddefinition_param/code.js new file mode 100644 index 0000000000000000000000000000000000000000..978d12e534880dbdbb19b65c4125e5651256d223 --- /dev/null +++ b/entity/Person_entity/entityfields/salutations/children/uiddefinition_param/code.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("SALUTATION"); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/salutationtitles/children/uiddefinition_param/code.js b/entity/Person_entity/entityfields/salutationtitles/children/uiddefinition_param/code.js new file mode 100644 index 0000000000000000000000000000000000000000..e2d104d4aecc6521d805cb03a3b784910d22be33 --- /dev/null +++ b/entity/Person_entity/entityfields/salutationtitles/children/uiddefinition_param/code.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("TITLE"); \ No newline at end of file diff --git a/entity/Salutation_entity/Salutation_entity.aod b/entity/Salutation_entity/Salutation_entity.aod index 45b480dcafe3ecf5825051096ddb19b4ca95f430..ef6897d9082bf85f284b8984d7031ac2f08a2bcd 100644 --- a/entity/Salutation_entity/Salutation_entity.aod +++ b/entity/Salutation_entity/Salutation_entity.aod @@ -3,6 +3,7 @@ <name>Salutation_entity</name> <title>Anrede</title> <majorModelMode>DISTRIBUTED</majorModelMode> + <titleProcess>%aditoprj%/entity/Salutation_entity/titleProcess.js</titleProcess> <recordContainer>db</recordContainer> <entityFields> <entityProvider> @@ -91,9 +92,9 @@ <entityProvider> <name>Titles</name> <fieldType>DEPENDENCY_IN</fieldType> - <lookupIdfield>TITLE</lookupIdfield> + <lookupIdfield>UID</lookupIdfield> <titleProcess>%aditoprj%/entity/Salutation_entity/entityfields/titles/titleProcess.js</titleProcess> - <recordContainer>db</recordContainer> + <recordContainer>title_jdito</recordContainer> <dependencies> <entityDependency> <name>b6dff8b9-1eda-4cb1-97a0-2852756295b7</name> @@ -111,7 +112,16 @@ </entityParameter> <entityField> <name>UID</name> + <titleProcess>%aditoprj%/entity/Salutation_entity/entityfields/uid/titleProcess.js</titleProcess> + <valueProcess>%aditoprj%/entity/Salutation_entity/entityfields/uid/valueProcess.js</valueProcess> </entityField> + <entityParameter> + <name>uIdDefinition_param</name> + <expose v="true" /> + <triggerRecalculation v="true" /> + <mandatory v="false" /> + <description>PARAMETER</description> + </entityParameter> </entityFields> <recordContainers> <dbRecordContainer> @@ -172,10 +182,17 @@ </dbRecordContainer> <jDitoRecordContainer> <name>distinctSalutation_jdito</name> + <title>Test</title> <jDitoRecordAlias>Data_alias</jDitoRecordAlias> + <contentProcess>%aditoprj%/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js</contentProcess> <recordFields> <element>UID.value</element> + <element>UID.displayValue</element> </recordFields> </jDitoRecordContainer> + <jDitoRecordContainer> + <name>title_jdito</name> + <jDitoRecordAlias>Data_alias</jDitoRecordAlias> + </jDitoRecordContainer> </recordContainers> </entity> diff --git a/entity/Salutation_entity/entityfields/uid/titleProcess.js b/entity/Salutation_entity/entityfields/uid/titleProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8e908a6ca5a1a57c9ab0e480f98e5b5fe5edba5b --- /dev/null +++ b/entity/Salutation_entity/entityfields/uid/titleProcess.js @@ -0,0 +1,11 @@ +import("system.vars"); +import("system.result"); + +var uIdDefinition = vars.get("$param.uIdDefinition_param") + + +if(uIdDefinition == "SALUTATION") + result.string("Anrede") + +if(uIdDefinition == "TITLE") + result.string("Titel") \ No newline at end of file diff --git a/entity/Salutation_entity/entityfields/uid/valueProcess.js b/entity/Salutation_entity/entityfields/uid/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..ef19222863e28ddae9bddbe8f66ebebb2be87a45 --- /dev/null +++ b/entity/Salutation_entity/entityfields/uid/valueProcess.js @@ -0,0 +1,12 @@ +//import("system.logging"); +//import("system.vars"); +//import("system.result"); +// +//var uIdDefinition = vars.get("$param.uIdDefinition_param") +// +// +//if(uIdDefinition == "SALUTATION") +// result.string(vars.get("$field.SALUTATION")) +// +//if(uIdDefinition == "TITLE") +// result.string(vars.get("$field.TITLE")) diff --git a/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js b/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..577b640acd616a8638c4d811aaf2bad0508fdf5b --- /dev/null +++ b/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js @@ -0,0 +1,18 @@ +import("system.logging"); +import("system.vars"); +import("system.result"); +import("system.db"); +import("Sql_lib"); + + +logging.log("kkkdjdkdjdf") +var cond = SqlCondition.begin() + .and("SALUTATION is not NULL") + .buildSql("select distinct SALUTATION, SALUTATION from SALUTATION", "1=2"); + +var salutation = db.table(cond); +logging.log(salutation) +logging.log(cond) + + +result.object(salutation); \ No newline at end of file diff --git a/entity/Salutation_entity/titleProcess.js b/entity/Salutation_entity/titleProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..a35437175f865c00ba31b9e69a31e23727529d19 --- /dev/null +++ b/entity/Salutation_entity/titleProcess.js @@ -0,0 +1,6 @@ +import("system.result"); +import("system.vars"); + +if (vars.get("$param.uIdDefinition_param") && vars.exists("$param.uIdDefinition_param")) + result.string(vars.get("$field.UID")) +else result.string("Anrede") \ No newline at end of file diff --git a/others/db_changes/data_alias/basic/2019.2/create_salutation.xml b/others/db_changes/data_alias/basic/2019.2/create_salutation.xml index acf107ae031b3c1ca7754bc6e8c351c1e6b027f0..7e3a19612134c8a967fc6d788a62fd423b9159a0 100644 --- a/others/db_changes/data_alias/basic/2019.2/create_salutation.xml +++ b/others/db_changes/data_alias/basic/2019.2/create_salutation.xml @@ -6,7 +6,7 @@ <constraints primaryKey="true" primaryKeyName="PK_SALUTATION_SALUTATIONID"/> </column> <column name="HEADLINE" type="NVARCHAR(50)"/> - <column name="LANGUAGE" type="CHAR(36)"/> + <column name="LANGUAGE" type="CHAR(3)"/> <column name="LETTERSALUTATION" type="NVARCHAR(50)"/> <column name="SALUTATION" type="NVARCHAR(50)"/> <column name="SEX" type="CHAR(36)"/>