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

[Projekt: Entwicklung - Neon][TicketNr.: 1030337][Umsetzung Keywordlogik]

parent 4059916c
No related branches found
No related tags found
No related merge requests found
Showing
with 272 additions and 45 deletions
......@@ -30,6 +30,7 @@
<icon>VAADIN:CONTROLLER</icon>
<node name="Group3" kind="123" title="">
<node name="Attribute_context" kind="10077" />
<node name="Keyword_context" kind="10077" />
<node name="INTERNAL_ADMINISTRATOR" kind="159" />
</node>
</node>
......
......@@ -4,7 +4,9 @@
<title>Keyword</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/Keyword_entity/documentation.adoc</documentation>
<onValidation>%aditoprj%/entity/Keyword_entity/onValidation.js</onValidation>
<iconId>VAADIN:KEY</iconId>
<iconIdProcess>%aditoprj%/entity/Keyword_entity/iconIdProcess.js</iconIdProcess>
<titleProcess>%aditoprj%/entity/Keyword_entity/titleProcess.js</titleProcess>
<recordContainer>db</recordContainer>
<entityFields>
......@@ -15,7 +17,10 @@
</entityProvider>
<entityField>
<name>CONTAINER</name>
<documentation>%aditoprj%/entity/Keyword_entity/entityfields/container/documentation.adoc</documentation>
<title>Container</title>
<mandatory v="true" />
<possibleItemsProcess>%aditoprj%/entity/Keyword_entity/entityfields/container/possibleItemsProcess.js</possibleItemsProcess>
<groupable v="true" />
</entityField>
<entityField>
......@@ -41,26 +46,34 @@
<entityField>
<name>KEYID</name>
<title>Key</title>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Keyword_entity/entityfields/keyid/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>TITLE</name>
<title>Title (original language)</title>
<mandatory v="true" />
</entityField>
<entityField>
<name>SORTING</name>
<documentation>%aditoprj%/entity/Keyword_entity/entityfields/sorting/documentation.adoc</documentation>
<title>Sorting</title>
<state>READONLY</state>
</entityField>
<entityField>
<name>ISACTIVE</name>
<title>Active</title>
<contentType>BOOLEAN</contentType>
<possibleItemsProcess>%aditoprj%/entity/Keyword_entity/entityfields/isactive/possibleItemsProcess.js</possibleItemsProcess>
<valueProcess>%aditoprj%/entity/Keyword_entity/entityfields/isactive/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>ISESSENTIAL</name>
<documentation>%aditoprj%/entity/Keyword_entity/entityfields/isessential/documentation.adoc</documentation>
<title>Essential</title>
<contentType>BOOLEAN</contentType>
<possibleItemsProcess>%aditoprj%/entity/Keyword_entity/entityfields/isessential/possibleItemsProcess.js</possibleItemsProcess>
<state>READONLY</state>
</entityField>
<entityParameter>
<name>containerName_param</name>
......@@ -86,17 +99,33 @@
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
<name>onlyActives</name>
<code>%aditoprj%/entity/Keyword_entity/entityfields/generic_dfi/children/onlyactives/code.js</code>
<expose v="true" />
</entityParameter>
</children>
</entityProvider>
<entityField>
<name>TITLE_TRANSLATED</name>
<valueProcess>%aditoprj%/entity/Keyword_entity/entityfields/title_translated/valueProcess.js</valueProcess>
</entityField>
<entityParameter>
<name>onlyActives</name>
<code>%aditoprj%/entity/Keyword_entity/entityfields/onlyactives/code.js</code>
<expose v="true" />
<triggerRecalculation v="true" />
<description>PARAMETER</description>
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/Keyword_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<orderClauseProcess>%aditoprj%/entity/Keyword_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess>
<onDBUpdate>%aditoprj%/entity/Keyword_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate>
<linkInformation>
<linkInformation>
<name>52acbfe0-57f4-4614-83af-9882e168f431</name>
......
......@@ -12,7 +12,7 @@ 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".
A keyword container is the element that keeps several entries of Keywords together. That could be for example something like "Contact-Status". Keep in mind that this done virtually and not in the actual way of storage.
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.
......
`CONTAINER` is the a name and used for grouping keyword-entries. This is was a keyword-container essentially is.
\ No newline at end of file
import("system.result");
import("system.db");
//TODO: move into UEM
//first column is ID, second view value - which is the same because there is no ID for keyword-containers
result.object(db.table("select distinct AB_KEYWORD_ENTRY.CONTAINER, AB_KEYWORD_ENTRY.CONTAINER from AB_KEYWORD_ENTRY order by 1 asc"));
\ No newline at end of file
import("system.result");
result.string("true");//TODO: provider-code is not executed correct (did not receive the value from here)
\ No newline at end of file
import("system.util");
import("system.result");
import("system.neon");
import("system.vars");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string("1");
\ No newline at end of file
Specifies if a keyword-entry is essential. An essential keyword-entry is protected an must not be deleted because the `KEYID` is used within JDito-Code and there is functionality behind that keyword-entry.
[NOTE]
====
Therefore this field cannot be set (it's *READONLY*) - a `true`-value makes only sense if the developer decides to use it which is why he has to care that the field is marked as essential.
====
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.result");
result.string("false");
\ No newline at end of file
Used for sorting keyword-entries within a keyword-container.
[NOTE]
====
Currently this cannot be set (it's *READONLY*) - the value is generated automatically. Reserved for future use.
====
import("system.vars");
import("system.result");
var container = vars.get("$field.CONTAINER");
if (container)
result.string("TEXT:" + container);
\ No newline at end of file
import("system.db");
import("system.vars");
import("system.text");
import("system.neon");
import("Sql_lib");
//TODO: this should no happen in onValidation; waiting for #1032668
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
var keyContainer = vars.get("$field.CONTAINER");
if (keyContainer)
{
var cond = SqlCondition.begin().andPrepare("AB_KEYWORD_ENTRY.CONTAINER", keyContainer);
var maskingHelper = new SqlMaskingUtils();
var newCodeNumber = db.cell(cond.buildSql("select " + maskingHelper.max("AB_KEYWORD_ENTRY.SORTING") + " from AB_KEYWORD_ENTRY", "1 = 2"));
newCodeNumber = Number(newCodeNumber);//if no number exists till no, start value will be 1 (due to: ++0)
if (isNaN(newCodeNumber))
throw new TypeError();//TODO:add Message
neon.setFieldValue("$field.SORTING", ++newCodeNumber);
}
}
\ No newline at end of file
import("system.vars");
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());
if (vars.get("$param.onlyActives") == "true")
{
cond.andPrepare("AB_KEYWORD_ENTRY.ISACTIVE", "1");
}
var condStr = db.translateCondition(cond.build("1 = 1"));
result.string(condStr);
\ No newline at end of file
import("system.logging");
import("system.db");
import("system.vars");
import("system.text");
import("system.neon");
import("Sql_lib");
var changedFields = vars.get("$local.changed");
//whenever the container is changed data that depends on the keyword-container has be "fixed" to keep consistency
//this could be information like Keyword-attributes or the sorting-position
//maybe it'd be better to lock KeywordContainer as read-only after creation
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && changedFields.indexOf("AB_KEYWORD_ENTRY.CONTAINER") > -1)
{
var keyContainer = vars.get("$field.CONTAINER");
if (keyContainer)
{
var cond = SqlCondition.begin().andPrepare("AB_KEYWORD_ENTRY.CONTAINER", keyContainer);
var maskingHelper = new SqlMaskingUtils();
var newCodeNumber = db.cell(cond.buildSql("select " + maskingHelper.max("AB_KEYWORD_ENTRY.SORTING") + " from AB_KEYWORD_ENTRY", "1 = 2"));
newCodeNumber = Number(newCodeNumber);//if no number exists till no, start value will be 1 (due to: ++0)
if (isNaN(newCodeNumber))
throw new TypeError();//TODO:add Message
var cols = ["SORTING"];
var vals = [++newCodeNumber];
cond.clear().andPrepare("AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID", vars.get("$sys.uid"));
db.updateData("AB_KEYWORD_ENTRY", cols, null, vals, cond.build("1 = 2"));
}
}
\ No newline at end of file
import("system.db");
import("system.result");
result.object({
"AB_KEYWORD_ENTRY.CONTAINER": db.ASCENDING
,"AB_KEYWORD_ENTRY.SORTING": db.ASCENDING
});
\ No newline at end of file
......@@ -4,6 +4,7 @@ import("system.text");
import("system.neon");
import("Sql_lib");
//TODO: this should no happen in onValidation; waiting for #1032668
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
var maskingHelper = new SqlMaskingUtils();
......
......@@ -783,9 +783,6 @@
<entry>
<key>Dateigröße</key>
</entry>
<entry>
<key>Member</key>
</entry>
<entry>
<key>A reason is only possible if a date is given.</key>
</entry>
......@@ -1005,9 +1002,6 @@
<entry>
<key>Social</key>
</entry>
<entry>
<key>Dataset</key>
</entry>
<entry>
<key>Facebook Feed</key>
</entry>
......@@ -1371,9 +1365,6 @@
<entry>
<key>absagen</key>
</entry>
<entry>
<key>asdfasdf</key>
</entry>
<entry>
<key>type</key>
</entry>
......@@ -1488,9 +1479,6 @@
<entry>
<key>${FORECAST_ENGLISH}</key>
</entry>
<entry>
<key>${NUMBER}</key>
</entry>
<entry>
<key>Usage</key>
</entry>
......@@ -1503,6 +1491,48 @@
<entry>
<key>${ADDRESS_STATE}</key>
</entry>
<entry>
<key>Title (original language)</key>
</entry>
<entry>
<key>Parent Attribute</key>
</entry>
<entry>
<key>Attribute Relation</key>
</entry>
<entry>
<key>Essential</key>
</entry>
<entry>
<key>Attribute Usage</key>
</entry>
<entry>
<key>Beziehung</key>
</entry>
<entry>
<key>Key</key>
</entry>
<entry>
<key>Attribute</key>
</entry>
<entry>
<key>Context</key>
</entry>
<entry>
<key>Container</key>
</entry>
<entry>
<key>Beziehungen</key>
</entry>
<entry>
<key>Administration</key>
</entry>
<entry>
<key>Keyword</key>
</entry>
<entry>
<key>Sorting</key>
</entry>
</keyValueMap>
<font name="Dialog" style="0" size="11" />
<sqlModels>
......@@ -1510,7 +1540,7 @@
<name>Data_alias</name>
<alias>Data_alias</alias>
<statements>
<element></element>
<element>select AB_KEYWORD_ENTRY.TITLE from AB_KEYWORD_ENTRY</element>
</statements>
</languageSql>
</sqlModels>
......
......@@ -122,10 +122,6 @@
<key>Online-Meeting</key>
<value>Online-Meeting</value>
</entry>
<entry>
<key>${NUMBER}</key>
<value>Zahl</value>
</entry>
<entry>
<key>Choose address</key>
<value>Adresse auswählen</value>
......@@ -1160,10 +1156,6 @@
<key>Forecast</key>
<value>Forecast</value>
</entry>
<entry>
<key>Member</key>
<value>Teammitglied</value>
</entry>
<entry>
<key>A reason is only possible if a date is given.</key>
<value>Begründung nur bei Ausgeschiedenen Mitbewerbern erlaubt.</value>
......@@ -1552,10 +1544,6 @@
<entry>
<key>Social</key>
</entry>
<entry>
<key>Dataset</key>
<value>Datensatz</value>
</entry>
<entry>
<key>Facebook Feed</key>
</entry>
......@@ -1778,6 +1766,7 @@
</entry>
<entry>
<key>title</key>
<value>Titel</value>
</entry>
<entry>
<key>von</key>
......@@ -1812,9 +1801,6 @@
<entry>
<key>absagen</key>
</entry>
<entry>
<key>asdfasdf</key>
</entry>
<entry>
<key>type</key>
<value>Typ</value>
......@@ -1910,6 +1896,51 @@
<key>${FORECAST_ENGLISH}</key>
<value>Forecast</value>
</entry>
<entry>
<key>Title (original language)</key>
<value>Titel (ursprüngliche Sprache)</value>
</entry>
<entry>
<key>Parent Attribute</key>
</entry>
<entry>
<key>Attribute Relation</key>
</entry>
<entry>
<key>Essential</key>
<value>Essenziell</value>
</entry>
<entry>
<key>Attribute Usage</key>
</entry>
<entry>
<key>Beziehung</key>
</entry>
<entry>
<key>Key</key>
</entry>
<entry>
<key>Attribute</key>
</entry>
<entry>
<key>Context</key>
</entry>
<entry>
<key>Container</key>
</entry>
<entry>
<key>Beziehungen</key>
</entry>
<entry>
<key>Administration</key>
</entry>
<entry>
<key>Keyword</key>
</entry>
<entry>
<key>Sorting</key>
<value>Sortierung</value>
</entry>
</keyValueMap>
<font name="Dialog" style="0" size="11" />
</language>
......@@ -797,9 +797,6 @@
<entry>
<key>Dateigröße</key>
</entry>
<entry>
<key>Member</key>
</entry>
<entry>
<key>A reason is only possible if a date is given.</key>
</entry>
......@@ -1022,9 +1019,6 @@
<entry>
<key>Social</key>
</entry>
<entry>
<key>Dataset</key>
</entry>
<entry>
<key>Facebook Feed</key>
</entry>
......@@ -1394,9 +1388,6 @@
<entry>
<key>absagen</key>
</entry>
<entry>
<key>asdfasdf</key>
</entry>
<entry>
<key>type</key>
</entry>
......@@ -1518,10 +1509,6 @@
<key>${FORECAST_ENGLISH}</key>
<value>Forecast</value>
</entry>
<entry>
<key>${NUMBER}</key>
<value>Number</value>
</entry>
<entry>
<key>Usage</key>
</entry>
......@@ -1534,6 +1521,48 @@
<entry>
<key>${ADDRESS_STATE}</key>
</entry>
<entry>
<key>Title (original language)</key>
</entry>
<entry>
<key>Parent Attribute</key>
</entry>
<entry>
<key>Attribute Relation</key>
</entry>
<entry>
<key>Essential</key>
</entry>
<entry>
<key>Attribute Usage</key>
</entry>
<entry>
<key>Beziehung</key>
</entry>
<entry>
<key>Key</key>
</entry>
<entry>
<key>Attribute</key>
</entry>
<entry>
<key>Context</key>
</entry>
<entry>
<key>Container</key>
</entry>
<entry>
<key>Beziehungen</key>
</entry>
<entry>
<key>Administration</key>
</entry>
<entry>
<key>Keyword</key>
</entry>
<entry>
<key>Sorting</key>
</entry>
</keyValueMap>
<font name="Dialog" style="0" size="11" />
</language>
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