Skip to content
Snippets Groups Projects
Commit b62a325c authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1034159][Komplexe Keywords über Keywordattribute]

parent fdc44b89
No related branches found
No related tags found
No related merge requests found
Showing
with 296 additions and 11 deletions
......@@ -3887,8 +3887,8 @@
<name>ATTRIBUTE_TYPE</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="12" />
<size v="63" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="true" />
<isUnique v="false" />
......
......@@ -30,7 +30,8 @@
<icon>VAADIN:CONTROLLER</icon>
<node name="Group3" kind="123" title="">
<node name="Attribute_context" kind="10077" />
<node name="Keyword_context" kind="10077" />
<node name="KeywordEntry_context" kind="10077" />
<node name="KeywordAttribute_context" kind="10077" />
<node name="INTERNAL_ADMINISTRATOR" kind="159" />
</node>
</node>
......
import("system.result");
import("Keyword_lib");
var items = KeywordUtils.getStandardArray("ACTIVITY.CATEGORY");
var items = LegacyKeywordUtils.getStandardArray("ACTIVITY.CATEGORY");
result.object(items);
\ No newline at end of file
......@@ -4,7 +4,7 @@ import("system.neon");
import("Keyword_lib");
var category = vars.getString("$field.CATEGORY");
var kwd = KeywordUtils.createKeyword("ACTIVITY.CATEGORY");
var kwd = LegacyKeywordUtils.createKeyword("ACTIVITY.CATEGORY");
var icon = kwd.getPropForKey(category, "defaultAvatarRepresentation", true);
result.string(icon || "NEON:HISTORY");
......@@ -5,5 +5,5 @@ import("Keyword_lib");
var histMedium;
histMedium = vars.get("$field.CATEGORY");
if (histMedium){
result.string(vars.get("$field.SUBJECT") + " (" + KeywordUtils.getViewValue("ACTIVITY.CATEGORY", histMedium) + ")");
result.string(vars.get("$field.SUBJECT") + " (" + LegacyKeywordUtils.getViewValue("ACTIVITY.CATEGORY", histMedium) + ")");
}
\ No newline at end of file
......@@ -21,7 +21,7 @@ if (vars.exists("$param.ContactType_param") && parseInt(vars.get("$param.Contact
}
var resultKeywords = [];
KeywordUtils.getStandardArrayProps("ADDRESS.TYPE").forEach(function(pKeyword) {
LegacyKeywordUtils.getStandardArrayProps("ADDRESS.TYPE").forEach(function(pKeyword) {
for (let i = 0; i < fields.length; i++) {
if (pKeyword[2][fields[i]]) {
resultKeywords.push([pKeyword[0], pKeyword[1]]);
......
......@@ -7,7 +7,7 @@ var medium, contentType;
//TODO: add constants for contentTypes #1022547
medium = vars.get("$field.MEDIUM_ID");
if (medium){
contentType = KeywordUtils.createKeyword("COMMUNICATION.MEDIUM").getPropForKey(medium, "contentType", true) || "TEXT";
contentType = LegacyKeywordUtils.createKeyword("COMMUNICATION.MEDIUM").getPropForKey(medium, "contentType", true) || "TEXT";
}
else {
contentType = "TEXT";
......
......@@ -8,7 +8,7 @@ import("Communication_lib");
import("Util_lib");
import("Entity_lib");
var kwd = KeywordUtils.createKeyword("COMMUNICATION.MEDIUM");
var kwd = LegacyKeywordUtils.createKeyword("COMMUNICATION.MEDIUM");
var commMedium = vars.get("$field.MEDIUM_ID");
var commCategory = kwd.getPropForKey(commMedium, "contentType", true);//TODO: maybe accessible via $property - then it's not needed to keep this information within the keyword
......
......@@ -3,5 +3,5 @@ import("system.vars");
import("system.result");
import("Keyword_lib");
var items = KeywordUtils.getStandardArray("COMMUNICATION.MEDIUM");
var items = LegacyKeywordUtils.getStandardArray("COMMUNICATION.MEDIUM");
result.object(items);
......@@ -3,5 +3,5 @@ import("Keyword_lib");
var kwdUtils, items;
items = KeywordUtils.getStandardArray("COMMUNICATION.MEDIUM");
items = LegacyKeywordUtils.getStandardArray("COMMUNICATION.MEDIUM");
result.object(items);
\ 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>KeywordAttributeRelation_entity</name>
<title>Keyword Attribute Values</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<recordContainer>db</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityField>
<name>AB_KEYWORD_ATTRIBUTERELATIONID</name>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attributerelationid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>CHAR_VALUE</name>
</entityField>
<entityField>
<name>NUMBER_VALUE</name>
</entityField>
<entityField>
<name>BOOL_VALUE</name>
</entityField>
<entityField>
<name>AB_KEYWORD_ATTRIBUTE_ID</name>
<title>Keyword Attribute</title>
<consumer>KeywordAttributes</consumer>
<mandatory v="true" />
</entityField>
<entityField>
<name>AB_KEYWORD_ENTRY_ID</name>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_entry_id/valueProcess.js</valueProcess>
</entityField>
<entityProvider>
<name>SpecificContainer</name>
<fieldType>DEPENDENCY_IN</fieldType>
<title></title>
<recordContainer>db</recordContainer>
<dependencies>
<entityDependency>
<name>490d12c0-6ace-42e5-89e1-d40b25322161</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>KeywordAttributeRelations</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
</entityProvider>
<entityParameter>
<name>containerName_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityConsumer>
<name>KeywordAttributes</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>KeywordAttribute_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName>
</dependency>
<children>
<entityParameter>
<name>containerName_param</name>
<code>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/keywordattributes/children/containername_param/code.js</code>
</entityParameter>
<entityParameter>
<name>filterAlreadyUsedByEntryId_param</name>
<code>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/keywordattributes/children/filteralreadyusedbyentryid_param/code.js</code>
</entityParameter>
</children>
</entityConsumer>
<entityParameter>
<name>keywordEntry_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<mandatory v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityField>
<name>VALUE_PROXY</name>
<documentation>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/value_proxy/documentation.adoc</documentation>
<valueProcess>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/value_proxy/valueProcess.js</valueProcess>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<linkInformation>
<linkInformation>
<name>a52883ee-630c-4373-a4ad-9b1e8c3e8188</name>
<tableName>AB_KEYWORD_ATTRIBUTERELATION</tableName>
<primaryKey>AB_KEYWORD_ATTRIBUTERELATIONID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
</linkInformation>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>AB_KEYWORD_ATTRIBUTERELATIONID.value</name>
<recordfield>AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ATTRIBUTERELATIONID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>BOOL_VALUE.value</name>
<recordfield>AB_KEYWORD_ATTRIBUTERELATION.BOOL_VALUE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CHAR_VALUE.value</name>
<recordfield>AB_KEYWORD_ATTRIBUTERELATION.CHAR_VALUE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>NUMBER_VALUE.value</name>
<recordfield>AB_KEYWORD_ATTRIBUTERELATION.NUMBER_VALUE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>AB_KEYWORD_ATTRIBUTE_ID.value</name>
<recordfield>AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ATTRIBUTE_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>AB_KEYWORD_ENTRY_ID.value</name>
<recordfield>AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ENTRY_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>AB_KEYWORD_ATTRIBUTE_ID.displayValue</name>
<expression>%aditoprj%/entity/KeywordAttributeRelation_entity/recordcontainers/db/recordfieldmappings/ab_keyword_attribute_id.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
</entity>
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
import("system.util");
import("system.result");
import("system.neon");
import("system.vars");
var keywordEntryId = vars.get("$param.keywordEntry_param");
if(keywordEntryId && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(keywordEntryId);
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$param.containerName_param"));
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.AB_KEYWORD_ENTRY_ID"));
\ No newline at end of file
A field that is proxy for the correct value-fields like `CHAR_VALUE`, `CHAR_BOOL`, etc.
\ No newline at end of file
import("system.result");
result.string("select AB_KEYWORD_ATTRIBUTE.NAME "
+ "from AB_KEYWORD_ATTRIBUTE "
+ "where AB_KEYWORD_ATTRIBUTE.AB_KEYWORD_ATTRIBUTEID = AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ATTRIBUTE_ID");
\ 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>KeywordAttribute_entity</name>
<title>Keyword Attribute</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<iconId>VAADIN:KEY_O</iconId>
<iconIdProcess>%aditoprj%/entity/KeywordAttribute_entity/iconIdProcess.js</iconIdProcess>
<titleProcess>%aditoprj%/entity/KeywordAttribute_entity/titleProcess.js</titleProcess>
<recordContainer>db</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityField>
<name>AB_KEYWORD_ATTRIBUTEID</name>
<valueProcess>%aditoprj%/entity/KeywordAttribute_entity/entityfields/ab_keyword_attributeid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>CONTAINER</name>
<title>Container</title>
<mandatory v="true" />
<possibleItemsProcess>%aditoprj%/entity/KeywordAttribute_entity/entityfields/container/possibleItemsProcess.js</possibleItemsProcess>
</entityField>
<entityField>
<name>NAME</name>
<title>Name</title>
<mandatory v="true" />
<onValidation>%aditoprj%/entity/KeywordAttribute_entity/entityfields/name/onValidation.js</onValidation>
</entityField>
<entityField>
<name>TYPE</name>
<title>Type</title>
<consumer>KeywordKeywordAttributeTypes</consumer>
<mandatory v="true" />
</entityField>
<entityProvider>
<name>SpecificContainerKeywords</name>
<fieldType>DEPENDENCY_IN</fieldType>
<recordContainer>db</recordContainer>
<dependencies>
<entityDependency>
<name>1d11c064-1cf2-4f08-b842-9fa941ad3157</name>
<entityName>KeywordAttributeRelation_entity</entityName>
<fieldName>KeywordAttributes</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
</entityProvider>
<entityParameter>
<name>containerName_param</name>
<expose v="true" />
<triggerRecalculation v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityParameter>
<name>filterAlreadyUsedByEntryId_param</name>
<expose v="true" />
<mandatory v="false" />
<description>PARAMETER</description>
</entityParameter>
<entityConsumer>
<name>KeywordKeywordAttributeTypes</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/KeywordAttribute_entity/entityfields/keywordkeywordattributetypes/children/containername_param/code.js</code>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/KeywordAttribute_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<linkInformation>
<linkInformation>
<name>bd113d67-34ab-4708-b0e5-60a44332e6b8</name>
<tableName>AB_KEYWORD_ATTRIBUTE</tableName>
<primaryKey>AB_KEYWORD_ATTRIBUTEID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
</linkInformation>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>AB_KEYWORD_ATTRIBUTEID.value</name>
<recordfield>AB_KEYWORD_ATTRIBUTE.AB_KEYWORD_ATTRIBUTEID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CONTAINER.value</name>
<recordfield>AB_KEYWORD_ATTRIBUTE.CONTAINER</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>NAME.value</name>
<recordfield>AB_KEYWORD_ATTRIBUTE.NAME</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>TYPE.value</name>
<recordfield>AB_KEYWORD_ATTRIBUTE.TYPE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>TYPE.displayValue</name>
<expression>%aditoprj%/entity/KeywordAttribute_entity/recordcontainers/db/recordfieldmappings/type.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
</entity>
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
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