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

Merge branch 'master' of gitlab.adito.de:xrm/basic

parents 21e9dbb3 55e419ea
No related branches found
No related tags found
No related merge requests found
Showing
with 541 additions and 6 deletions
......@@ -266,8 +266,8 @@
<name>STATUS</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="4" />
<size v="10" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
......@@ -5738,6 +5738,193 @@
</entityFieldDb>
</entityFields>
</entityDb>
<entityDb>
<name>AB_KEYWORD_ENTRY</name>
<dbName></dbName>
<idColumn>AB_KEYWORD_ENTRYID</idColumn>
<idGeneratorType v="0" />
<idGeneratorInterval v="1" />
<title></title>
<description></description>
<auditSyncConfig>
<name>auditSyncConfig</name>
<auditMode v="0" />
<syncActive v="false" />
<syncComplete v="true" />
<syncDirection v="1" />
<syncIds></syncIds>
</auditSyncConfig>
<entityFields>
<entityFieldDb>
<name>ISESSENTIAL</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="5" />
<size v="5" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>AB_KEYWORD_CONTAINER_ID</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>DATE_EDIT</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="29" />
<scale v="9" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>CONTAINER</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="80" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>SORTING</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="4" />
<size v="10" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>TITLE</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="100" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>DATE_NEW</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="29" />
<scale v="9" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>KEYID</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>USER_NEW</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="50" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>ISACTIVE</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="5" />
<size v="5" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>AB_KEYWORD_ENTRYID</name>
<dbName></dbName>
<primaryKey v="true" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="true" />
<isUnique v="true" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>USER_EDIT</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="50" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
</entityFields>
</entityDb>
</entities>
</entityGroup>
</aliasDefDb>
......
......@@ -26,8 +26,8 @@
<node name="INTERNAL_ADMINISTRATOR" kind="159" />
</node>
</node>
<node name="Administration" kind="123" title="Administration">
<icon>NEON:WRENCH</icon>
<node name="ADMINISTRATION" kind="123" title="Administration">
<icon>VAADIN:CONTROLLER</icon>
<node name="Group3" kind="123" title="">
<node name="Attribute_context" kind="10077" />
<node name="INTERNAL_ADMINISTRATOR" kind="159" />
......
......@@ -11,7 +11,7 @@
<entityField>
<name>DIRECTION</name>
<title>Direction</title>
<possibleItemsProcess>%aditoprj%/entity/Activity_entity/entityfields/direction/possibleItemsProcess.js</possibleItemsProcess>
<outgoingField>Directions</outgoingField>
<groupable v="true" />
</entityField>
<entityField>
......@@ -264,6 +264,21 @@
</entityParameter>
</children>
</entityOutgoingField>
<entityOutgoingField>
<name>Directions</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Keyword_entity</entityName>
<fieldName>generic_dfi</fieldName>
</dependency>
<children>
<entityParameter>
<name>containerName_param</name>
<code>%aditoprj%/entity/Activity_entity/entityfields/directions/children/containername_param/code.js</code>
</entityParameter>
</children>
</entityOutgoingField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......@@ -315,6 +330,10 @@
<name>CATEGORY.value</name>
<recordfield>ACTIVITY.CATEGORY</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DIRECTION.displayValue</name>
<expression>%aditoprj%/entity/Activity_entity/recordcontainers/db/recordfieldmappings/direction.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
......
import("system.result");
result.string("ActivityDirection");
\ No newline at end of file
import("system.result");
import("Keyword_lib");
var items;
items = KeywordUtils.getStandardArray("RELATION.STATUS");
result.object(items);
\ No newline at end of file
var sql = KeywordUtils.getResolvedTitleSqlPart("ActivityDirection", "ACTIVITY.DIRECTION");
result.string(sql);
<?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.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.1.1">
<name>Keyword_entity</name>
<title>Keyword</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/Keyword_entity/documentation.adoc</documentation>
<iconId>VAADIN:KEY</iconId>
<titleProcess>%aditoprj%/entity/Keyword_entity/titleProcess.js</titleProcess>
<recordContainer>db</recordContainer>
<entityFields>
<entityIncomingField>
<name>#INCOMING</name>
<lookupIdfield>KEYID</lookupIdfield>
<recordContainer>db</recordContainer>
</entityIncomingField>
<entityField>
<name>CONTAINER</name>
<title>Container</title>
<groupable v="true" />
</entityField>
<entityField>
<name>AB_KEYWORD_ENTRYID</name>
<valueProcess>%aditoprj%/entity/Keyword_entity/entityfields/ab_keyword_entryid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>USER_NEW</name>
<valueProcess>%aditoprj%/entity/Keyword_entity/entityfields/user_new/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>USER_EDIT</name>
<valueProcess>%aditoprj%/entity/Keyword_entity/entityfields/user_edit/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>DATE_EDIT</name>
<valueProcess>%aditoprj%/entity/Keyword_entity/entityfields/date_edit/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>DATE_NEW</name>
<valueProcess>%aditoprj%/entity/Keyword_entity/entityfields/date_new/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>KEYID</name>
<title>Key</title>
</entityField>
<entityField>
<name>TITLE</name>
<title>Title (original language)</title>
</entityField>
<entityField>
<name>SORTING</name>
<title>Sorting</title>
</entityField>
<entityField>
<name>ISACTIVE</name>
<title>Active</title>
<contentType>BOOLEAN</contentType>
<possibleItemsProcess>%aditoprj%/entity/Keyword_entity/entityfields/isactive/possibleItemsProcess.js</possibleItemsProcess>
</entityField>
<entityField>
<name>ISESSENTIAL</name>
<title>Essential</title>
<contentType>BOOLEAN</contentType>
<possibleItemsProcess>%aditoprj%/entity/Keyword_entity/entityfields/isessential/possibleItemsProcess.js</possibleItemsProcess>
</entityField>
<entityParameter>
<name>containerName_param</name>
<expose v="true" />
<documentation>%aditoprj%/entity/Keyword_entity/entityfields/containername_param/documentation.adoc</documentation>
</entityParameter>
<entityIncomingField>
<name>generic_dfi</name>
<fieldType>DEPENDENCY_IN</fieldType>
<lookupIdfield>KEYID</lookupIdfield>
<recordContainer>db</recordContainer>
<dependencies>
<entityDependency>
<name>bb48a3ee-f340-4fd4-8c80-ef73b765ab58</name>
<entityName>Org_entity</entityName>
<fieldName>RelationStates</fieldName>
<isOutgoing v="false" />
</entityDependency>
<entityDependency>
<name>4b1d1def-36d3-45e9-9ed5-eaef12d1ec82</name>
<entityName>Activity_entity</entityName>
<fieldName>Directions</fieldName>
<isOutgoing v="false" />
</entityDependency>
</dependencies>
</entityIncomingField>
<entityField>
<name>TITLE_TRANSLATED</name>
<valueProcess>%aditoprj%/entity/Keyword_entity/entityfields/title_translated/valueProcess.js</valueProcess>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/Keyword_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<linkInformation>
<linkInformation>
<name>52acbfe0-57f4-4614-83af-9882e168f431</name>
<tableName>AB_KEYWORD_ENTRY</tableName>
<primaryKey>AB_KEYWORD_ENTRYID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
</linkInformation>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>USER_NEW.value</name>
<recordfield>AB_KEYWORD_ENTRY.USER_NEW</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_EDIT.value</name>
<recordfield>AB_KEYWORD_ENTRY.USER_EDIT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>TITLE.value</name>
<recordfield>AB_KEYWORD_ENTRY.TITLE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>SORTING.value</name>
<recordfield>AB_KEYWORD_ENTRY.SORTING</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ISESSENTIAL.value</name>
<recordfield>AB_KEYWORD_ENTRY.ISESSENTIAL</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ISACTIVE.value</name>
<recordfield>AB_KEYWORD_ENTRY.ISACTIVE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_NEW.value</name>
<recordfield>AB_KEYWORD_ENTRY.DATE_NEW</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_EDIT.value</name>
<recordfield>AB_KEYWORD_ENTRY.DATE_EDIT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>AB_KEYWORD_ENTRYID.value</name>
<recordfield>AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>KEYID.value</name>
<recordfield>AB_KEYWORD_ENTRY.KEYID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CONTAINER.value</name>
<recordfield>AB_KEYWORD_ENTRY.CONTAINER</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
</entity>
Keyword
=======
Simply said: A keyword is a list of key-value pairs.
These values for example can be used as content to choose from (e.g. a combobox-list).
[glossary]
Glossary
--------
[glossary]
Keyword Container::
A keyword container is the element that keeps several entries of Keywords together. That could be for example something like "Contact-Status".
Keyword Entry::
A keyword entry is a specific child-element of a keyword container. For the upper example "Contact-Status" this could be "Active", "Inactive", etc.
Keyword::
Keyword describes the whole set of elements like keyword container and keyword entry. It's more like a virtual bracket for the whole construct.
== Structure ==
.abstract structure of keywords
["graphviz", subs="attributes+"]
----
digraph g {
rankdir="BT"
bgcolor="#222222"
graph [ dpi = 100 ]
node [ shape = box color="#dddddd" fontcolor="#dddddd" fontname = "Consolas"];
edge [ color="#dddddd" ]
{ rank=max; kwdContainer [label="Keyword Container"] }
{ rank=same; kwdEntry [label="Keyword Entry"] }
{ rank=next; entry1 [label="Entry 1" shape=ellipse] }
{ rank=same entry1; entryN [label="Entry N" shape=ellipse] }
kwdEntry -> kwdContainer;
kwdEntry -> kwdContainer;
entry1 -> kwdEntry
entryN -> kwdEntry
}
----
Take a look at the following table. Beware that these are not the acutal db-column-names but the information what's represented.
.simplified, abstract representation how keywords are acutllay stored
[options="header", cols="m,m,d,d"]
|=======
|UID |key-ID |tile | category
|{set:cellbgcolor:#90b678}
unique key 1|1-key-value A|one|category 1
|unique key 2|2-key-value A|two|category 1
|unique key 3|3-key-value A|three|category 1
|{set:cellbgcolor:#b69e78 }
unique key 4|1-key-value B|I|category 2
|unique key 5|2-key-value B|II|category 2
|=======
And, to clarify an example:
.simplified, example representation how keywords are acutllay stored
[options="header", cols="m,m,d,d"]
|=======
|{set:cellbgcolor:! }
UID |key-ID |tile | category
|{set:cellbgcolor:#90b678}db1792cd|de-DE|German (Germany)|Language
|62df7f0ba|en-GB|English (United Kingdom)|Language
|126229d9|fr-FR|French (France)|Language
|{set:cellbgcolor:#b69e78 }3508929f|ab7b1885|active|ContactStatus
|52ce5785|2b2091eb|inactive|ContactStatus
|=======
import("system.util");
import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(util.getNewUUID());
\ No newline at end of file
This param is used for filtering for a KeywordContainerName.
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT)
result.string(vars.getString("$sys.date"));
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(vars.getString("$sys.date"));
\ No newline at end of file
import("system.translate");
import("system.result");
result.object([
["1", translate.text("Yes")]
,["0", translate.text("No")]
]);
\ No newline at end of file
import("system.translate");
import("system.result");
result.object([
["1", translate.text("Yes")]
,["0", translate.text("No")]
]);
\ No newline at end of file
import("system.vars");
import("system.translate");
import("system.result");
var title = vars.get("$field.TITLE");
result.string(translate.text(title));
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT)
result.string(vars.getString("$sys.user"));
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(vars.getString("$sys.user"));
\ No newline at end of file
import("system.db");
import("system.result");
import("Sql_lib");
var cond = SqlCondition.begin().andPrepareVars("AB_KEYWORD_ENTRY.CONTAINER", "$param.containerName_param");
if (!cond.isSet())
throw new Error("keyword containerName has to be set");//at the moment throw an error since there is no list of "all keywords"
var condStr = db.translateCondition(cond.build());
result.string(condStr);
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.TITLE_TRANSLATED"));
\ No newline at end of file
......@@ -93,7 +93,7 @@
<name>STATUS</name>
<title>Status</title>
<contentType>TEXT</contentType>
<possibleItemsProcess>%aditoprj%/entity/Org_entity/entityfields/status/possibleItemsProcess.js</possibleItemsProcess>
<outgoingField>RelationStates</outgoingField>
<searchable v="false" />
</entityField>
<entityField>
......@@ -510,6 +510,21 @@
</entityParameter>
</children>
</entityOutgoingField>
<entityOutgoingField>
<name>RelationStates</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Keyword_entity</entityName>
<fieldName>generic_dfi</fieldName>
</dependency>
<children>
<entityParameter>
<name>containerName_param</name>
<code>%aditoprj%/entity/Org_entity/entityfields/relationstates/children/containername_param/code.js</code>
</entityParameter>
</children>
</entityOutgoingField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......@@ -629,6 +644,10 @@
<recordfield></recordfield>
<expression>%aditoprj%/entity/Org_entity/recordcontainers/db/recordfieldmappings/standard_phone_comm.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>STATUS.displayValue</name>
<expression>%aditoprj%/entity/Org_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
......
import("system.result");
result.string("RelationStatus");
\ 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