Skip to content
Snippets Groups Projects
Commit 792bdf6a authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

umbau: salutation und title mit consumer/provider

parent fbe16922
No related branches found
No related tags found
No related merge requests found
Showing
with 249 additions and 185 deletions
......@@ -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>
......
......@@ -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>
......
import("system.neon");
neon.setFieldValue("$field.SALUTATION", "");
\ No newline at end of file
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
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
import("system.vars");
import("system.result");
result.string(vars.get("$field.LANGUAGE"))
\ No newline at end of file
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
<?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>
import("system.vars");
import("system.result");
result.string(vars.get("$field.SALUTATION"));
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.TITLE"));
\ No newline at end of file
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
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