diff --git a/entity/AttributeRelation_entity/AttributeRelation_entity.aod b/entity/AttributeRelation_entity/AttributeRelation_entity.aod index e014c096bd5a961e40db0b8f38e6fd74e664adaf..c13c98c8e85d98a9ec58064b1ce447edbd77fca9 100644 --- a/entity/AttributeRelation_entity/AttributeRelation_entity.aod +++ b/entity/AttributeRelation_entity/AttributeRelation_entity.aod @@ -59,12 +59,6 @@ <fieldName>AttributeChildren</fieldName> <isConsumer v="false" /> </entityDependency> - <entityDependency> - <name>ba8046ba-f58c-48f1-9c35-fe897247534a</name> - <entityName>Person_entity</entityName> - <fieldName>Attributes</fieldName> - <isConsumer v="false" /> - </entityDependency> </dependencies> <children> <entityParameter> diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 1350415190207da96e02d466ca986aa8bcd559b5..69d86391e6dbd99c682c92a4d95cd5251b9afc3d 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -35,7 +35,6 @@ <name>LASTNAME</name> <title>Lastname</title> <mandatory v="true" /> - <valueProcess>%aditoprj%/entity/Person_entity/entityfields/lastname/valueProcess.js</valueProcess> </entityField> <entityField> <name>MIDDLENAME</name> @@ -49,19 +48,12 @@ <entityField> <name>SALUTATION</name> <title>Salutation</title> - <possibleItemsProcess>%aditoprj%/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js</possibleItemsProcess> - <valueProcess>%aditoprj%/entity/Person_entity/entityfields/salutation/valueProcess.js</valueProcess> - <onValidation>%aditoprj%/entity/Person_entity/entityfields/salutation/onValidation.js</onValidation> - <onValueChangeTypes> - <element>MASK</element> - <element>PROCESS</element> - <element>RECORD</element> - </onValueChangeTypes> + <consumer>Salutations</consumer> </entityField> <entityField> <name>TITLE</name> <title>Title</title> - <possibleItemsProcess>%aditoprj%/entity/Person_entity/entityfields/title/possibleItemsProcess.js</possibleItemsProcess> + <consumer>SalutationTitles</consumer> </entityField> <entityField> <name>TITLESUFFIX</name> @@ -297,6 +289,12 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <consumer>Languages</consumer> <mandatory v="true" /> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/language/valueProcess.js</valueProcess> + <onValueChange>%aditoprj%/entity/Person_entity/entityfields/language/onValueChange.js</onValueChange> + <onValueChangeTypes> + <element>MASK</element> + <element>PROCESS</element> + <element>RECORD</element> + </onValueChangeTypes> </entityField> <entityConsumer> <name>Documents</name> @@ -540,6 +538,53 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact </entityParameter> </children> </entityConsumer> + <entityConsumer> + <name>Salutations</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>Salutation_entity</entityName> + <fieldName>Salutations</fieldName> + </dependency> + <children> + <entityParameter> + <name>Language_param</name> + <code>%aditoprj%/entity/Person_entity/entityfields/salutations/children/language_param/code.js</code> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>Attributes</name> + <title>Attributes</title> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>AttributeRelation_entity</entityName> + <fieldName>RelationsForSpecificObject</fieldName> + </dependency> + <children> + <entityParameter> + <name>objectRowId_param</name> + <code>%aditoprj%/entity/Person_entity/entityfields/attributes/children/objectrowid_param/code.js</code> + <expose v="true" /> + <triggerRecalculation v="true" /> + </entityParameter> + <entityParameter> + <name>objectType_param</name> + <code>%aditoprj%/entity/Person_entity/entityfields/attributes/children/objecttype_param/code.js</code> + <triggerRecalculation v="true" /> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>SalutationTitles</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>Salutation_entity</entityName> + <fieldName>Titles</fieldName> + </dependency> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Person_entity/entityfields/language/onValueChange.js b/entity/Person_entity/entityfields/language/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..03065f02fb7b396fe16137da6fbcdbf881996b54 --- /dev/null +++ b/entity/Person_entity/entityfields/language/onValueChange.js @@ -0,0 +1,3 @@ +import("system.neon"); + +neon.setFieldValue("$field.SALUTATION", ""); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/salutation/onValidation.js b/entity/Person_entity/entityfields/salutation/onValidation.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js b/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js deleted file mode 100644 index b0ae277de8e96d93f754ad59d9ef63155d676cb7..0000000000000000000000000000000000000000 --- a/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js +++ /dev/null @@ -1,15 +0,0 @@ -import("system.logging"); -import("system.vars"); -import("system.result"); -import("system.db"); -import("Sql_lib"); - - -var cond = SqlCondition.begin() - .and("SALUTATION is not NULL") - .andPrepareVars("SALUTATION.LANGUAGE", "$field.LANGUAGE") - .buildSql("select distinct SALUTATION, SALUTATION from SALUTATION", "1=2"); - -var salutation = db.table(cond); - -result.object(salutation); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/salutation/valueProcess.js b/entity/Person_entity/entityfields/salutation/valueProcess.js deleted file mode 100644 index 0287816000ad4502304d8914d30553b54b8ba666..0000000000000000000000000000000000000000 --- a/entity/Person_entity/entityfields/salutation/valueProcess.js +++ /dev/null @@ -1,16 +0,0 @@ -import("system.logging"); -import("system.result"); -import("system.db"); -import("system.vars"); -import("Sql_lib"); - - -var language = vars.get("$field.LANGUAGE"); -var cond = SqlCondition.begin(); -var salLanguage = db.cell(cond.andPrepareVars("SALUTATION.SALUTATION", "$field.SALUTATION").buildSql("select distinct LANGUAGE from SALUTATION", "1=2")); - - -if(language != salLanguage) - { - result.string(""); - } \ No newline at end of file diff --git a/entity/Person_entity/entityfields/salutations/children/language_param/code.js b/entity/Person_entity/entityfields/salutations/children/language_param/code.js new file mode 100644 index 0000000000000000000000000000000000000000..2cb0f4295d8276abc980683fdc3945bcfd965aee --- /dev/null +++ b/entity/Person_entity/entityfields/salutations/children/language_param/code.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.LANGUAGE")) \ No newline at end of file diff --git a/entity/Person_entity/entityfields/title/possibleItemsProcess.js b/entity/Person_entity/entityfields/title/possibleItemsProcess.js deleted file mode 100644 index c1f2d5c8ff4573d475585e71f007f01846b3da1a..0000000000000000000000000000000000000000 --- a/entity/Person_entity/entityfields/title/possibleItemsProcess.js +++ /dev/null @@ -1,10 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.db"); -import("Sql_lib"); - -var cond = SqlCondition.begin() - -var title = db.table(cond.andPrepareVars("SALUTATION.SALUTATION", "$field.SALUTATION").buildSql("select TITLE, TITLE from SALUTATION", "1=2")) - -result.object(title); \ No newline at end of file diff --git a/entity/Salutation_entity/Salutation_entity.aod b/entity/Salutation_entity/Salutation_entity.aod index 8cf9b343988d8b5ff1d688fcccb723f7ea86fa38..1266da67e735b738a6524df82f8be5159dbcb3c4 100644 --- a/entity/Salutation_entity/Salutation_entity.aod +++ b/entity/Salutation_entity/Salutation_entity.aod @@ -1,128 +1,171 @@ -<?xml version="1.0" encoding="UTF-8"?> -<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.2.0"> - <name>Salutation_entity</name> - <title>Anrede</title> - <majorModelMode>DISTRIBUTED</majorModelMode> - <recordContainer>db</recordContainer> - <entityFields> - <entityProvider> - <name>#PROVIDER</name> - <recordContainer>db</recordContainer> - </entityProvider> - <entityField> - <name>SALUTATIONID</name> - <valueProcess>%aditoprj%/entity/Salutation_entity/entityfields/salutationid/valueProcess.js</valueProcess> - </entityField> - <entityField> - <name>HEADLINE</name> - <title>Anrede im Briefkopf</title> - </entityField> - <entityField> - <name>LANGUAGE_SALUTATION</name> - <title>Sprache</title> - <consumer>Languages</consumer> - </entityField> - <entityField> - <name>LETTERSALUTATION</name> - <title>Briefanrede</title> - </entityField> - <entityField> - <name>SALUTATION</name> - <title>Anrede</title> - </entityField> - <entityField> - <name>SEX</name> - <title>Geschlecht</title> - <consumer>KeywordGender</consumer> - </entityField> - <entityField> - <name>SORT</name> - <title>Sortierung</title> - </entityField> - <entityField> - <name>TITLE</name> - <title>(Akademischer) Titel</title> - </entityField> - <entityConsumer> - <name>Languages</name> - <fieldType>DEPENDENCY_OUT</fieldType> - <dependency> - <name>dependency</name> - <entityName>Language_entity</entityName> - <fieldName>LanguagesISO3Code</fieldName> - </dependency> - </entityConsumer> - <entityConsumer> - <name>KeywordGender</name> - <fieldType>DEPENDENCY_OUT</fieldType> - <dependency> - <name>dependency</name> - <entityName>KeywordEntry_entity</entityName> - <fieldName>SpecificContainerKeywords</fieldName> - </dependency> - <children> - <entityParameter> - <name>containerName_param</name> - <code>%aditoprj%/entity/Salutation_entity/entityfields/keywordgender/children/containername_param/code.js</code> - </entityParameter> - </children> - </entityConsumer> - </entityFields> - <recordContainers> - <dbRecordContainer> - <name>db</name> - <alias>Data_alias</alias> - <linkInformation> - <linkInformation> - <name>6543f63c-3486-4e8b-bfc8-51b5088ce0b6</name> - <tableName>SALUTATION</tableName> - <primaryKey>SALUTATIONID</primaryKey> - <isUIDTable v="true" /> - <readonly v="false" /> - </linkInformation> - </linkInformation> - <recordFieldMappings> - <dbRecordFieldMapping> - <name>HEADLINE.value</name> - <recordfield>SALUTATION.HEADLINE</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>LANGUAGE_SALUTATION.value</name> - <recordfield>SALUTATION.LANGUAGE</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>LETTERSALUTATION.value</name> - <recordfield>SALUTATION.LETTERSALUTATION</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>SALUTATION.value</name> - <recordfield>SALUTATION.SALUTATION</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>SALUTATIONID.value</name> - <recordfield>SALUTATION.SALUTATIONID</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>SEX.value</name> - <recordfield>SALUTATION.SEX</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>SORT.value</name> - <recordfield>SALUTATION.SORT</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>TITLE.value</name> - <recordfield>SALUTATION.TITLE</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>LANGUAGE_SALUTATION.displayValue</name> - <expression>%aditoprj%/entity/Salutation_entity/recordcontainers/db/recordfieldmappings/language_salutation.displayvalue/expression.js</expression> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>SEX.displayValue</name> - <expression>%aditoprj%/entity/Salutation_entity/recordcontainers/db/recordfieldmappings/sex.displayvalue/expression.js</expression> - </dbRecordFieldMapping> - </recordFieldMappings> - </dbRecordContainer> - </recordContainers> -</entity> +<?xml version="1.0" encoding="UTF-8"?> +<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.2.0"> + <name>Salutation_entity</name> + <title>Anrede</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <recordContainer>db</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + <recordContainer>db</recordContainer> + </entityProvider> + <entityField> + <name>SALUTATIONID</name> + <valueProcess>%aditoprj%/entity/Salutation_entity/entityfields/salutationid/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>HEADLINE</name> + <title>Anrede im Briefkopf</title> + </entityField> + <entityField> + <name>LANGUAGE_SALUTATION</name> + <title>Sprache</title> + <consumer>Languages</consumer> + </entityField> + <entityField> + <name>LETTERSALUTATION</name> + <title>Briefanrede</title> + </entityField> + <entityField> + <name>SALUTATION</name> + <title>Anrede</title> + </entityField> + <entityField> + <name>SEX</name> + <title>Geschlecht</title> + <consumer>KeywordGender</consumer> + </entityField> + <entityField> + <name>SORT</name> + <title>Sortierung</title> + </entityField> + <entityField> + <name>TITLE</name> + <title>(Akademischer) Titel</title> + </entityField> + <entityConsumer> + <name>Languages</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>Language_entity</entityName> + <fieldName>LanguagesISO3Code</fieldName> + </dependency> + </entityConsumer> + <entityConsumer> + <name>KeywordGender</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>KeywordEntry_entity</entityName> + <fieldName>SpecificContainerKeywords</fieldName> + </dependency> + <children> + <entityParameter> + <name>containerName_param</name> + <code>%aditoprj%/entity/Salutation_entity/entityfields/keywordgender/children/containername_param/code.js</code> + </entityParameter> + </children> + </entityConsumer> + <entityProvider> + <name>Salutations</name> + <fieldType>DEPENDENCY_IN</fieldType> + <lookupIdfield>SALUTATION</lookupIdfield> + <titleProcess>%aditoprj%/entity/Salutation_entity/entityfields/salutations/titleProcess.js</titleProcess> + <recordContainer>db</recordContainer> + <dependencies> + <entityDependency> + <name>e3e73780-d3b2-4e31-8e09-6a778c5d63a2</name> + <entityName>Person_entity</entityName> + <fieldName>Salutations</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> + <children> + <entityParameter> + <name>Language_param</name> + <expose v="true" /> + </entityParameter> + </children> + </entityProvider> + <entityProvider> + <name>Titles</name> + <fieldType>DEPENDENCY_IN</fieldType> + <lookupIdfield>TITLE</lookupIdfield> + <titleProcess>%aditoprj%/entity/Salutation_entity/entityfields/titles/titleProcess.js</titleProcess> + <recordContainer>db</recordContainer> + <dependencies> + <entityDependency> + <name>b6dff8b9-1eda-4cb1-97a0-2852756295b7</name> + <entityName>Person_entity</entityName> + <fieldName>SalutationTitles</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> + </entityProvider> + <entityParameter> + <name>Language_param</name> + <expose v="true" /> + <triggerRecalculation v="true" /> + <description>PARAMETER</description> + </entityParameter> + </entityFields> + <recordContainers> + <dbRecordContainer> + <name>db</name> + <alias>Data_alias</alias> + <conditionProcess>%aditoprj%/entity/Salutation_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <linkInformation> + <linkInformation> + <name>6543f63c-3486-4e8b-bfc8-51b5088ce0b6</name> + <tableName>SALUTATION</tableName> + <primaryKey>SALUTATIONID</primaryKey> + <isUIDTable v="true" /> + <readonly v="false" /> + </linkInformation> + </linkInformation> + <recordFieldMappings> + <dbRecordFieldMapping> + <name>HEADLINE.value</name> + <recordfield>SALUTATION.HEADLINE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>LANGUAGE_SALUTATION.value</name> + <recordfield>SALUTATION.LANGUAGE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>LETTERSALUTATION.value</name> + <recordfield>SALUTATION.LETTERSALUTATION</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>SALUTATION.value</name> + <recordfield>SALUTATION.SALUTATION</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>SALUTATIONID.value</name> + <recordfield>SALUTATION.SALUTATIONID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>SEX.value</name> + <recordfield>SALUTATION.SEX</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>SORT.value</name> + <recordfield>SALUTATION.SORT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TITLE.value</name> + <recordfield>SALUTATION.TITLE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>LANGUAGE_SALUTATION.displayValue</name> + <expression>%aditoprj%/entity/Salutation_entity/recordcontainers/db/recordfieldmappings/language_salutation.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>SEX.displayValue</name> + <expression>%aditoprj%/entity/Salutation_entity/recordcontainers/db/recordfieldmappings/sex.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + </recordFieldMappings> + </dbRecordContainer> + </recordContainers> +</entity> diff --git a/entity/Salutation_entity/entityfields/salutations/titleProcess.js b/entity/Salutation_entity/entityfields/salutations/titleProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f098580b1e736016c19e4d5cc776a552e24b55d4 --- /dev/null +++ b/entity/Salutation_entity/entityfields/salutations/titleProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.SALUTATION")); \ No newline at end of file diff --git a/entity/Salutation_entity/entityfields/titles/titleProcess.js b/entity/Salutation_entity/entityfields/titles/titleProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..94f61859cc64100bb6a6dcd445efc67835002c1a --- /dev/null +++ b/entity/Salutation_entity/entityfields/titles/titleProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.TITLE")); \ No newline at end of file diff --git a/entity/Salutation_entity/recordcontainers/db/conditionProcess.js b/entity/Salutation_entity/recordcontainers/db/conditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b0005fe530d33e526a5c380946faab3706be7d6b --- /dev/null +++ b/entity/Salutation_entity/recordcontainers/db/conditionProcess.js @@ -0,0 +1,8 @@ +import("system.db"); +import("system.result"); +import("Sql_lib"); + +var cond = SqlCondition.begin().andPrepareVars("SALUTATION.LANGUAGE", "$param.Language_param"); + +//TODO: use a preparedCondition when available #1030812 #1034026 +result.string(db.translateCondition(cond.build("1 = 1"))); \ No newline at end of file