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

use distinct entities

parent e27d53c0
No related branches found
No related tags found
No related merge requests found
Showing
with 162 additions and 310 deletions
......@@ -246,12 +246,6 @@
<fieldName>KeywordProbabilties</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>6e9de468-5c32-4a73-bcf9-988a9f9e943c</name>
<entityName>Salutation_entity</entityName>
<fieldName>KeywordGender</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>a44375e9-917c-4db8-9aa8-de0625caf78f</name>
<entityName>Activity_entity</entityName>
......
......@@ -62,12 +62,6 @@
<fieldName>Languages</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>6b4c3907-9174-4a88-8f30-97b7702e4393</name>
<entityName>Salutation_entity</entityName>
<fieldName>Languages</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
</entityProvider>
</entityFields>
......
......@@ -51,6 +51,12 @@
<title>Salutation</title>
<consumer>Salutations</consumer>
<displayValueProcess>%aditoprj%/entity/Person_entity/entityfields/salutation/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/Person_entity/entityfields/salutation/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
<element>RECORD</element>
</onValueChangeTypes>
</entityField>
<entityField>
<name>TITLE</name>
......@@ -522,7 +528,7 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
<dependency>
<name>dependency</name>
<entityName>Language_entity</entityName>
<fieldName>LanguagesISO3Code</fieldName>
<fieldName>ISO3Name</fieldName>
</dependency>
</entityConsumer>
<entityConsumer>
......@@ -546,7 +552,7 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Salutation_entity</entityName>
<entityName>SalutationDistinct_entity</entityName>
<fieldName>Salutations</fieldName>
</dependency>
<children>
......@@ -555,10 +561,6 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/salutations/children/language_param/valueProcess.js</valueProcess>
<triggerRecalculation v="true" />
</entityParameter>
<entityParameter>
<name>uIdDefinition_param</name>
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/salutations/children/uiddefinition_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
......@@ -589,14 +591,10 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Salutation_entity</entityName>
<fieldName>Titles</fieldName>
<entityName>SalutationTitleDistinct_entity</entityName>
<fieldName>SalutationTitles</fieldName>
</dependency>
<children>
<entityParameter>
<name>uIdDefinition_param</name>
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/salutationtitles/children/uiddefinition_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>Salutation_param</name>
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/salutationtitles/children/salutation_param/valueProcess.js</valueProcess>
......
import("system.logging");
import("system.vars");
import("Keyword_lib");
import("system.result");
import("system.db");
import("system.vars");
import("system.neon");
import("Sql_lib");
var cond = SqlCondition.begin()
var sex = db.cell(cond.andPrepareVars("SALUTATION.SALUTATION", "$field.SALUTATION").buildSql("select SEX from SALUTATION", "1=2"))
if (sex)
{
var keyword = KeywordUtils.getViewValue("PersonGender", sex);
result.string(keyword)
import("system.vars");
import("Keyword_lib");
import("system.result");
import("system.db");
import("system.vars");
import("system.neon");
import("Sql_lib");
var cond = SqlCondition.begin()
var sex = db.cell(cond.andPrepareVars("SALUTATION.SALUTATION", "$field.SALUTATION").buildSql("select SEX from SALUTATION", "1=2"))
if (sex)
{
var keyword = KeywordUtils.getViewValue("PersonGender", sex);
result.string(keyword)
}
\ No newline at end of file
......@@ -2,12 +2,10 @@ import("system.db");
import("system.vars");
import("system.neon");
var language = vars.get("$field.LANGUAGE");
var salutation = vars.get("$field.SALUTATION")
var salLanguage = db.cell("select LANGUAGE from SALUTATION where SALUTATION = '" + salutation + "'")
if((vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT)
&& salLanguage != language)
if((vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT))
{
neon.setFieldValue("$field.SALUTATION", "");
neon.setFieldValue("$field.TITLE", "");
neon.refresh(["$field.SALUTATION", "$field.TITLE"]);
}
\ No newline at end of file
import("system.logging");
import("system.neon");
import("system.vars");
import("system.db");
import("system.result");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.LANGUAGE") == "")
import("system.neon");
import("system.vars");
import("system.db");
import("system.result");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.LANGUAGE") == "")
result.string("deu");
\ No newline at end of file
import("system.logging");
import("system.result");
logging.log("set")
result.string("1");
\ No newline at end of file
import("system.vars");
import("system.neon");
if((vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT))
{
neon.setFieldValue("$field.TITLE", "");
neon.refresh(["$field.TITLE"]);
}
\ No newline at end of file
import("system.logging");
import("system.vars");
import("system.result");
......
import("system.result");
result.string("SALUTATION");
\ No newline at end of file
import("system.result");
result.string("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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.2.1">
<name>SalutationDistinct_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<titleProcess>%aditoprj%/entity/SalutationDistinct_entity/titleProcess.js</titleProcess>
<recordContainer>jdito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityField>
<name>UID</name>
</entityField>
<entityProvider>
<name>Salutations</name>
<fieldType>DEPENDENCY_IN</fieldType>
<children>
<entityParameter>
<name>Language_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>Language_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
<name>jdito</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/SalutationDistinct_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<recordFields>
<element>UID.value</element>
</recordFields>
</jDitoRecordContainer>
</recordContainers>
</entity>
import("system.vars");
import("system.result");
import("system.db");
import("Sql_lib");
result.object(db.table(SqlCondition.begin()
.and("SALUTATION is not NULL")
.andPrepareVars("SALUTATION.LANGUAGE", "$param.Language_param")
.buildSql("select distinct SALUTATION from SALUTATION", "1=2")));
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.TITLE"));
\ No newline at end of file
result.string(vars.get("$field.UID"));
\ 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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.2.1">
<name>SalutationTitleDistinct_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<titleProcess>%aditoprj%/entity/SalutationTitleDistinct_entity/titleProcess.js</titleProcess>
<recordContainer>jdito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityField>
<name>UID</name>
</entityField>
<entityParameter>
<name>Salutation_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityProvider>
<name>SalutationTitles</name>
<fieldType>DEPENDENCY_IN</fieldType>
<children>
<entityParameter>
<name>Language_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
</entityParameter>
<entityParameter>
<name>Salutation_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>Language_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
<name>jdito</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/SalutationTitleDistinct_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<recordFields>
<element>UID.value</element>
</recordFields>
</jDitoRecordContainer>
</recordContainers>
</entity>
import("system.vars");
import("system.result");
import("system.db");
import("Sql_lib");
result.object(db.table(SqlCondition.begin()
.and("TITLE is not NULL")
.andPrepareVars("SALUTATION.SALUTATION", "$param.Salutation_param")
.andPrepareVars("SALUTATION.LANGUAGE", "$param.Language_param")
.buildSql("select distinct TITLE from SALUTATION", "1=2")));
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.SALUTATION"));
\ No newline at end of file
result.string(vars.get("$field.UID"));
\ 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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.2.1">
<name>Salutation_entity</name>
<title>Anrede</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<titleProcess>%aditoprj%/entity/Salutation_entity/titleProcess.js</titleProcess>
<recordContainer>db</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</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>
<valueProcess>%aditoprj%/entity/Salutation_entity/entityfields/keywordgender/children/containername_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityProvider>
<name>Salutations</name>
<fieldType>DEPENDENCY_IN</fieldType>
<lookupIdfield>UID</lookupIdfield>
<titleProcess>%aditoprj%/entity/Salutation_entity/entityfields/salutations/titleProcess.js</titleProcess>
<recordContainer>distinctSalutation_jdito</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" />
<triggerRecalculation v="true" />
</entityParameter>
<entityParameter>
<name>retval</name>
<valueProcess>%aditoprj%/entity/Salutation_entity/entityfields/salutations/children/retval/valueProcess.js</valueProcess>
<expose v="false" />
</entityParameter>
</children>
</entityProvider>
<entityProvider>
<name>Titles</name>
<fieldType>DEPENDENCY_IN</fieldType>
<lookupIdfield>UID</lookupIdfield>
<titleProcess>%aditoprj%/entity/Salutation_entity/entityfields/titles/titleProcess.js</titleProcess>
<recordContainer>title_jdito</recordContainer>
<dependencies>
<entityDependency>
<name>b6dff8b9-1eda-4cb1-97a0-2852756295b7</name>
<entityName>Person_entity</entityName>
<fieldName>SalutationTitles</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
<name>retval</name>
<expose v="false" />
</entityParameter>
</children>
</entityProvider>
<entityParameter>
<name>Language_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>UID</name>
<titleProcess>%aditoprj%/entity/Salutation_entity/entityfields/uid/titleProcess.js</titleProcess>
</entityField>
<entityParameter>
<name>uIdDefinition_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>Salutation_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>DISTINCT_RETVAL</name>
</entityField>
<entityParameter>
<name>retval</name>
<expose 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>
<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>
</recordFields>
</jDitoRecordContainer>
<jDitoRecordContainer>
<name>title_jdito</name>
<title>55</title>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/Salutation_entity/recordcontainers/title_jdito/contentProcess.js</contentProcess>
<isPageable v="false" />
<recordFields>
<element>UID.value</element>
</recordFields>
</jDitoRecordContainer>
<jDitoRecordContainer>
<name>distinctAny</name>
</jDitoRecordContainer>
</recordContainers>
</entity>
import("system.result");
result.string("PersonGender")
\ No newline at end of file
import("system.util");
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(util.getNewUUID());
\ 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