From d7d9b8896653b3e2c17ed50e1a87b676f0dfef8e Mon Sep 17 00:00:00 2001 From: Sebastian Listl <s.listl@adito.de> Date: Wed, 30 Sep 2020 16:19:33 +0200 Subject: [PATCH] DuplicateScanner_lib methods renamed to match coding guidelines --- .../onActionProcess.js | 4 +- .../onActionProcess.js | 4 +- .../testduplicatescanner/onActionProcess.js | 16 +++---- .../ignorewholecluster/onActionProcess.js | 4 +- .../onlyshowcontactids_param/valueProcess.js | 2 +- .../onlyshowcontactids_param/valueProcess.js | 2 +- .../ignoreduplicate/onActionProcess.js | 4 +- .../ignorewholecluster/onActionProcess.js | 6 +-- .../excludedcontactids_param/valueProcess.js | 2 +- .../onlyshowcontactids_param/valueProcess.js | 2 +- .../ignoreduplicate/onActionProcess.js | 4 +- .../ignorewholecluster/onActionProcess.js | 6 +-- .../excludedcontactids_param/valueProcess.js | 2 +- .../onlyshowcontactids_param/valueProcess.js | 2 +- .../recordcontainers/db/onDBInsert.js | 2 +- .../children/contactids_param/valueProcess.js | 2 +- process/DuplicateScanner_lib/process.js | 48 +++++++++---------- process/JditoFilter_lib/process.js | 7 +-- process/Leadimport_lib/process.js | 4 +- .../process.js | 8 ++-- .../process.js | 4 +- 21 files changed, 68 insertions(+), 67 deletions(-) diff --git a/entity/DuplicateScanner_entity/entityfields/runactiongroup/children/rebuildorganisationduplicatescache/onActionProcess.js b/entity/DuplicateScanner_entity/entityfields/runactiongroup/children/rebuildorganisationduplicatescache/onActionProcess.js index bbe3de91390..e391b4c1938 100644 --- a/entity/DuplicateScanner_entity/entityfields/runactiongroup/children/rebuildorganisationduplicatescache/onActionProcess.js +++ b/entity/DuplicateScanner_entity/entityfields/runactiongroup/children/rebuildorganisationduplicatescache/onActionProcess.js @@ -7,12 +7,12 @@ var targetEntity = "Organisation_entity"; var recordBlockSize = DuplicateScannerUtils.getBlockSize(); logging.log(filterName + ": Delete duplicates -> "); -DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity(targetEntity); +DuplicateScannerUtils.deleteClustersByTargetEntity(targetEntity); logging.log(filterName + ": Recalculate duplicates -> "); DuplicateScannerUtils.rebuildDuplicatesCache(filterName, targetEntity, recordBlockSize, null); logging.log(filterName + ": Refresh unrelated duplicates -> "); -DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity); +DuplicateScannerUtils.refreshUnrelatedDuplicateRelations(targetEntity); logging.log(filterName + ": Done rebuilding "); \ No newline at end of file diff --git a/entity/DuplicateScanner_entity/entityfields/runactiongroup/children/rebuildpersonduplicatescache/onActionProcess.js b/entity/DuplicateScanner_entity/entityfields/runactiongroup/children/rebuildpersonduplicatescache/onActionProcess.js index 4b3d2c9bc67..cad87363823 100644 --- a/entity/DuplicateScanner_entity/entityfields/runactiongroup/children/rebuildpersonduplicatescache/onActionProcess.js +++ b/entity/DuplicateScanner_entity/entityfields/runactiongroup/children/rebuildpersonduplicatescache/onActionProcess.js @@ -7,12 +7,12 @@ var targetEntity = "Person_entity"; var recordBlockSize = DuplicateScannerUtils.getBlockSize(); logging.log(filterName + ": Delete duplicates -> "); -DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity(targetEntity); +DuplicateScannerUtils.deleteClustersByTargetEntity(targetEntity); logging.log(filterName + ": Recalculate duplicates -> "); DuplicateScannerUtils.rebuildDuplicatesCache(filterName, targetEntity, recordBlockSize, null); logging.log(filterName + ": Refresh unrelated duplicates -> "); -DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity); +DuplicateScannerUtils.refreshUnrelatedDuplicateRelations(targetEntity); logging.log(filterName + ": Done rebuilding "); \ No newline at end of file diff --git a/entity/DuplicateScanner_entity/entityfields/testactiongroup/children/testduplicatescanner/onActionProcess.js b/entity/DuplicateScanner_entity/entityfields/testactiongroup/children/testduplicatescanner/onActionProcess.js index 47a4d2b39f3..af7cd56a247 100644 --- a/entity/DuplicateScanner_entity/entityfields/testactiongroup/children/testduplicatescanner/onActionProcess.js +++ b/entity/DuplicateScanner_entity/entityfields/testactiongroup/children/testduplicatescanner/onActionProcess.js @@ -162,13 +162,13 @@ import("JditoFilter_lib"); //var tmpFieldsInFilterRay = ["CONTACTID", "FIRSTNAME", "LASTNAME", "GENDER"]; // //logging.log("Löschen von PERSON Dubletten -> "); -//DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity("Person_entity"); +//DuplicateScannerUtils.deleteClustersByTargetEntity("Person_entity"); // //logging.log("Neu berechnen von PERSON Dubletten -> "); //DuplicateScannerUtils.rebuildDuplicatesCache(filterName, targetEntity, queryPersonContactIds, //tmpFieldsInFilterRay, resultFieldsIdFieldName); // -//DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity); +//DuplicateScannerUtils.refreshUnrelatedDuplicateRelations(targetEntity); //############################################################################## @@ -182,13 +182,13 @@ import("JditoFilter_lib"); // // //logging.log("Löschen von ORGANISATION Dubletten -> "); -//DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity(targetEntity) +//DuplicateScannerUtils.deleteClustersByTargetEntity(targetEntity) // //logging.log("Neu berechnen von ORGANISATION Dubletten -> "); //DuplicateScannerUtils.rebuildDuplicatesCache(filterName, targetEntity, queryPersonContactIds, //tmpFieldsInFilterRay, resultFieldsIdFieldName); // -//DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity); +//DuplicateScannerUtils.refreshUnrelatedDuplicateRelations(targetEntity); //####################################Rebuild person duplicates########################################## @@ -210,11 +210,11 @@ import("JditoFilter_lib"); // + " left join ADDRESS on ADDRESS.CONTACT_ID = CONTACT.CONTACTID"; // //logging.log("Löschen von PERSON Dubletten -> "); -//DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity(targetEntity); +//DuplicateScannerUtils.deleteClustersByTargetEntity(targetEntity); // //let formatToJsonAndCallWsCallback = function(pPossibleDuplicatesRay) //{ -// let indexResultFields = DuplicateScannerUtils.TranslateEntityToIndexFields(targetEntity, resultFields) +// let indexResultFields = DuplicateScannerUtils.translateEntityToIndexFields(targetEntity, resultFields) // // //Run thru every duplicate result an read out the resultfields // for (let i = 0; i < pPossibleDuplicatesRay.length; i++) @@ -236,7 +236,7 @@ import("JditoFilter_lib"); //DuplicateScannerUtils.rebuildDuplicatesCache(filterName, targetEntity, queryPersonFieldData, //duplicateFieldsConfig, resultFields, formatToJsonAndCallWsCallback); // -//DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity); +//DuplicateScannerUtils.refreshUnrelatedDuplicateRelations(targetEntity); @@ -255,7 +255,7 @@ import("JditoFilter_lib"); //valuesToCheck["GENDER"] = "m "; // ////The result values can be accessed as seen above in "formatToJsonAndCallWsCallback" -//let pPossibleDuplicatesRay = DuplicateScannerUtils.ScanForDuplicates(filterName, targetEntity, valuesToCheck, null); +//let pPossibleDuplicatesRay = DuplicateScannerUtils.scanForDuplicates(filterName, targetEntity, valuesToCheck, null); // //logging.log(" pPossibleDuplicatesRay-> " + pPossibleDuplicatesRay); // diff --git a/entity/Duplicates_entity/entityfields/duplicateclusteractiongroup/children/ignorewholecluster/onActionProcess.js b/entity/Duplicates_entity/entityfields/duplicateclusteractiongroup/children/ignorewholecluster/onActionProcess.js index 115c4e363f0..77822dbca04 100644 --- a/entity/Duplicates_entity/entityfields/duplicateclusteractiongroup/children/ignorewholecluster/onActionProcess.js +++ b/entity/Duplicates_entity/entityfields/duplicateclusteractiongroup/children/ignorewholecluster/onActionProcess.js @@ -6,14 +6,14 @@ import("system.notification"); let clusterId = vars.get("$sys.selection"); -let duplicateContactIdsInClusterRay = DuplicateScannerUtils.GetCachedDuplicatesForClusterId(clusterId) +let duplicateContactIdsInClusterRay = DuplicateScannerUtils.getCachedDuplicatesForClusterId(clusterId) if(duplicateContactIdsInClusterRay.length > 1) { let referenceDuplicateId = duplicateContactIdsInClusterRay[0]; for (let i = 1; i < duplicateContactIdsInClusterRay.length; i++) { - DuplicateScannerUtils.CreateUnrelatedDuplicateRelation(referenceDuplicateId, duplicateContactIdsInClusterRay[i], clusterId); + DuplicateScannerUtils.createUnrelatedDuplicateRelation(referenceDuplicateId, duplicateContactIdsInClusterRay[i], clusterId); } //notification.createConfig().notificationType(notification.t) //neon.refresh(["$field.SelfPersonDuplicatesConsumer"]) diff --git a/entity/Duplicates_entity/entityfields/duplicateorganisationsconsumer/children/onlyshowcontactids_param/valueProcess.js b/entity/Duplicates_entity/entityfields/duplicateorganisationsconsumer/children/onlyshowcontactids_param/valueProcess.js index 918a8f2f261..ecb8c518cd4 100644 --- a/entity/Duplicates_entity/entityfields/duplicateorganisationsconsumer/children/onlyshowcontactids_param/valueProcess.js +++ b/entity/Duplicates_entity/entityfields/duplicateorganisationsconsumer/children/onlyshowcontactids_param/valueProcess.js @@ -5,7 +5,7 @@ import("DuplicateScanner_lib"); let clusterRecordId = vars.get("$field.UID"); -let contactIdsInCluster = DuplicateScannerUtils.GetCachedDuplicatesForClusterId(clusterRecordId); +let contactIdsInCluster = DuplicateScannerUtils.getCachedDuplicatesForClusterId(clusterRecordId); /* * To achieve that if there are no duplicates, no contacts should be shown and therefore returned by the diff --git a/entity/Duplicates_entity/entityfields/duplicatepersonsconsumer/children/onlyshowcontactids_param/valueProcess.js b/entity/Duplicates_entity/entityfields/duplicatepersonsconsumer/children/onlyshowcontactids_param/valueProcess.js index 918a8f2f261..ecb8c518cd4 100644 --- a/entity/Duplicates_entity/entityfields/duplicatepersonsconsumer/children/onlyshowcontactids_param/valueProcess.js +++ b/entity/Duplicates_entity/entityfields/duplicatepersonsconsumer/children/onlyshowcontactids_param/valueProcess.js @@ -5,7 +5,7 @@ import("DuplicateScanner_lib"); let clusterRecordId = vars.get("$field.UID"); -let contactIdsInCluster = DuplicateScannerUtils.GetCachedDuplicatesForClusterId(clusterRecordId); +let contactIdsInCluster = DuplicateScannerUtils.getCachedDuplicatesForClusterId(clusterRecordId); /* * To achieve that if there are no duplicates, no contacts should be shown and therefore returned by the diff --git a/entity/Organisation_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js b/entity/Organisation_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js index 3debf6e5a41..c9289cbd0ef 100644 --- a/entity/Organisation_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js +++ b/entity/Organisation_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js @@ -4,7 +4,7 @@ import("DuplicateScanner_lib"); let sourceContactId = vars.get("$param.DuplicateCurrentContactId_param"); let selectedContactId = vars.get("$sys.selection"); -let clusterId = DuplicateScannerUtils.GetClusterId(sourceContactId); -DuplicateScannerUtils.CreateUnrelatedDuplicateRelation(sourceContactId, selectedContactId, clusterId); +let clusterId = DuplicateScannerUtils.getClusterId(sourceContactId); +DuplicateScannerUtils.createUnrelatedDuplicateRelation(sourceContactId, selectedContactId, clusterId); neon.refreshAll(); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/duplicateactions/children/ignorewholecluster/onActionProcess.js b/entity/Organisation_entity/entityfields/duplicateactions/children/ignorewholecluster/onActionProcess.js index 7b3385b5bb2..99d7f55925b 100644 --- a/entity/Organisation_entity/entityfields/duplicateactions/children/ignorewholecluster/onActionProcess.js +++ b/entity/Organisation_entity/entityfields/duplicateactions/children/ignorewholecluster/onActionProcess.js @@ -5,16 +5,16 @@ import("DuplicateScanner_lib"); import("system.notification"); let contactId = vars.get("$field.CONTACTID"); -let clusterId = DuplicateScannerUtils.GetClusterId(contactId); +let clusterId = DuplicateScannerUtils.getClusterId(contactId); -let duplicateContactIdsInClusterRay = DuplicateScannerUtils.GetCachedDuplicatesForClusterId(clusterId) +let duplicateContactIdsInClusterRay = DuplicateScannerUtils.getCachedDuplicatesForClusterId(clusterId) if(duplicateContactIdsInClusterRay.length > 1) { let referenceDuplicateId = duplicateContactIdsInClusterRay[0]; for (let i = 1; i < duplicateContactIdsInClusterRay.length; i++) { - DuplicateScannerUtils.CreateUnrelatedDuplicateRelation(referenceDuplicateId, duplicateContactIdsInClusterRay[i], clusterId); + DuplicateScannerUtils.createUnrelatedDuplicateRelation(referenceDuplicateId, duplicateContactIdsInClusterRay[i], clusterId); } } diff --git a/entity/Organisation_entity/entityfields/selfduplicatesuncached/children/excludedcontactids_param/valueProcess.js b/entity/Organisation_entity/entityfields/selfduplicatesuncached/children/excludedcontactids_param/valueProcess.js index 30b7732937f..849632882bb 100644 --- a/entity/Organisation_entity/entityfields/selfduplicatesuncached/children/excludedcontactids_param/valueProcess.js +++ b/entity/Organisation_entity/entityfields/selfduplicatesuncached/children/excludedcontactids_param/valueProcess.js @@ -3,5 +3,5 @@ import("system.vars"); import("system.result"); import("DuplicateScanner_lib"); -let unrelatedIds = DuplicateScannerUtils.GetUnrelatedRelationsForDuplicate(vars.get("$field.CONTACTID")); +let unrelatedIds = DuplicateScannerUtils.getUnrelatedRelationsForDuplicate(vars.get("$field.CONTACTID")); result.string(JSON.stringify(unrelatedIds)); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/selfduplicatesuncached/children/onlyshowcontactids_param/valueProcess.js b/entity/Organisation_entity/entityfields/selfduplicatesuncached/children/onlyshowcontactids_param/valueProcess.js index 27d043515ab..77f449d52a0 100644 --- a/entity/Organisation_entity/entityfields/selfduplicatesuncached/children/onlyshowcontactids_param/valueProcess.js +++ b/entity/Organisation_entity/entityfields/selfduplicatesuncached/children/onlyshowcontactids_param/valueProcess.js @@ -36,7 +36,7 @@ else //don't search if only the id field has a value var fieldsToCheck = Object.keys(valuesToCheck); if (!(fieldsToCheck.length === 0 || (fieldsToCheck.length === 1 && entityFieldsToLoad.entityIdField in valuesToCheck))) - scanResults = DuplicateScannerUtils.ScanForDuplicates(scannerName, targetEntity, valuesToCheck, null) || []; + scanResults = DuplicateScannerUtils.scanForDuplicates(scannerName, targetEntity, valuesToCheck, null) || []; var duplicateIds = scanResults.map(function (scanResult) { diff --git a/entity/Person_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js b/entity/Person_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js index 3debf6e5a41..c9289cbd0ef 100644 --- a/entity/Person_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js +++ b/entity/Person_entity/entityfields/duplicateactions/children/ignoreduplicate/onActionProcess.js @@ -4,7 +4,7 @@ import("DuplicateScanner_lib"); let sourceContactId = vars.get("$param.DuplicateCurrentContactId_param"); let selectedContactId = vars.get("$sys.selection"); -let clusterId = DuplicateScannerUtils.GetClusterId(sourceContactId); -DuplicateScannerUtils.CreateUnrelatedDuplicateRelation(sourceContactId, selectedContactId, clusterId); +let clusterId = DuplicateScannerUtils.getClusterId(sourceContactId); +DuplicateScannerUtils.createUnrelatedDuplicateRelation(sourceContactId, selectedContactId, clusterId); neon.refreshAll(); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/duplicateactions/children/ignorewholecluster/onActionProcess.js b/entity/Person_entity/entityfields/duplicateactions/children/ignorewholecluster/onActionProcess.js index 7369a35ba74..f74997cb1d7 100644 --- a/entity/Person_entity/entityfields/duplicateactions/children/ignorewholecluster/onActionProcess.js +++ b/entity/Person_entity/entityfields/duplicateactions/children/ignorewholecluster/onActionProcess.js @@ -6,16 +6,16 @@ import("system.notification"); let contactId = vars.get("$field.CONTACTID"); logging.log("contactId -> " + contactId); -let clusterId = DuplicateScannerUtils.GetClusterId(contactId); +let clusterId = DuplicateScannerUtils.getClusterId(contactId); logging.log("clusterId -> " + clusterId); -let duplicateContactIdsInClusterRay = DuplicateScannerUtils.GetCachedDuplicatesForClusterId(clusterId) +let duplicateContactIdsInClusterRay = DuplicateScannerUtils.getCachedDuplicatesForClusterId(clusterId) logging.log("duplicateContactIdsInClusterRay -> " + duplicateContactIdsInClusterRay); if(duplicateContactIdsInClusterRay.length > 1) { let referenceDuplicateId = duplicateContactIdsInClusterRay[0]; for (let i = 1; i < duplicateContactIdsInClusterRay.length; i++) { - DuplicateScannerUtils.CreateUnrelatedDuplicateRelation(referenceDuplicateId, duplicateContactIdsInClusterRay[i], clusterId); + DuplicateScannerUtils.createUnrelatedDuplicateRelation(referenceDuplicateId, duplicateContactIdsInClusterRay[i], clusterId); } neon.refreshAll(); diff --git a/entity/Person_entity/entityfields/selfduplicatesuncached/children/excludedcontactids_param/valueProcess.js b/entity/Person_entity/entityfields/selfduplicatesuncached/children/excludedcontactids_param/valueProcess.js index 30b7732937f..849632882bb 100644 --- a/entity/Person_entity/entityfields/selfduplicatesuncached/children/excludedcontactids_param/valueProcess.js +++ b/entity/Person_entity/entityfields/selfduplicatesuncached/children/excludedcontactids_param/valueProcess.js @@ -3,5 +3,5 @@ import("system.vars"); import("system.result"); import("DuplicateScanner_lib"); -let unrelatedIds = DuplicateScannerUtils.GetUnrelatedRelationsForDuplicate(vars.get("$field.CONTACTID")); +let unrelatedIds = DuplicateScannerUtils.getUnrelatedRelationsForDuplicate(vars.get("$field.CONTACTID")); result.string(JSON.stringify(unrelatedIds)); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/selfduplicatesuncached/children/onlyshowcontactids_param/valueProcess.js b/entity/Person_entity/entityfields/selfduplicatesuncached/children/onlyshowcontactids_param/valueProcess.js index ce8253a306e..8fa370156ea 100644 --- a/entity/Person_entity/entityfields/selfduplicatesuncached/children/onlyshowcontactids_param/valueProcess.js +++ b/entity/Person_entity/entityfields/selfduplicatesuncached/children/onlyshowcontactids_param/valueProcess.js @@ -41,7 +41,7 @@ else //don't search if only the id field has a value var fieldsToCheck = Object.keys(valuesToCheck); if (!(fieldsToCheck.length === 0 || (fieldsToCheck.length === 1 && entityFieldsToLoad.entityIdField in valuesToCheck))) - scanResults = DuplicateScannerUtils.ScanForDuplicates(scannerName, targetEntity, valuesToCheck, null) || []; + scanResults = DuplicateScannerUtils.scanForDuplicates(scannerName, targetEntity, valuesToCheck, null) || []; var duplicateIds = scanResults.map(function (duplicate) { diff --git a/entity/Person_entity/recordcontainers/db/onDBInsert.js b/entity/Person_entity/recordcontainers/db/onDBInsert.js index 8a497d507eb..3385c553d10 100644 --- a/entity/Person_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Person_entity/recordcontainers/db/onDBInsert.js @@ -36,7 +36,7 @@ WorkflowSignalSender.inserted(); // } //} // -//let scanResults = DuplicateScannerUtils.ScanForDuplicates("PersonDuplicates", targetEntity, +//let scanResults = DuplicateScannerUtils.scanForDuplicates("PersonDuplicates", targetEntity, //valuesToCheck, null); // ////If we found duplicates, cache them diff --git a/entity/QuickEntry_entity/entityfields/organdpersduplicates/children/contactids_param/valueProcess.js b/entity/QuickEntry_entity/entityfields/organdpersduplicates/children/contactids_param/valueProcess.js index 206a4b979fd..68ef6879ab4 100644 --- a/entity/QuickEntry_entity/entityfields/organdpersduplicates/children/contactids_param/valueProcess.js +++ b/entity/QuickEntry_entity/entityfields/organdpersduplicates/children/contactids_param/valueProcess.js @@ -77,7 +77,7 @@ function _getDuplicates (pScannerName, pEntity, pEntityFieldValues) if (fieldsToCheck.length === 0 || (fieldsToCheck.length === 1 && fieldsToLoad.entityIdField in valuesToCheck)) return []; - var scanResults = DuplicateScannerUtils.ScanForDuplicates(pScannerName, pEntity, valuesToCheck, null) || []; + var scanResults = DuplicateScannerUtils.scanForDuplicates(pScannerName, pEntity, valuesToCheck, null) || []; var duplicateIds = scanResults.map(function (duplicate) { return duplicate[indexsearch.FIELD_ID]; diff --git a/process/DuplicateScanner_lib/process.js b/process/DuplicateScanner_lib/process.js index c0f1880e5b0..e85d22cd516 100644 --- a/process/DuplicateScanner_lib/process.js +++ b/process/DuplicateScanner_lib/process.js @@ -76,7 +76,7 @@ DuplicateScannerUtils.deleteCachedDuplicate = function(pDuplicateId) newWhereIfSet("DUPLICATECLUSTERS.DUPLICATEID", pDuplicateId).deleteData(); //Delete all records where this duplicateId is mentioned - DuplicateScannerUtils.DeleteAllUnrelatedDuplicateRelations(pDuplicateId); + DuplicateScannerUtils.deleteAllUnrelatedDuplicateRelations(pDuplicateId); } } @@ -87,7 +87,7 @@ DuplicateScannerUtils.deleteCachedDuplicate = function(pDuplicateId) * @param {String} pTargetEntity Entity which has been configured * @return Count of deleted rows */ -DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity = function(pTargetEntity) +DuplicateScannerUtils.deleteClustersByTargetEntity = function(pTargetEntity) { return newWhereIfSet("DUPLICATECLUSTERS.TARGET_ENTITY", pTargetEntity).deleteData(); } @@ -101,7 +101,7 @@ DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity = function(pTargetEn * * @param {String} pTargetEntity Name of Entity whose duplicates should be updated */ -DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations = function(pTargetEntity) +DuplicateScannerUtils.refreshUnrelatedDuplicateRelations = function(pTargetEntity) { /* * Update all records with the current valid clusterId where the same duplicateId combination exists @@ -133,14 +133,14 @@ DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations = function(pTargetEntit /* * Creates a relation between two duplicates which means they are unrelated. * They will not appear in each others duplicate tab any more. - * To remove this relation use DuplicateScannerUtils.DeleteUnrelatedDuplicateRelation + * To remove this relation use DuplicateScannerUtils.deleteUnrelatedDuplicateRelation * * @param {String} pSourceContactId Id of first duplicate * @param {String} pUnrelatedContactId Id of second duplicate * @param {String} pClusterId Id of the cluster in which the duplicates are aggregated * @returns {String} Number of Records inserted */ -DuplicateScannerUtils.CreateUnrelatedDuplicateRelation = function(pSourceContactId, pUnrelatedContactId, pClusterId) +DuplicateScannerUtils.createUnrelatedDuplicateRelation = function(pSourceContactId, pUnrelatedContactId, pClusterId) { return new SqlBuilder().insertFields({ "UNRELATEDDUPLICATEID": pUnrelatedContactId, @@ -155,7 +155,7 @@ DuplicateScannerUtils.CreateUnrelatedDuplicateRelation = function(pSourceContact * @param {String} pDuplicateId whose cluster id should be searched * @returns {String} Cluster id */ -DuplicateScannerUtils.GetClusterId = function(pDuplicateId) +DuplicateScannerUtils.getClusterId = function(pDuplicateId) { return newSelect("CLUSTERID") .from("DUPLICATECLUSTERS") @@ -170,7 +170,7 @@ DuplicateScannerUtils.GetClusterId = function(pDuplicateId) * @param {String} pUnrelatedDuplicateId Id of the source duplicate * @returns {String} Number of records deleted */ -DuplicateScannerUtils.DeleteUnrelatedDuplicateRelation = function(pSourceDuplicateId, pUnrelatedDuplicateId) +DuplicateScannerUtils.deleteUnrelatedDuplicateRelation = function(pSourceDuplicateId, pUnrelatedDuplicateId) { return newWhere("UNRELATEDDUPLICATES.SOURCEDUPLICATEID", pSourceDuplicateId) .and("UNRELATEDDUPLICATES.UNRELATEDDUPLICATEID", pUnrelatedDuplicateId) @@ -183,9 +183,9 @@ DuplicateScannerUtils.DeleteUnrelatedDuplicateRelation = function(pSourceDuplica * @param {String} pDuplicateId Duplicate id whose "unrelated" relations are to delete * @returns {String} Number of records deleted */ -DuplicateScannerUtils.DeleteAllUnrelatedDuplicateRelations = function(pDuplicateId) +DuplicateScannerUtils.deleteAllUnrelatedDuplicateRelations = function(pDuplicateId) { - DuplicateScannerUtils.DeleteUnrelatedDuplicateRelation(pDuplicateId, pDuplicateId); + DuplicateScannerUtils.deleteUnrelatedDuplicateRelation(pDuplicateId, pDuplicateId); } /* @@ -194,7 +194,7 @@ DuplicateScannerUtils.DeleteAllUnrelatedDuplicateRelations = function(pDuplicate * @param {String} pDuplicateId * @returns {String[]} Array of duplicate ids */ -DuplicateScannerUtils.GetCachedDuplicatesForDuplicateId = function(pDuplicateId) +DuplicateScannerUtils.getCachedDuplicatesForDuplicateId = function(pDuplicateId) { return newSelect("DUPLICATEID") .from("DUPLICATECLUSTERS") @@ -220,7 +220,7 @@ DuplicateScannerUtils.GetCachedDuplicatesForDuplicateId = function(pDuplicateId) * @param {String} pClusterId The clusters id * @return {String[]} Array of duplicate ids excluding those marked as unrelated */ -DuplicateScannerUtils.GetCachedDuplicatesForClusterId = function(pClusterId) +DuplicateScannerUtils.getCachedDuplicatesForClusterId = function(pClusterId) { return newSelect("DUPLICATEID") .from("DUPLICATECLUSTERS") @@ -232,13 +232,13 @@ DuplicateScannerUtils.GetCachedDuplicatesForClusterId = function(pClusterId) /* * Recreates the cached duplicate clusters based on the configured pattern. <br /> - * The old clusters have to be deleted manually beforehand or by using "DeleteDuplicateClustersByTargetEntity".<br /> - * If there have already been ignored relations between duplicate records, it's advised to call "RefreshUnrelatedDuplicateRelations" after the recreation of the duplicates cache.<br /> + * The old clusters have to be deleted manually beforehand or by using "deleteClustersByTargetEntity".<br /> + * If there have already been ignored relations between duplicate records, it's advised to call "refreshUnrelatedDuplicateRelations" after the recreation of the duplicates cache.<br /> * Please check the documentation of the params on how to get the infos required.<br /> * <br /> * If the usage of an external webservice has been activated, the search will be executed beforehand and the results will then be given to the pFormatValuesConsumeWebserviceCallback via parameter.<br /> * To access the values it is advised to run thru the parameter like an array and access its value by key which is the index field name. The entity<br /> - * field names can be converted using DuplicateScannerUtils.TranslateEntityToIndexFields. For further infos see the example section below.<br /> + * field names can be converted using DuplicateScannerUtils.translateEntityToIndexFields. For further infos see the example section below.<br /> * <br /> * Attention!<br /> * If it is configured to use the external webservice callback the values have to be in the same format as they are in the parameter of the callback.<br /> @@ -334,7 +334,7 @@ DuplicateScannerUtils.scanRecords = function(pTargetEntity, pTargetRecordsData, var duplicatesToInsertQueries = []; for (let b = 0; b < pTargetRecordsData.length; b++) { - let entityFieldValuesRay = DuplicateScannerUtils.BuildEntityFieldConfigValueRays(pEntityFieldConfigs, pTargetRecordsData[b]); + let entityFieldValuesRay = DuplicateScannerUtils.buildEntityFieldConfigs(pEntityFieldConfigs, pTargetRecordsData[b]); //The first field in this Array must always be the configured id field. This is ensured using onValidation-logic let idValue = pTargetRecordsData[b][pEntityIdField]; @@ -490,11 +490,11 @@ DuplicateScannerUtils.getResultFields = function(pFilterName, pTargetEntity) *<br /> * If the usage of an external webservice has been activated, the result will then be given to the pFormatValuesConsumeWebserviceCallback via parameter.<br /> * To access the values it is advised to run thru the parameter like an array and access its value by key which is the index field name. The entity - * field names can be converted using DuplicateScannerUtils.TranslateEntityToIndexFields + * field names can be converted using DuplicateScannerUtils.translateEntityToIndexFields * <br /> * <br /> * Attention!<br /> - * If it's a single ScanForDuplicates call it doesn't matter what the callback returns because after the callback, no more modifications follow before + * If it's a single scanForDuplicates call it doesn't matter what the callback returns because after the callback, no more modifications follow before * returning the data.<br /> * If it's inside the RebuildCache the values have to be in the same format as the parameter * @@ -553,7 +553,7 @@ DuplicateScannerUtils.getResultFields = function(pFilterName, pTargetEntity) * DuplicateScannerUtils.ScanForDuplicates(filterName, targetEntity, valuesToCheck, * formatToJsonAndCallWsCallback); */ -DuplicateScannerUtils.ScanForDuplicates = function(pFilterName, pTargetEntity, pValuesToCheck, pFormatValuesConsumeWebserviceCallback) +DuplicateScannerUtils.scanForDuplicates = function(pFilterName, pTargetEntity, pValuesToCheck, pFormatValuesConsumeWebserviceCallback) { let useExternalWebservice = _DuplicateScannerUtils._isUseExternalWebservice(pFilterName, pTargetEntity); let resultFields = DuplicateScannerUtils.getResultFields(pFilterName, pTargetEntity); @@ -562,7 +562,7 @@ DuplicateScannerUtils.ScanForDuplicates = function(pFilterName, pTargetEntity, p let entityFieldConfigs = _DuplicateScannerUtils._loadEntityFieldConfigsFromPattern(indexPattern); let entityIdField = _DuplicateScannerUtils._loadEntityIdField(pFilterName, pTargetEntity); - let entityFieldConfigValuesRay = DuplicateScannerUtils.BuildEntityFieldConfigValueRays(entityFieldConfigs, pValuesToCheck); + let entityFieldConfigValuesRay = DuplicateScannerUtils.buildEntityFieldConfigs(entityFieldConfigs, pValuesToCheck); //The first field in this Array must always be the configured id field. let idValue = pValuesToCheck[entityIdField]; @@ -582,10 +582,10 @@ DuplicateScannerUtils.ScanForDuplicates = function(pFilterName, pTargetEntity, p * * @example * let entityResultFields = ["LASTNAME"]; - * let entityIndexFields = DuplicateScannerUtils.TranslateEntityToIndexFields("Person_entity", entityResultFields); + * let entityIndexFields = DuplicateScannerUtils.translateEntityToIndexFields("Person_entity", entityResultFields); * */ -DuplicateScannerUtils.TranslateEntityToIndexFields = function(pEntityName, pEntityFields) +DuplicateScannerUtils.translateEntityToIndexFields = function(pEntityName, pEntityFields) { let entityIndexFields = {}; for (let i = 0; i < pEntityFields.length; i++) @@ -711,7 +711,7 @@ DuplicateScannerUtils.mergeOrganisation = function(pSourceContactId, pTargetCont * * => ["{entityfield: FIRSTNAME}", "PETER"]] */ -DuplicateScannerUtils.BuildEntityFieldConfigValueRays = function(pDuplicateFieldsConfig, pTargetRecordData) +DuplicateScannerUtils.buildEntityFieldConfigs = function(pDuplicateFieldsConfig, pTargetRecordData) { let INDEX_CONFIG_ENTITY_FIELD = 0; let entityFieldConfigValuesRay = []; @@ -799,7 +799,7 @@ DuplicateScannerUtils.getEntityFieldObjectFromConfig = function (pFilterName, pT }; } -DuplicateScannerUtils.GetUnrelatedRelationsForDuplicate = function(pDuplicateId) +DuplicateScannerUtils.getUnrelatedRelationsForDuplicate = function(pDuplicateId) { let unrelatedIds = []; let duplicateIds = newSelect("SOURCEDUPLICATEID, UNRELATEDDUPLICATEID") @@ -933,7 +933,7 @@ _DuplicateScannerUtils._loadEntityIdField = function(pFilterName, pTargetEntity) } /* - * @see DuplicateScannerUtils.ScanForDuplicates for the documentation + * @see DuplicateScannerUtils.scanForDuplicates for the documentation */ _DuplicateScannerUtils._scanForDuplicates = function(pTargetEntity, pEntityFieldConfigValuesRay, pResultFields, pRecordIdValueToIgnore, pFormatValuesConsumeWebserviceCallback, pUseExternalWebservice, pIndexPattern) diff --git a/process/JditoFilter_lib/process.js b/process/JditoFilter_lib/process.js index 4df4da2819a..369edee61bf 100644 --- a/process/JditoFilter_lib/process.js +++ b/process/JditoFilter_lib/process.js @@ -1,6 +1,7 @@ import("system.tools"); import("system.logging"); import("Sql_lib"); +import("Util_lib"); import("system.datetime"); /** @@ -222,7 +223,7 @@ JditoFilterUtils.getSqlCondition = function (pFilter, pTable, pTableAlias, pColu for (let fieldName in pColumnOrFnMap) { var columnOrFn = pColumnOrFnMap[fieldName]; - if (typeof columnOrFn === "function") + if (Utils.isFunction(columnOrFn)) filterTranslator.addSpecialFieldConditionFn(fieldName, columnOrFn); else filterTranslator.addSqlFieldMapping(fieldName, columnOrFn); @@ -269,7 +270,7 @@ FilterSqlTranslator.prototype.filter = function (pFilter) { if (pFilter) { - if (typeof pFilter !== "object") + if (!Utils.isObject(pFilter)) throw new TypeError("FilterSqlTranslator: Wrong type for the filter, expected 'object' but got '" + (typeof pFilter) + "'"); this._filter = pFilter.filter || pFilter; } @@ -409,7 +410,7 @@ FilterSqlTranslator.prototype.getSqlCondition = function () sqlField = table + "." + pFilter.name; var generatedCondition = _getCondition(filterValue, pFilter.operator, sqlField); - if (generatedCondition instanceof SqlBuilder || typeof generatedCondition === "string") + if (generatedCondition instanceof SqlBuilder || Utils.isString(generatedCondition)) { if (pOperator == "AND") this.andIfSet(generatedCondition); diff --git a/process/Leadimport_lib/process.js b/process/Leadimport_lib/process.js index d5b64428bd1..79b550f399b 100644 --- a/process/Leadimport_lib/process.js +++ b/process/Leadimport_lib/process.js @@ -886,7 +886,7 @@ LeadImportUtils.scanLeadDups = function(pAllContactData) if (orgObj != undefined && Object.keys(orgObj).length > 0)//checks if there is an ORGANISATIONDUPLICATE { - let scanResultsOrg = DuplicateScannerUtils.ScanForDuplicates("OrganisationDuplicates", "Organisation_entity", orgObj, null); + let scanResultsOrg = DuplicateScannerUtils.scanForDuplicates("OrganisationDuplicates", "Organisation_entity", orgObj, null); if (scanResultsOrg != null && scanResultsOrg.length > 0) { let insertCountOrg = DuplicateScannerUtils.cacheNewScanResults(orgObj["CONTACTID"], scanResultsOrg, "Organisation_entity"); @@ -895,7 +895,7 @@ LeadImportUtils.scanLeadDups = function(pAllContactData) } if (persObj != undefined && Object.keys(persObj).length > 0)//checks if there is an PERSONDUPLICATE { - let scanResultsPers = DuplicateScannerUtils.ScanForDuplicates("PersonDuplicates", "Person_entity", persObj, null); + let scanResultsPers = DuplicateScannerUtils.scanForDuplicates("PersonDuplicates", "Person_entity", persObj, null); if (scanResultsPers != null && scanResultsPers.length > 0) { let insertCountPers = DuplicateScannerUtils.cacheNewScanResults(persObj["CONTACTID"], scanResultsPers, "Person_entity"); diff --git a/process/RebuildAllDuplicateCaches_serverProcess/process.js b/process/RebuildAllDuplicateCaches_serverProcess/process.js index ceb9f3560fc..b08a0abf9ef 100644 --- a/process/RebuildAllDuplicateCaches_serverProcess/process.js +++ b/process/RebuildAllDuplicateCaches_serverProcess/process.js @@ -27,13 +27,13 @@ var targetEntity = "Person_entity"; var recordBlockSize = DuplicateScannerUtils.getBlockSize(); logging.log(filterName + ": Delete duplicates -> "); -DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity(targetEntity); +DuplicateScannerUtils.deleteClustersByTargetEntity(targetEntity); logging.log(filterName + ": Recalculate duplicates -> "); DuplicateScannerUtils.rebuildDuplicatesCache(filterName, targetEntity, recordBlockSize, null); logging.log(filterName + ": Refresh unrelated duplicates -> "); -DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity); +DuplicateScannerUtils.refreshUnrelatedDuplicateRelations(targetEntity); logging.log(filterName + ": Done rebuilding "); @@ -44,12 +44,12 @@ filterName = "OrganisationDuplicates"; targetEntity = "Organisation_entity"; logging.log(filterName + ": Delete duplicates -> "); -DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity(targetEntity); +DuplicateScannerUtils.deleteClustersByTargetEntity(targetEntity); logging.log(filterName + ": Recalculate duplicates -> "); DuplicateScannerUtils.rebuildDuplicatesCache(filterName, targetEntity, recordBlockSize, null); logging.log(filterName + ": Refresh unrelated duplicates -> "); -DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity); +DuplicateScannerUtils.refreshUnrelatedDuplicateRelations(targetEntity); logging.log(filterName + ": Done rebuilding "); \ No newline at end of file diff --git a/process/RebuildDuplicatesCache_serverProcess/process.js b/process/RebuildDuplicatesCache_serverProcess/process.js index ed2a577e4b0..1e7f532f75a 100644 --- a/process/RebuildDuplicatesCache_serverProcess/process.js +++ b/process/RebuildDuplicatesCache_serverProcess/process.js @@ -28,13 +28,13 @@ var targetEntity = vars.get("$local.targetEntity"); var recordBlockSize = DuplicateScannerUtils.getBlockSize(); logging.log(filterName + ": Delete duplicates -> "); -DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity(targetEntity); +DuplicateScannerUtils.deleteClustersByTargetEntity(targetEntity); logging.log(filterName + ": Recalculate duplicates -> "); DuplicateScannerUtils.rebuildDuplicatesCache(filterName, targetEntity, recordBlockSize, null); logging.log(filterName + ": Refresh unrelated duplicates -> "); -DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity); +DuplicateScannerUtils.refreshUnrelatedDuplicateRelations(targetEntity); logging.log(filterName + ": Done rebuilding "); -- GitLab