Skip to content
Snippets Groups Projects
Commit 0aa9cad4 authored by Andreas Schindlbeck's avatar Andreas Schindlbeck
Browse files

Merge origin/master

parents b8a795e0 a8a7cc0d
No related branches found
No related tags found
No related merge requests found
Showing
with 292 additions and 21 deletions
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<description></description> <description></description>
<auditSyncConfig> <auditSyncConfig>
<name>auditSyncConfig</name> <name>auditSyncConfig</name>
<auditMode v="0" /> <auditMode v="2" />
<syncActive v="false" /> <syncActive v="false" />
<syncComplete v="true" /> <syncComplete v="true" />
<syncDirection v="1" /> <syncDirection v="1" />
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
<description></description> <description></description>
<auditSyncConfig> <auditSyncConfig>
<name>auditSyncConfig</name> <name>auditSyncConfig</name>
<auditMode v="0" /> <auditMode v="1" />
<syncActive v="false" /> <syncActive v="false" />
<syncComplete v="true" /> <syncComplete v="true" />
<syncDirection v="1" /> <syncDirection v="1" />
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
<description></description> <description></description>
<auditSyncConfig> <auditSyncConfig>
<name>auditSyncConfig</name> <name>auditSyncConfig</name>
<auditMode v="0" /> <auditMode v="2" />
<syncActive v="false" /> <syncActive v="false" />
<syncComplete v="true" /> <syncComplete v="true" />
<syncDirection v="1" /> <syncDirection v="1" />
...@@ -458,8 +458,8 @@ ...@@ -458,8 +458,8 @@
<name>GENDER</name> <name>GENDER</name>
<dbName></dbName> <dbName></dbName>
<primaryKey v="false" /> <primaryKey v="false" />
<columnType v="12" /> <columnType v="1" />
<size v="50" /> <size v="1" />
<scale v="0" /> <scale v="0" />
<notNull v="false" /> <notNull v="false" />
<isUnique v="false" /> <isUnique v="false" />
...@@ -518,7 +518,6 @@ ...@@ -518,7 +518,6 @@
<description></description> <description></description>
<auditSyncConfig> <auditSyncConfig>
<name>auditSyncConfig</name> <name>auditSyncConfig</name>
<auditMode v="0" />
<syncActive v="false" /> <syncActive v="false" />
<syncComplete v="true" /> <syncComplete v="true" />
<syncDirection v="1" /> <syncDirection v="1" />
...@@ -797,7 +796,7 @@ ...@@ -797,7 +796,7 @@
<description></description> <description></description>
<auditSyncConfig> <auditSyncConfig>
<name>auditSyncConfig</name> <name>auditSyncConfig</name>
<auditMode v="0" /> <auditMode v="1" />
<syncActive v="false" /> <syncActive v="false" />
<syncComplete v="true" /> <syncComplete v="true" />
<syncDirection v="1" /> <syncDirection v="1" />
...@@ -860,8 +859,8 @@ ...@@ -860,8 +859,8 @@
<name>ADDR_TYPE</name> <name>ADDR_TYPE</name>
<dbName></dbName> <dbName></dbName>
<primaryKey v="false" /> <primaryKey v="false" />
<columnType v="4" /> <columnType v="5" />
<size v="10" /> <size v="5" />
<scale v="0" /> <scale v="0" />
<notNull v="false" /> <notNull v="false" />
<isUnique v="false" /> <isUnique v="false" />
...@@ -1044,7 +1043,7 @@ ...@@ -1044,7 +1043,7 @@
<description></description> <description></description>
<auditSyncConfig> <auditSyncConfig>
<name>auditSyncConfig</name> <name>auditSyncConfig</name>
<auditMode v="0" /> <auditMode v="1" />
<syncActive v="false" /> <syncActive v="false" />
<syncComplete v="true" /> <syncComplete v="true" />
<syncDirection v="1" /> <syncDirection v="1" />
...@@ -1181,4 +1180,41 @@ ...@@ -1181,4 +1180,41 @@
</entityGroup> </entityGroup>
</aliasDefDb> </aliasDefDb>
</aliasDefinitionSub> </aliasDefinitionSub>
<indexSearchGroups>
<indexSearchGroup>
<name>ORG</name>
<title>Company</title>
<icon>VAADIN:BUILDING</icon>
<idColumn>RELATIONID</idColumn>
<titleColumn>TITLECOLUMN</titleColumn>
<descriptionColumn>DESCCOLUMN</descriptionColumn>
<query>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/org/query.js</query>
<resultContextNeon>Org_context</resultContextNeon>
<affectedTables>
<element>ADDRESS</element>
<element>COMM</element>
<element>RELATION</element>
<element>ORG</element>
</affectedTables>
<affectedIds>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/org/affectedIds.js</affectedIds>
</indexSearchGroup>
<indexSearchGroup>
<name>PERS</name>
<title>Contact</title>
<icon>VAADIN:USERS</icon>
<idColumn>RELATIONID</idColumn>
<titleColumn>TITLECOLUMN</titleColumn>
<descriptionColumn>DESCCOLUMN</descriptionColumn>
<query>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/pers/query.js</query>
<resultContextNeon>Pers_context</resultContextNeon>
<affectedTables>
<element>ADDRESS</element>
<element>COMM</element>
<element>PERS</element>
<element>RELATION</element>
<element>ORG</element>
</affectedTables>
<affectedIds>%aditoprj%/aliasDefinition/Data_alias/indexsearchgroups/pers/affectedIds.js</affectedIds>
</indexSearchGroup>
</indexSearchGroups>
</aliasDefinition> </aliasDefinition>
import("system.db");
import("system.result");
import("system.vars");
import("IndexSearch_lib");
var indexHelper, infoContainer, onUpdFn, tableName, res;
indexHelper = new IndexsearchUtils();
tableName = vars.get("$local.table");
idValue = vars.get("$local.idvalue");
infoContainer = indexHelper.createAffectedInfoContainer(idValue, null, vars.get("$local.action")
,function (){return vars.get("$local.columns")}
,function (){return vars.get("$local.oldvalues")}
,function (){return vars.get("$local.values")});
switch (tableName)
{
case "RELATION":
res = [idValue];
break;
case "ORG":
res = db.array(db.COLUMN, "select RELATION.RELATIONID from RELATION where RELATION.PERS_ID is null and RELATION.ORG_ID = '" + idValue + "'");
break;
case "ADDRESS":
res = indexHelper.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
return db.array(db.COLUMN, ["select ADDRESS.RELATION_ID from ADDRESS where ADDRESS.ADDRESSID = ?", [
[id, db.getColumnTypes("ADDRESS", ["ADDRESSID"])[0]]
]]);
});
break;
case "COMM":
res = indexHelper.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
return db.array(db.COLUMN, ["select ADDRESS.RELATION_ID from COMM where COMMID = ?", [
[id, db.getColumnTypes("COMM", ["COMMID"])[0]]
]]);
});
break;
}
if (res) {
result.object(res);
}
\ No newline at end of file
import("system.result");
import("system.vars");
import("system.calendars");
import("system.db");
import("Sql_lib");
var sqlQuery, sqlHelper, queryCondition, affectedIds;
if (vars.exists("$local.idvalue")) {
affectedIds = vars.get("$local.idvalue");
queryCondition = "where RELATION.RELATIONID in ('" + affectedIds.map(function (v){return db.quote(v);}).join("', '") + "')";
//TODO: refactor this for incremental indexer (injections?)
}
sqlHelper = new SqlUtils();
sqlQuery = "select RELATION.RELATIONID "
+ "," + sqlHelper.concat(["ORG.NAME", "ORG.CUSTOMERCODE", "defaultAddress.COUNTRY", "defaultAddress.ZIP", "defaultAddress.CITY"])
+ " as TITLECOLUMN "
+ "," + sqlHelper.concat(["ADDRESS", "BUILDINGNO", "', '", "COUNTRY", "'-'", "ZIP", "CITY"], ' ') + " as DESCCOLUMN "
//additional indexed fields
+ ",ORG.NAME, COMM.ADDR "
+ " from ORG "
+ " join RELATION on RELATION.ORG_ID = ORG.ORGID and RELATION.PERS_ID is null "
+ " left join ADDRESS defaultAddress on defaultAddress.ADDRESSID = RELATION.ADDRESS_ID "
+ " left join COMM on COMM.RELATION_ID = RELATION.RELATIONID "
+ (queryCondition || "")
+ " order by RELATION.RELATIONID ";
result.string(sqlQuery);
\ No newline at end of file
import("system.db");
import("system.result");
import("system.vars");
import("IndexSearch_lib");
var indexHelper, infoContainer, onUpdFn, tableName, res;
indexHelper = new IndexsearchUtils();
tableName = vars.get("$local.table");
idValue = vars.get("$local.idvalue");
infoContainer = indexHelper.createAffectedInfoContainer(idValue, null, vars.get("$local.action")
,function (){return vars.get("$local.columns")}
,function (){return vars.get("$local.oldvalues")}
,function (){return vars.get("$local.values")});
switch (tableName)
{
case "RELATION":
res = [idValue];
break;
case "PERS":
res = db.array(db.COLUMN, "select RELATION.RELATIONID from RELATION where RELATION.PERS_ID = '" + idValue + "'");
break;
case "ORG":
res = db.array(db.COLUMN, "select RELATION.RELATIONID from RELATION where RELATION.PERS_ID is not null and RELATION.ORG_ID = '" + idValue + "'");
break;
case "ADDRESS":
res = indexHelper.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
return db.array(db.COLUMN, ["select ADDRESS.RELATION_ID from ADDRESS where ADDRESS.ADDRESSID = ?", [
[id, db.getColumnTypes("ADDRESS", ["ADDRESSID"])[0]]
]]);
});
break;
case "COMM":
res = indexHelper.getAffectedIdValues("RELATION_ID", infoContainer, function (id){
return db.array(db.COLUMN, ["select ADDRESS.RELATION_ID from COMM where COMMID = ?", [
[id, db.getColumnTypes("COMM", ["COMMID"])[0]]
]]);
});
break;
}
if (res) {
result.object(res);
}
\ No newline at end of file
import("system.result");
import("system.vars");
import("system.calendars");
import("system.db");
import("Sql_lib");
var sqlQuery, sqlHelper, queryCondition, affectedIds;
if (vars.exists("$local.idvalue")) {
affectedIds = vars.get("$local.idvalue");
queryCondition = "where RELATION.RELATIONID in ('" + affectedIds.map(function (v){return db.quote(v);}).join("', '") + "')";
//TODO: refactor this for incremental indexer (injections?)
}
sqlHelper = new SqlUtils();
sqlQuery = "select RELATION.RELATIONID "
+ "," + sqlHelper.concat(["PERS.SALUTATION", "PERS.FIRSTNAME", "PERS.LASTNAME", "ORG.NAME"])
+ " as TITLECOLUMN "
+ "," + sqlHelper.concat(["ADDRESS", "BUILDINGNO", "', '", "COUNTRY", "'-'", "ZIP", "CITY"], ' ') + " as DESCCOLUMN "
//additional indexed fields
+ ",ORG.NAME, COMM.ADDR "
+ " from PERS "
+ " join RELATION on RELATION.PERS_ID = PERS.PERSID "
+ " join ORG on RELATION.ORG_ID = ORG.ORGID "
+ " left join ADDRESS defaultAddress on defaultAddress.ADDRESSID = RELATION.ADDRESS_ID "
+ " left join COMM on COMM.RELATION_ID = RELATION.RELATIONID "
+ (queryCondition || "")
+ " order by RELATION.RELATIONID ";
result.string(sqlQuery);
\ No newline at end of file
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
<name>ORGID</name> <name>ORGID</name>
<tableName>ORG</tableName> <tableName>ORG</tableName>
<columnName>ORGID</columnName> <columnName>ORGID</columnName>
<valueProcess>%aditoprj%/entity/Org_entity/entityfields/orgid/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>ORG_USER_EDIT</name> <name>ORG_USER_EDIT</name>
...@@ -105,7 +106,6 @@ ...@@ -105,7 +106,6 @@
<name>RELATIONID</name> <name>RELATIONID</name>
<tableName>RELATION</tableName> <tableName>RELATION</tableName>
<columnName>RELATIONID</columnName> <columnName>RELATIONID</columnName>
<valueProcess>%aditoprj%/entity/Org_entity/entityfields/relationid/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>STATUS</name> <name>STATUS</name>
...@@ -228,15 +228,15 @@ ...@@ -228,15 +228,15 @@
</entityFields> </entityFields>
<linkInformation> <linkInformation>
<linkInformation> <linkInformation>
<name>7fe13e6e-8605-44e1-989b-41e103f5c884</name> <name>a08ad13b-9031-4b6f-8c42-9df8d4185ce5</name>
<tableName>ORG</tableName> <tableName>ORG</tableName>
<primaryKey>ORGID</primaryKey> <primaryKey>ORGID</primaryKey>
<isUIDTable v="true" />
</linkInformation> </linkInformation>
<linkInformation> <linkInformation>
<name>181abde8-149c-44f1-bc1b-90635e314fab</name> <name>419e74cd-64ad-472d-915e-cff50aa293da</name>
<tableName>RELATION</tableName> <tableName>RELATION</tableName>
<primaryKey>RELATIONID</primaryKey> <primaryKey>RELATIONID</primaryKey>
<isUIDTable v="true" />
</linkInformation> </linkInformation>
</linkInformation> </linkInformation>
</entity> </entity>
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
<name>PERSID</name> <name>PERSID</name>
<tableName>PERS</tableName> <tableName>PERS</tableName>
<columnName>PERSID</columnName> <columnName>PERSID</columnName>
<valueProcess>%aditoprj%/entity/Pers_entity/entityfields/persid/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>SALUTATION</name> <name>SALUTATION</name>
...@@ -143,7 +144,6 @@ ...@@ -143,7 +144,6 @@
<name>RELATIONID</name> <name>RELATIONID</name>
<tableName>RELATION</tableName> <tableName>RELATION</tableName>
<columnName>RELATIONID</columnName> <columnName>RELATIONID</columnName>
<valueProcess>%aditoprj%/entity/Pers_entity/entityfields/relationid/valueProcess.js</valueProcess>
</entityField> </entityField>
<entityIncomingField> <entityIncomingField>
<name>PersOrg_dfi</name> <name>PersOrg_dfi</name>
...@@ -243,15 +243,15 @@ ...@@ -243,15 +243,15 @@
</entityFields> </entityFields>
<linkInformation> <linkInformation>
<linkInformation> <linkInformation>
<name>1a8da51e-5630-46af-bc83-0928d534ff4c</name> <name>449dc321-de5a-40da-a96e-23784d830745</name>
<tableName>PERS</tableName> <tableName>PERS</tableName>
<primaryKey>PERSID</primaryKey> <primaryKey>PERSID</primaryKey>
<isUIDTable v="true" />
</linkInformation> </linkInformation>
<linkInformation> <linkInformation>
<name>5989cdc1-54c8-4b98-a571-6fefe5980e2a</name> <name>724cb303-ea72-4207-9fc4-52aec17e0c31</name>
<tableName>RELATION</tableName> <tableName>RELATION</tableName>
<primaryKey>RELATIONID</primaryKey> <primaryKey>RELATIONID</primaryKey>
<isUIDTable v="true" />
</linkInformation> </linkInformation>
</linkInformation> </linkInformation>
</entity> </entity>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<clientSearchOptimizedForSpeed v="true" /> <clientSearchOptimizedForSpeed v="true" />
<clientSearchExcludeForIgnorecase v="true" /> <clientSearchExcludeForIgnorecase v="true" />
<blobHandlingMethod>DATABASE</blobHandlingMethod> <blobHandlingMethod>DATABASE</blobHandlingMethod>
<databaseAuditGetOldValueLobs v="true" /> <databaseAuditGetOldValueLobs v="false" />
<indexsearchFullIndexerEnabled v="true" /> <indexsearchFullIndexerEnabled v="true" />
<indexsearchFullIndexerInterval v="0" /> <indexsearchFullIndexerInterval v="0" />
<indexsearchIncrementingIndexerEnabled v="true" /> <indexsearchIncrementingIndexerEnabled v="true" />
......
<?xml version="1.0" encoding="UTF-8"?>
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.7" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.1.7">
<name>IndexSearch_lib</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<process>%aditoprj%/process/IndexSearch_lib/process.js</process>
</process>
function IndexsearchUtils(){
this.getAffectedIdValues = function(fieldname, affectedInfoContainer, updateFn){
var affectedIds;
switch (affectedInfoContainer.action){
case "I":
affectedIds = [affectedInfoContainer.newValues[affectedInfoContainer.columns.indexOf(fieldname)]];
break;
case "U":
affectedIds = updateFn.call(null, changedIdValue);
break;
case "D":
affectedIds = [affectedInfoContainer.oldValues[affectedInfoContainer.columns.indexOf(fieldname)]];
break;
}
return affectedIds || [];
}
this.createAffectedInfoContainer = function(changedIdValue, changedTable, action, columnsFn, oldValueFn, newValueFn){
var res, internalStorage;
internalStorage = {};
res = {
id: changedIdValue
,table: changedTable
,action: action
,columns: null //null for autocomplete in the ADITO-designer
,oldValues: null
,newValues: null
};
Object.defineProperty(res, "columns", {
get: function(){
if (internalStorage["columns"] == undefined)
internalStorage["columns"] = columnsFn.call(null);
return internalStorage["columns"];
}
,set: function (v){
internalStorage["columns"] = v;
}
});
Object.defineProperty(res, "oldValues", {
get: function(){
if (internalStorage["oldValues"] == undefined)
internalStorage["oldValues"] = oldValueFn.call(null);
return internalStorage["oldValues"];
}
,set: function (v){
internalStorage["oldValues"] = v;
}
});
Object.defineProperty(res, "newValues", {
get: function(){
if (internalStorage["newValues"] == undefined)
internalStorage["newValues"] = newValueFn.call(null);
return internalStorage["newValues"];
}
,set: function (v){
internalStorage["newValues"] = v;
}
});
return res;
}
}
\ No newline at end of file
...@@ -342,8 +342,8 @@ function SqlUtils() ...@@ -342,8 +342,8 @@ function SqlUtils()
if(retstr != "") if(retstr != "")
retstr += concat_string; retstr += concat_string;
if ( i < pFields.length - 1 ) //Check if another value follows, if not separator is not needed if ( i < pFields.length - 1 ) //Check if another value follows, if not separator is not needed
retstr += " case when " + pFields[i] + isNotEmpty + " then case when " + trimSQL(pFields[i+1], pAlias) + isNotEmpty + " and " retstr += " case when " + pFields[i] + isNotEmpty + " then case when " + this.trimSql(pFields[i+1], pAlias) + isNotEmpty + " and "
+ trimSQL(pFields[i+1], pAlias) + isNotNull + " then " + pFields[i] + pSeparator + " else " + pFields[i] + " end" + " else " + blank + " end "; + this.trimSql(pFields[i+1], pAlias) + isNotNull + " then " + pFields[i] + pSeparator + " else " + pFields[i] + " end" + " else " + blank + " end ";
else else
retstr += " case when " + pFields[i] + isNotEmpty + " then " + pFields[i] + " else " + blank + " end "; retstr += " case when " + pFields[i] + isNotEmpty + " then " + pFields[i] + " else " + blank + " end ";
} }
......
<?xml version="1.0" encoding="UTF-8"?>
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.7" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.1.7">
<name>indexsearch_patternextension</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<process>%aditoprj%/process/indexsearch_patternextension/process.js</process>
</process>
import("system.indexsearch");
function restget(obj) {
obj = JSON.parse(obj);
var index = obj.query.index.split(",");
index = typeof(index) == "string" ? [index] : index;
indexsearch.runIndexer(index);
obj.response.body = "index(es) requested for rebuild:\n" + index.reduce(function (l, r){
return l + "\n > " + r;
}, "");
obj = JSON.stringify(obj);
return obj;
}
<?xml version="1.0" encoding="UTF-8"?>
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.7" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.1.7">
<name>runIndexer_ws</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<process>%aditoprj%/process/runIndexer_ws/process.js</process>
<publishAsWebservice v="true" />
<style>REST</style>
<loginTypeId>internal.none</loginTypeId>
<restrictedRoles />
</process>
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