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 @@ ...@@ -59,12 +59,6 @@
<fieldName>AttributeChildren</fieldName> <fieldName>AttributeChildren</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency>
<name>ba8046ba-f58c-48f1-9c35-fe897247534a</name>
<entityName>Person_entity</entityName>
<fieldName>Attributes</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies> </dependencies>
<children> <children>
<entityParameter> <entityParameter>
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
<name>LASTNAME</name> <name>LASTNAME</name>
<title>Lastname</title> <title>Lastname</title>
<mandatory v="true" /> <mandatory v="true" />
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/lastname/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>MIDDLENAME</name> <name>MIDDLENAME</name>
...@@ -49,19 +48,12 @@ ...@@ -49,19 +48,12 @@
<entityField> <entityField>
<name>SALUTATION</name> <name>SALUTATION</name>
<title>Salutation</title> <title>Salutation</title>
<possibleItemsProcess>%aditoprj%/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js</possibleItemsProcess> <consumer>Salutations</consumer>
<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>
</entityField> </entityField>
<entityField> <entityField>
<name>TITLE</name> <name>TITLE</name>
<title>Title</title> <title>Title</title>
<possibleItemsProcess>%aditoprj%/entity/Person_entity/entityfields/title/possibleItemsProcess.js</possibleItemsProcess> <consumer>SalutationTitles</consumer>
</entityField> </entityField>
<entityField> <entityField>
<name>TITLESUFFIX</name> <name>TITLESUFFIX</name>
...@@ -297,6 +289,12 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact ...@@ -297,6 +289,12 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
<consumer>Languages</consumer> <consumer>Languages</consumer>
<mandatory v="true" /> <mandatory v="true" />
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/language/valueProcess.js</valueProcess> <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> </entityField>
<entityConsumer> <entityConsumer>
<name>Documents</name> <name>Documents</name>
...@@ -540,6 +538,53 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact ...@@ -540,6 +538,53 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
</entityParameter> </entityParameter>
</children> </children>
</entityConsumer> </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> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <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"?> <?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"> <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> <name>Salutation_entity</name>
<title>Anrede</title> <title>Anrede</title>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<recordContainer>db</recordContainer> <recordContainer>db</recordContainer>
<entityFields> <entityFields>
<entityProvider> <entityProvider>
<name>#PROVIDER</name> <name>#PROVIDER</name>
<recordContainer>db</recordContainer> <recordContainer>db</recordContainer>
</entityProvider> </entityProvider>
<entityField> <entityField>
<name>SALUTATIONID</name> <name>SALUTATIONID</name>
<valueProcess>%aditoprj%/entity/Salutation_entity/entityfields/salutationid/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Salutation_entity/entityfields/salutationid/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>HEADLINE</name> <name>HEADLINE</name>
<title>Anrede im Briefkopf</title> <title>Anrede im Briefkopf</title>
</entityField> </entityField>
<entityField> <entityField>
<name>LANGUAGE_SALUTATION</name> <name>LANGUAGE_SALUTATION</name>
<title>Sprache</title> <title>Sprache</title>
<consumer>Languages</consumer> <consumer>Languages</consumer>
</entityField> </entityField>
<entityField> <entityField>
<name>LETTERSALUTATION</name> <name>LETTERSALUTATION</name>
<title>Briefanrede</title> <title>Briefanrede</title>
</entityField> </entityField>
<entityField> <entityField>
<name>SALUTATION</name> <name>SALUTATION</name>
<title>Anrede</title> <title>Anrede</title>
</entityField> </entityField>
<entityField> <entityField>
<name>SEX</name> <name>SEX</name>
<title>Geschlecht</title> <title>Geschlecht</title>
<consumer>KeywordGender</consumer> <consumer>KeywordGender</consumer>
</entityField> </entityField>
<entityField> <entityField>
<name>SORT</name> <name>SORT</name>
<title>Sortierung</title> <title>Sortierung</title>
</entityField> </entityField>
<entityField> <entityField>
<name>TITLE</name> <name>TITLE</name>
<title>(Akademischer) Titel</title> <title>(Akademischer) Titel</title>
</entityField> </entityField>
<entityConsumer> <entityConsumer>
<name>Languages</name> <name>Languages</name>
<fieldType>DEPENDENCY_OUT</fieldType> <fieldType>DEPENDENCY_OUT</fieldType>
<dependency> <dependency>
<name>dependency</name> <name>dependency</name>
<entityName>Language_entity</entityName> <entityName>Language_entity</entityName>
<fieldName>LanguagesISO3Code</fieldName> <fieldName>LanguagesISO3Code</fieldName>
</dependency> </dependency>
</entityConsumer> </entityConsumer>
<entityConsumer> <entityConsumer>
<name>KeywordGender</name> <name>KeywordGender</name>
<fieldType>DEPENDENCY_OUT</fieldType> <fieldType>DEPENDENCY_OUT</fieldType>
<dependency> <dependency>
<name>dependency</name> <name>dependency</name>
<entityName>KeywordEntry_entity</entityName> <entityName>KeywordEntry_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName> <fieldName>SpecificContainerKeywords</fieldName>
</dependency> </dependency>
<children> <children>
<entityParameter> <entityParameter>
<name>containerName_param</name> <name>containerName_param</name>
<code>%aditoprj%/entity/Salutation_entity/entityfields/keywordgender/children/containername_param/code.js</code> <code>%aditoprj%/entity/Salutation_entity/entityfields/keywordgender/children/containername_param/code.js</code>
</entityParameter> </entityParameter>
</children> </children>
</entityConsumer> </entityConsumer>
</entityFields> <entityProvider>
<recordContainers> <name>Salutations</name>
<dbRecordContainer> <fieldType>DEPENDENCY_IN</fieldType>
<name>db</name> <lookupIdfield>SALUTATION</lookupIdfield>
<alias>Data_alias</alias> <titleProcess>%aditoprj%/entity/Salutation_entity/entityfields/salutations/titleProcess.js</titleProcess>
<linkInformation> <recordContainer>db</recordContainer>
<linkInformation> <dependencies>
<name>6543f63c-3486-4e8b-bfc8-51b5088ce0b6</name> <entityDependency>
<tableName>SALUTATION</tableName> <name>e3e73780-d3b2-4e31-8e09-6a778c5d63a2</name>
<primaryKey>SALUTATIONID</primaryKey> <entityName>Person_entity</entityName>
<isUIDTable v="true" /> <fieldName>Salutations</fieldName>
<readonly v="false" /> <isConsumer v="false" />
</linkInformation> </entityDependency>
</linkInformation> </dependencies>
<recordFieldMappings> <children>
<dbRecordFieldMapping> <entityParameter>
<name>HEADLINE.value</name> <name>Language_param</name>
<recordfield>SALUTATION.HEADLINE</recordfield> <expose v="true" />
</dbRecordFieldMapping> </entityParameter>
<dbRecordFieldMapping> </children>
<name>LANGUAGE_SALUTATION.value</name> </entityProvider>
<recordfield>SALUTATION.LANGUAGE</recordfield> <entityProvider>
</dbRecordFieldMapping> <name>Titles</name>
<dbRecordFieldMapping> <fieldType>DEPENDENCY_IN</fieldType>
<name>LETTERSALUTATION.value</name> <lookupIdfield>TITLE</lookupIdfield>
<recordfield>SALUTATION.LETTERSALUTATION</recordfield> <titleProcess>%aditoprj%/entity/Salutation_entity/entityfields/titles/titleProcess.js</titleProcess>
</dbRecordFieldMapping> <recordContainer>db</recordContainer>
<dbRecordFieldMapping> <dependencies>
<name>SALUTATION.value</name> <entityDependency>
<recordfield>SALUTATION.SALUTATION</recordfield> <name>b6dff8b9-1eda-4cb1-97a0-2852756295b7</name>
</dbRecordFieldMapping> <entityName>Person_entity</entityName>
<dbRecordFieldMapping> <fieldName>SalutationTitles</fieldName>
<name>SALUTATIONID.value</name> <isConsumer v="false" />
<recordfield>SALUTATION.SALUTATIONID</recordfield> </entityDependency>
</dbRecordFieldMapping> </dependencies>
<dbRecordFieldMapping> </entityProvider>
<name>SEX.value</name> <entityParameter>
<recordfield>SALUTATION.SEX</recordfield> <name>Language_param</name>
</dbRecordFieldMapping> <expose v="true" />
<dbRecordFieldMapping> <triggerRecalculation v="true" />
<name>SORT.value</name> <description>PARAMETER</description>
<recordfield>SALUTATION.SORT</recordfield> </entityParameter>
</dbRecordFieldMapping> </entityFields>
<dbRecordFieldMapping> <recordContainers>
<name>TITLE.value</name> <dbRecordContainer>
<recordfield>SALUTATION.TITLE</recordfield> <name>db</name>
</dbRecordFieldMapping> <alias>Data_alias</alias>
<dbRecordFieldMapping> <conditionProcess>%aditoprj%/entity/Salutation_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<name>LANGUAGE_SALUTATION.displayValue</name> <linkInformation>
<expression>%aditoprj%/entity/Salutation_entity/recordcontainers/db/recordfieldmappings/language_salutation.displayvalue/expression.js</expression> <linkInformation>
</dbRecordFieldMapping> <name>6543f63c-3486-4e8b-bfc8-51b5088ce0b6</name>
<dbRecordFieldMapping> <tableName>SALUTATION</tableName>
<name>SEX.displayValue</name> <primaryKey>SALUTATIONID</primaryKey>
<expression>%aditoprj%/entity/Salutation_entity/recordcontainers/db/recordfieldmappings/sex.displayvalue/expression.js</expression> <isUIDTable v="true" />
</dbRecordFieldMapping> <readonly v="false" />
</recordFieldMappings> </linkInformation>
</dbRecordContainer> </linkInformation>
</recordContainers> <recordFieldMappings>
</entity> <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