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

[Projekt: Entwicklung - Neon][TicketNr.: 1048996][Alphabetische Sortierung und...

[Projekt: Entwicklung - Neon][TicketNr.: 1048996][Alphabetische Sortierung und manuelle Sortierung über Pfeile von Schlüsselwortlisten] Bugfixing 6
parent c231e8b0
No related branches found
No related tags found
No related merge requests found
......@@ -102,12 +102,14 @@
<recordContainers>
<dbRecordContainer>
<name>db</name>
<isPageable v="true" />
<isPageable v="false" />
<orderClauseProcess>%aditoprj%/entity/KeywordCategory_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess>
<onDBInsert>%aditoprj%/entity/KeywordCategory_entity/recordcontainers/db/onDBInsert.js</onDBInsert>
<onDBUpdate>%aditoprj%/entity/KeywordCategory_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate>
<onDBDelete>%aditoprj%/entity/KeywordCategory_entity/recordcontainers/db/onDBDelete.js</onDBDelete>
<alias>Data_alias</alias>
<cacheType>GLOBAL</cacheType>
<cacheKeyProcess>%aditoprj%/entity/KeywordCategory_entity/recordcontainers/db/cacheKeyProcess.js</cacheKeyProcess>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>NAME.value</name>
......
......@@ -10,9 +10,11 @@ var name = vars.get("local.value")
//a KEY has always to be unique within one categoryId and since the user can specify the key on insert we've to ensure that it's unique
if (name)
{
var uid = vars.get("$field.AB_KEYWORD_CATEGORYID");
var alreadyExistantCount = newSelect("count(*)")
.from("AB_KEYWORD_CATEGORY")
.where("AB_KEYWORD_CATEGORY.NAME", name)
.andIfSet("AB_KEYWORD_CATEGORY.AB_KEYWORD_CATEGORYID", uid, SqlBuilder.NOT_EQUAL())
.cell();
if (alreadyExistantCount != "0")
......
import("CachedRecordContainer_lib");
import("system.result")
var res = CachedRecordContainerUtils.getKeyWithPreset(CachedRecordContainerFieldPresets.STANDARD());
result.string(res);
......@@ -779,7 +779,7 @@
<orderClauseProcess>%aditoprj%/entity/KeywordEntry_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess>
<onDBDelete>%aditoprj%/entity/KeywordEntry_entity/recordcontainers/db/onDBDelete.js</onDBDelete>
<alias>Data_alias</alias>
<cacheType>NONE</cacheType>
<cacheType>SESSION</cacheType>
<cacheKeyProcess>%aditoprj%/entity/KeywordEntry_entity/recordcontainers/db/cacheKeyProcess.js</cacheKeyProcess>
<recordFieldMappings>
<dbRecordFieldMapping>
......
import("system.entities");
import("system.db");
import("system.neon");
import("system.SQLTYPES");
......@@ -150,10 +151,25 @@ KeywordUtils.getCategoryIdByName = function(pName)
if(pName)
{
res = newSelect("AB_KEYWORD_CATEGORY.AB_KEYWORD_CATEGORYID")
.from("AB_KEYWORD_CATEGORY")
.where("AB_KEYWORD_CATEGORY.NAME", pName)
.cell();
var nameFilter = {
"type":"group",
"operator":"AND",
"childs":[{
"type":"row",
"name":"NAME",
"operator":"EQUAL",
"value":pName,
"key":pName,
"contenttype":"TEXT"
}]
};
var entityConfig = entities.createConfigForLoadingRows()
.entity("KeywordCategory_entity")
.fields(["#UID"])
.filter(JSON.stringify(nameFilter));
var entityRow = entities.getRows(entityConfig);
if (entityRow.length > 0)
res = entityRow[0]["#UID"];
}
return res;
......
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