Skip to content
Snippets Groups Projects
Commit a3623772 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Merge branch '#1058737-DublettenKonfiguration' into '2020.1'

#1058737 dubletten konfiguration

See merge request xrm/basic!292
parents 5e6f9fda 67386ac4
No related branches found
No related tags found
No related merge requests found
Showing
with 89 additions and 11 deletions
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<column name="FILTER_NAME" value="PersonDuplicates" /> <column name="FILTER_NAME" value="PersonDuplicates" />
<column name="EXTERNAL_SERVICE_USAGE_ALLOWED" valueNumeric="0" /> <column name="EXTERNAL_SERVICE_USAGE_ALLOWED" valueNumeric="0" />
<column name="ID_FIELD_NAME" value="CONTACTID" /> <column name="ID_FIELD_NAME" value="CONTACTID" />
<column name="SCAN_PATTERN" value="firstname:({&quot;entityfield&quot;: &quot;FIRSTNAME&quot;}) AND lastname:({&quot;entityfield&quot;: &quot;LASTNAME&quot;})" /> <column name="SCAN_PATTERN" value="{&quot;entity&quot;:&quot;Person_entity&quot;,&quot;provider&quot;:&quot;indexP&quot;,&quot;filter&quot;:{&quot;type&quot;:&quot;group&quot;,&quot;operator&quot;:&quot;AND&quot;,&quot;childs&quot;:[{&quot;type&quot;:&quot;row&quot;,&quot;name&quot;:&quot;FIRSTNAME&quot;,&quot;operator&quot;:&quot;ISNOTNULL&quot;,&quot;value&quot;:&quot;&quot;,&quot;key&quot;:&quot;&quot;,&quot;contenttype&quot;:&quot;TEXT&quot;},{&quot;type&quot;:&quot;row&quot;,&quot;name&quot;:&quot;LASTNAME&quot;,&quot;operator&quot;:&quot;ISNOTNULL&quot;,&quot;value&quot;:&quot;&quot;,&quot;key&quot;:&quot;&quot;,&quot;contenttype&quot;:&quot;TEXT&quot;}]}}" />
<column name="USER_NEW" value="Admin" /> <column name="USER_NEW" value="Admin" />
<column name="DATE_NEW" valueDate="2020-06-26T00:00:00" /> <column name="DATE_NEW" valueDate="2020-06-26T00:00:00" />
<column name="USER_EDIT" value="Admin" /> <column name="USER_EDIT" value="Admin" />
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<column name="FILTER_NAME" value="OrganisationDuplicates" /> <column name="FILTER_NAME" value="OrganisationDuplicates" />
<column name="EXTERNAL_SERVICE_USAGE_ALLOWED" valueNumeric="0" /> <column name="EXTERNAL_SERVICE_USAGE_ALLOWED" valueNumeric="0" />
<column name="ID_FIELD_NAME" value="CONTACTID" /> <column name="ID_FIELD_NAME" value="CONTACTID" />
<column name="SCAN_PATTERN" value="name:({&quot;entityfield&quot;: &quot;NAME&quot;, &quot;exclude&quot;: [&quot;gmbh&quot;, &quot;co&quot;, &quot;kg&quot;, &quot;ag&quot;, &quot;bank&quot;, &quot;deutsche&quot;, &quot;van&quot;, &quot;software&quot;, &quot;medien&quot;, &quot;print&quot;] }) AND city:({&quot;entityfield&quot;: &quot;STANDARD_CITY&quot;})" /> <column name="SCAN_PATTERN" value="{&quot;entity&quot;:&quot;Organisation_entity&quot;,&quot;provider&quot;:&quot;indexP&quot;,&quot;filter&quot;:{&quot;type&quot;:&quot;group&quot;,&quot;operator&quot;:&quot;AND&quot;,&quot;childs&quot;:[{&quot;type&quot;:&quot;row&quot;,&quot;name&quot;:&quot;NAME&quot;,&quot;operator&quot;:&quot;CONTAINSNOT&quot;,&quot;value&quot;:&quot;[\&quot;gmbh\&quot;, \&quot;co\&quot;, \&quot;kg\&quot;, \&quot;ag\&quot;, \&quot;bank\&quot;, \&quot;deutsche\&quot;, \&quot;van\&quot;, \&quot;software\&quot;, \&quot;medien\&quot;, \&quot;print\&quot;]&quot;,&quot;key&quot;:&quot;[\&quot;gmbh\&quot;, \&quot;co\&quot;, \&quot;kg\&quot;, \&quot;ag\&quot;, \&quot;bank\&quot;, \&quot;deutsche\&quot;, \&quot;van\&quot;, \&quot;software\&quot;, \&quot;medien\&quot;, \&quot;print\&quot;]&quot;,&quot;contenttype&quot;:&quot;LONG_TEXT&quot;},{&quot;type&quot;:&quot;row&quot;,&quot;name&quot;:&quot;STANDARD_CITY&quot;,&quot;operator&quot;:&quot;ISNOTNULL&quot;,&quot;value&quot;:&quot;&quot;,&quot;key&quot;:&quot;&quot;,&quot;contenttype&quot;:&quot;TEXT&quot;}]}}" />
<column name="USER_NEW" value="Admin" /> <column name="USER_NEW" value="Admin" />
<column name="DATE_NEW" valueDate="2020-06-26T00:00:00" /> <column name="DATE_NEW" valueDate="2020-06-26T00:00:00" />
<column name="USER_EDIT" value="Admin" /> <column name="USER_EDIT" value="Admin" />
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<entityField> <entityField>
<name>ENTITY_TO_SCAN_NAME</name> <name>ENTITY_TO_SCAN_NAME</name>
<title>Target Entity</title> <title>Target Entity</title>
<stateProcess>%aditoprj%/entity/DuplicateScanner_entity/entityfields/entity_to_scan_name/stateProcess.js</stateProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>UID</name> <name>UID</name>
...@@ -64,7 +65,9 @@ ...@@ -64,7 +65,9 @@
<entityField> <entityField>
<name>SCAN_PATTERN</name> <name>SCAN_PATTERN</name>
<title>Scan pattern</title> <title>Scan pattern</title>
<contentType>LONG_TEXT</contentType> <contentType>FILTER_TREE</contentType>
<state>AUTO</state>
<stateProcess>%aditoprj%/entity/DuplicateScanner_entity/entityfields/scan_pattern/stateProcess.js</stateProcess>
</entityField> </entityField>
<entityConsumer> <entityConsumer>
<name>ScannerResultFieldsConfig_Consumer</name> <name>ScannerResultFieldsConfig_Consumer</name>
...@@ -100,6 +103,8 @@ ...@@ -100,6 +103,8 @@
<dbRecordContainer> <dbRecordContainer>
<name>DBRecordContainer</name> <name>DBRecordContainer</name>
<alias>Data_alias</alias> <alias>Data_alias</alias>
<onDBInsert>%aditoprj%/entity/DuplicateScanner_entity/recordcontainers/dbrecordcontainer/onDBInsert.js</onDBInsert>
<onDBUpdate>%aditoprj%/entity/DuplicateScanner_entity/recordcontainers/dbrecordcontainer/onDBUpdate.js</onDBUpdate>
<onDBDelete>%aditoprj%/entity/DuplicateScanner_entity/recordcontainers/dbrecordcontainer/onDBDelete.js</onDBDelete> <onDBDelete>%aditoprj%/entity/DuplicateScanner_entity/recordcontainers/dbrecordcontainer/onDBDelete.js</onDBDelete>
<linkInformation> <linkInformation>
<linkInformation> <linkInformation>
......
import("system.neon");
import("system.result");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) {
result.string(neon.COMPONENTSTATE_EDITABLE);
} else {
result.string(neon.COMPONENTSTATE_READONLY);
}
\ No newline at end of file
import("system.neon");
import("system.result");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) {
result.string(neon.COMPONENTSTATE_INVISIBLE);
} else {
result.string(neon.COMPONENTSTATE_EDITABLE);
}
\ No newline at end of file
import("Sql_lib");
import("system.neon");
import("system.vars");
var rowdata = vars.get("$local.rowdata");
newWhere("DUPLICATESCANNER.ID", rowdata["DUPLICATESCANNER.ID"])
.updateFields({"DUPLICATESCANNER.SCAN_PATTERN" : JSON.stringify({entity: "" + rowdata["DUPLICATESCANNER.ENTITY_TO_SCAN_NAME"] + "", provider: "indexP", filter: {type: "group", operator: "AND", childs: []}})}, "DUPLICATESCANNER");
\ No newline at end of file
import("system.vars");
var rowdata = vars.get("$local.rowdata");
let scanPattern = JSON.parse(rowdata["DUPLICATESCANNER.SCAN_PATTERN"]);
if (scanPattern.provider == undefined)
{
scanPattern.provider = "indexP";
vars.set("$field.SCAN_PATTERN", JSON.stringify(scanPattern));
}
\ No newline at end of file
...@@ -1114,6 +1114,10 @@ ...@@ -1114,6 +1114,10 @@
<parentField>COUNT</parentField> <parentField>COUNT</parentField>
<title>Count</title> <title>Count</title>
</entityAggregateField> </entityAggregateField>
<entityProvider>
<name>indexP</name>
<recordContainer>index</recordContainer>
</entityProvider>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
......
...@@ -131,11 +131,6 @@ ...@@ -131,11 +131,6 @@
<entityName>PermissionMetaData_entity</entityName> <entityName>PermissionMetaData_entity</entityName>
<fieldName>MetaData</fieldName> <fieldName>MetaData</fieldName>
</dependency> </dependency>
<children>
<entityParameter>
<name>EntityName_param</name>
</entityParameter>
</children>
</entityConsumer> </entityConsumer>
<entityParameter> <entityParameter>
<name>EntityTitle_param</name> <name>EntityTitle_param</name>
......
...@@ -1277,6 +1277,10 @@ ...@@ -1277,6 +1277,10 @@
<parentField>COUNT</parentField> <parentField>COUNT</parentField>
<title>Count</title> <title>Count</title>
</entityAggregateField> </entityAggregateField>
<entityProvider>
<name>indexP</name>
<recordContainer>index</recordContainer>
</entityProvider>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<entityField>ENTITY_TO_SCAN_NAME</entityField> <entityField>ENTITY_TO_SCAN_NAME</entityField>
</entityFieldLink> </entityFieldLink>
<entityFieldLink> <entityFieldLink>
<name>a0eefe38-cd65-432e-819b-e108f44db7f2</name> <name>840dda8e-0a7a-4c09-80d1-f7cec15b49fc</name>
<entityField>ID_FIELD_NAME</entityField> <entityField>ID_FIELD_NAME</entityField>
</entityFieldLink> </entityFieldLink>
<entityFieldLink> <entityFieldLink>
......
...@@ -883,15 +883,49 @@ _DuplicateScannerUtils._buildUpdateResetStandardCommunications = function(pSourc ...@@ -883,15 +883,49 @@ _DuplicateScannerUtils._buildUpdateResetStandardCommunications = function(pSourc
*/ */
_DuplicateScannerUtils._loadIndexPattern = function(pScannerName, pTargetEntity) _DuplicateScannerUtils._loadIndexPattern = function(pScannerName, pTargetEntity)
{ {
let scanPattern = newSelect("SCAN_PATTERN") let scanPattern = _DuplicateScannerUtils._filterToScanPattern( newSelect("SCAN_PATTERN")
.from("DUPLICATESCANNER") .from("DUPLICATESCANNER")
.where("DUPLICATESCANNER.FILTER_NAME", pScannerName) .where("DUPLICATESCANNER.FILTER_NAME", pScannerName)
.and("DUPLICATESCANNER.ENTITY_TO_SCAN_NAME", pTargetEntity) .and("DUPLICATESCANNER.ENTITY_TO_SCAN_NAME", pTargetEntity)
.cell(); .cell());
scanPattern = scanPattern.trim(); scanPattern = scanPattern.trim();
return scanPattern; return scanPattern;
} }
_DuplicateScannerUtils._filterToScanPattern = function(filterString) {
let filter = JSON.parse(filterString);
return _DuplicateScannerUtils._filterChildsToScanPattern(filter.filter.childs, filter.filter.operator);
}
_DuplicateScannerUtils._filterChildsToScanPattern = function(childs, operator) {
let group = "";
for (let i = 0; i < childs.length; i++) {
if (group != ""){
group = group + " " + operator+ " ";
}
if (childs[i].type == "row"){
group = group + _DuplicateScannerUtils._filterChildsRowToScanPattern(childs[i].name, childs[i].operator, childs[i].value);
} else if (childs[i].type == "group") {
group = group + "(" + _DuplicateScannerUtils._filterChildsToScanPattern(childs[i].childs, childs[i].operator) + ")";
}
}
return group;
}
_DuplicateScannerUtils._filterChildsRowToScanPattern = function (name, operator, value) {
let row = "";
row = row + name.toLowerCase() + ':({"entityfield":"' + name + '"';
switch (operator){
case 'NOT_EQUAL':
row = row + ', "exclude":' + JSON.parse(value);
case 'ISNOTNULL':
row = row + ', "empty":' + false;
}
row = row + '})';
return row;
}
_DuplicateScannerUtils._loadEntityFieldConfigsFromPattern = function(indexPattern) _DuplicateScannerUtils._loadEntityFieldConfigsFromPattern = function(indexPattern)
{ {
return indexPattern.match(/[^{}]+(?=\})/g); return indexPattern.match(/[^{}]+(?=\})/g);
......
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