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 12 additions and 187 deletions
import("system.result");
result.string("salutation")
\ No newline at end of file
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
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
import("system.result");
import("Keyword_lib");
var sql = LanguageKeywordUtils.getResolvedTitleSqlPart("SALUTATION.LANGUAGE");
result.string(sql);
\ No newline at end of file
import("system.result");
import("Keyword_lib");
var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.get.PersonGender, "SALUTATION.SEX");
result.string(sql);
import("system.logging");
import("system.vars");
import("system.result");
import("system.db");
import("Sql_lib");
logging.log("salutation")
var cond = SqlCondition.begin()
.and("SALUTATION is not NULL")
.andPrepareVars("SALUTATION.LANGUAGE", "$param.Language_param")
.buildSql("select distinct SALUTATION from SALUTATION", "1=2");
var salutations = db.table(cond);
result.object(salutations);
\ No newline at end of file
import("system.logging");
import("system.vars");
import("system.result");
import("system.db");
import("Sql_lib");
logging.log("title")
var cond = SqlCondition.begin()
.and("TITLE is not NULL")
.andPrepareVars("SALUTATION.SALUTATION", "$param.Salutation_param")
.buildSql("select TITLE from SALUTATION", "1=2");
var titles = db.table(cond);
result.object(titles);
\ No newline at end of file
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
<?xml version="1.0" encoding="UTF-8"?>
<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.0.0">
<name>Salutation</name>
<title>Anrede</title>
<name>SalutationDistinct</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<filterview>SalutationFilter_view</filterview>
<editview>SalutationEdit_view</editview>
<entity>Salutation_entity</entity>
<references>
<neonViewReference>
<name>e1ddbe88-af31-4860-9b9e-447282060ec2</name>
<view>SalutationFilter_view</view>
</neonViewReference>
<neonViewReference>
<name>2663038a-4f51-4152-bbb2-2c8aa552deee</name>
<view>SalutationEdit_view</view>
</neonViewReference>
<neonViewReference>
<name>3bb3eb80-414e-4d1b-aec1-94b0fddb4a29</name>
<view>SalutationLookup_view</view>
</neonViewReference>
</references>
<entity>SalutationDistinct_entity</entity>
</neonContext>
<?xml version="1.0" encoding="UTF-8"?>
<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.0.0">
<name>SalutationTitleDistinct</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<entity>SalutationTitleDistinct_entity</entity>
</neonContext>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.0.1">
<name>SalutationEdit_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<genericViewTemplate>
<name>Generic</name>
<editMode v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>3414fd26-d0bf-42e0-b7c7-7ca505e2c70d</name>
<entityField>LANGUAGE_SALUTATION</entityField>
</entityFieldLink>
<entityFieldLink>
<name>b56a3b42-346e-48f2-88f0-0e3c5f4b76fe</name>
<entityField>SALUTATION</entityField>
</entityFieldLink>
<entityFieldLink>
<name>39b0ef67-57f9-40ac-b759-e32c70f16ce0</name>
<entityField>TITLE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>7a6e5f1b-12c8-4d50-ad2f-bfd35fc94d5f</name>
<entityField>HEADLINE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>83feed8a-aca8-4c2a-bac3-fa3d5f9d21b0</name>
<entityField>LETTERSALUTATION</entityField>
</entityFieldLink>
<entityFieldLink>
<name>3179d4c2-98dd-4edf-8bfb-462935bd8d50</name>
<entityField>SEX</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.0.1">
<name>SalutationFilter_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<filterable v="true" />
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<tableViewTemplate>
<name>Table</name>
<entityField>#ENTITY</entityField>
<columns>
<neonTableColumn>
<name>b4108c6a-173d-4692-b9dc-a0c02de7d373</name>
<entityField>LANGUAGE_SALUTATION</entityField>
<width v="75" />
<expandRatio v="100" />
</neonTableColumn>
<neonTableColumn>
<name>cd9277bb-e254-41d2-bbfa-5d328e348405</name>
<entityField>SALUTATION</entityField>
<width v="75" />
</neonTableColumn>
<neonTableColumn>
<name>229e8fa9-e4c3-4cab-b692-6695c4bff4aa</name>
<entityField>TITLE</entityField>
<width v="75" />
</neonTableColumn>
<neonTableColumn>
<name>dd21b360-22e4-448b-906d-059bc6c4033f</name>
<entityField>HEADLINE</entityField>
<width v="75" />
</neonTableColumn>
<neonTableColumn>
<name>5aa35e22-4ca3-4a65-a9de-44bd209248e8</name>
<entityField>LETTERSALUTATION</entityField>
<width v="75" />
</neonTableColumn>
<neonTableColumn>
<name>68809674-e641-4965-8977-20f6b3e1002a</name>
<entityField>SEX</entityField>
<width v="75" />
</neonTableColumn>
</columns>
</tableViewTemplate>
</children>
</neonView>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.0.1">
<name>SalutationLookup_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<tableViewTemplate>
<name>Table</name>
<entityField>#ENTITY</entityField>
<columns>
<neonTableColumn>
<name>fbf20ad5-75b0-4c5c-8fbf-a2c0369f2adc</name>
<entityField>UID</entityField>
</neonTableColumn>
</columns>
</tableViewTemplate>
</children>
</neonView>
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