Skip to content
Snippets Groups Projects
Commit 3d462c3a authored by Florian Lang's avatar Florian Lang Committed by Sebastian Pongratz
Browse files

[Projekt: xRM-ContactManagement][TicketNr.: 1086358][Dubletten -...

[Projekt: xRM-ContactManagement][TicketNr.: 1086358][Dubletten - Erkennungspattern funktioniert nicht korrekt.]
parent 395bb1a4
No related branches found
No related tags found
No related merge requests found
Showing
with 96 additions and 31 deletions
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<include relativeToChangelogFile="true" file="update_duplicatepattern.xml"/>
</databaseChangeLog>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet dbms="!derby" author="f.lang" id="f6a54dda-07cf-4555-abdf-d84bab032bff">
<update tableName="DUPLICATESCANNER">
<column name="SCAN_PATTERN" value="{&quot;entity&quot;:&quot;Person_entity&quot;,&quot;filter&quot;:{&quot;type&quot;:&quot;group&quot;,&quot;operator&quot;:&quot;AND&quot;,&quot;childs&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;}]},{&quot;type&quot;:&quot;group&quot;,&quot;operator&quot;:&quot;OR&quot;,&quot;childs&quot;:[{&quot;type&quot;:&quot;row&quot;,&quot;name&quot;:&quot;STANDARD_EMAIL_COMMUNICATION&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;PERSON_ID&quot;,&quot;operator&quot;:&quot;CONTAINSNOT&quot;,&quot;value&quot;:&quot;{}&quot;,&quot;key&quot;:&quot;{}&quot;,&quot;contenttype&quot;:&quot;TEXT&quot;}]},&quot;provider&quot;:&quot;Duplicates&quot;}"></column>
<where>ID = ? and SCAN_PATTERN = ?</where>
<whereParams>
<param name="id" value="a8363f75-dc0a-412c-afe1-80ebacc26744"/>
</whereParams>
</update>
<update tableName="DUPLICATESCANNER">
<column name="SCAN_PATTERN" value="{&quot;entity&quot;:&quot;Organisation_entity&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;CONTAINS&quot;,&quot;value&quot;:&quot;{\&quot;exclude\&quot;: [\&quot;gmbh\&quot;, \&quot;co\&quot;, \&quot;kg\&quot;, \&quot;AG\&quot;, \&quot;bank\&quot;]}&quot;,&quot;key&quot;:&quot;{\&quot;exclude\&quot;: [\&quot;gmbh\&quot;, \&quot;co\&quot;, \&quot;kg\&quot;, \&quot;AG\&quot;, \&quot;bank\&quot;]}&quot;,&quot;contenttype&quot;:&quot;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;}]},&quot;provider&quot;:&quot;Duplicates&quot;}"></column>
<where>ID = ? and SCAN_PATTERN = ?</where>
<whereParams>
<param name="id" value="8fa3ab66-cc01-45b6-88f3-a9e76bad7db0"/>
</whereParams>
</update>
</changeSet>
<!--Derby has problems with the second where condition ("Comparisons between 'CLOB (UCS_BASIC)' and 'CHAR (UCS_BASIC)' are not supported")
we do need this condition so the customer set patterns don't get overwritten.
No Customer usesderby, so we can just ignore the condition if dbms="derby"-->
<changeSet dbms="derby" author="f.lang" id="7f204681-b5d9-4fb8-a1b3-c3d7cd7ab5fc">
<update tableName="DUPLICATESCANNER">
<column name="SCAN_PATTERN" value="{&quot;entity&quot;:&quot;Person_entity&quot;,&quot;filter&quot;:{&quot;type&quot;:&quot;group&quot;,&quot;operator&quot;:&quot;AND&quot;,&quot;childs&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;}]},{&quot;type&quot;:&quot;group&quot;,&quot;operator&quot;:&quot;OR&quot;,&quot;childs&quot;:[{&quot;type&quot;:&quot;row&quot;,&quot;name&quot;:&quot;STANDARD_EMAIL_COMMUNICATION&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;PERSON_ID&quot;,&quot;operator&quot;:&quot;CONTAINSNOT&quot;,&quot;value&quot;:&quot;{}&quot;,&quot;key&quot;:&quot;{}&quot;,&quot;contenttype&quot;:&quot;TEXT&quot;}]},&quot;provider&quot;:&quot;Duplicates&quot;}"></column>
<where>ID = ?</where>
<whereParams>
<param name="id" value="a8363f75-dc0a-412c-afe1-80ebacc26744"/></whereParams>
</update>
<update tableName="DUPLICATESCANNER">
<column name="SCAN_PATTERN" value="{&quot;entity&quot;:&quot;Organisation_entity&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;CONTAINS&quot;,&quot;value&quot;:&quot;{\&quot;exclude\&quot;: [\&quot;gmbh\&quot;, \&quot;co\&quot;, \&quot;kg\&quot;, \&quot;AG\&quot;, \&quot;bank\&quot;]}&quot;,&quot;key&quot;:&quot;{\&quot;exclude\&quot;: [\&quot;gmbh\&quot;, \&quot;co\&quot;, \&quot;kg\&quot;, \&quot;AG\&quot;, \&quot;bank\&quot;]}&quot;,&quot;contenttype&quot;:&quot;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;}]},&quot;provider&quot;:&quot;Duplicates&quot;}"></column>
<where>ID = ?</where>
<whereParams>
<param name="id" value="8fa3ab66-cc01-45b6-88f3-a9e76bad7db0"/></whereParams>
</update>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<include relativeToChangelogFile="true" file="Duplicate/changelog.xml"/>
<include relativeToChangelogFile="true" file="TopicTree/changelog.xml"/>
<include relativeToChangelogFile="true" file="CampaignStep/changelog.xml"/>
<include relativeToChangelogFile="true" file="xRM-Service/changelog.xml"/>
......
......@@ -815,10 +815,10 @@
<expose v="true" />
</entityParameter>
<entityField>
<name>COMMRESTRICTIONS_ACTIVE</name>
<name>Information</name>
<title>Commrestrictions</title>
<color>$priority-high-color</color>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/commrestrictions_active/valueProcess.js</valueProcess>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/information/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>STANDARD_ADDRESS</name>
......@@ -944,8 +944,8 @@
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/organisation_objecttype/valueProcess.js</valueProcess>
</entityField>
<entityProvider>
<name>Dublicates</name>
<documentation>%aditoprj%/entity/Organisation_entity/entityfields/dublicates/documentation.adoc</documentation>
<name>Duplicates</name>
<documentation>%aditoprj%/entity/Organisation_entity/entityfields/duplicates/documentation.adoc</documentation>
<recordContainer>index</recordContainer>
<children>
<entityParameter>
......@@ -1284,9 +1284,9 @@
<stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/openadminview/stateProcess.js</stateProcess>
</entityActionField>
<entityConsumer>
<name>Duplicates</name>
<name>DuplicatesOrganisation</name>
<selectionMode>MULTI</selectionMode>
<selectionModeProcess>%aditoprj%/entity/Organisation_entity/entityfields/duplicates/selectionModeProcess.js</selectionModeProcess>
<selectionModeProcess>%aditoprj%/entity/Organisation_entity/entityfields/duplicatesorganisation/selectionModeProcess.js</selectionModeProcess>
<dependency>
<name>dependency</name>
<entityName>Duplicate_entity</entityName>
......@@ -1295,7 +1295,7 @@
<children>
<entityParameter>
<name>DuplicateObject_param</name>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/duplicates/children/duplicateobject_param/valueProcess.js</valueProcess>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/duplicatesorganisation/children/duplicateobject_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
......@@ -1595,7 +1595,7 @@
<filtertype>BASIC</filtertype>
</consumerMapping>
<dbRecordFieldMapping>
<name>COMMRESTRICTIONS_ACTIVE.value</name>
<name>Information.value</name>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>STANDARD_ADDRESS.value</name>
......
......@@ -7,7 +7,7 @@ import("system.neon");
import("system.result");
import("system.vars");
if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET)
if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW)
{
var commRestrictionString = ContactUtils.getCommunicationRejectionSummary(vars.get("$field.CONTACTID"));
......
......@@ -885,10 +885,10 @@
<name>LEAD_LEADID</name>
</entityField>
<entityField>
<name>COMMRESTRICTIONS_ACTIVE</name>
<name>Information</name>
<title>Commrestrictions</title>
<color>$priority-high-color</color>
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/commrestrictions_active/valueProcess.js</valueProcess>
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/information/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>STANDARD_ZIP</name>
......@@ -997,8 +997,8 @@
<title>Count</title>
</entityAggregateField>
<entityProvider>
<name>Dublicates</name>
<documentation>%aditoprj%/entity/Person_entity/entityfields/dublicates/documentation.adoc</documentation>
<name>Duplicates</name>
<documentation>%aditoprj%/entity/Person_entity/entityfields/duplicates/documentation.adoc</documentation>
<recordContainer>index</recordContainer>
</entityProvider>
<entityField>
......@@ -1260,9 +1260,9 @@
<expose v="true" />
</entityParameter>
<entityConsumer>
<name>Duplicates</name>
<name>DuplicatesPerson</name>
<selectionMode>MULTI</selectionMode>
<selectionModeProcess>%aditoprj%/entity/Person_entity/entityfields/duplicates/selectionModeProcess.js</selectionModeProcess>
<selectionModeProcess>%aditoprj%/entity/Person_entity/entityfields/duplicatesperson/selectionModeProcess.js</selectionModeProcess>
<dependency>
<name>dependency</name>
<entityName>Duplicate_entity</entityName>
......@@ -1271,7 +1271,7 @@
<children>
<entityParameter>
<name>DuplicateObject_param</name>
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/duplicates/children/duplicateobject_param/valueProcess.js</valueProcess>
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/duplicatesperson/children/duplicateobject_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
......@@ -1610,7 +1610,7 @@
<filtertype>BASIC</filtertype>
</consumerMapping>
<dbRecordFieldMapping>
<name>COMMRESTRICTIONS_ACTIVE.value</name>
<name>Information.value</name>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>STANDARD_ADDRESS.value</name>
......
......@@ -8,7 +8,7 @@ import("system.neon");
import("system.result");
import("system.vars");
if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET)
if (vars.get("$sys.viewmode") == neon.FRAME_VIEWMODE_DATASET && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW)
{
var communications = null, email = null;
var commRestrictionString = ContactUtils.getCommunicationRejectionSummary(vars.get("$field.CONTACTID"));
......
......@@ -14,7 +14,7 @@
<children>
<neonViewReference>
<name>933cd72c-fd3a-4b91-aad6-8e129d6233e5</name>
<entityField>Duplicates</entityField>
<entityField>DuplicatesOrganisation</entityField>
<view>DuplicateEdit_view</view>
</neonViewReference>
<genericViewTemplate>
......
......@@ -77,7 +77,7 @@
</neonViewReference>
<neonViewReference>
<name>a5ab96e5-927c-4db3-b7ed-f0c0aadcb89b</name>
<entityField>Duplicates</entityField>
<entityField>DuplicatesOrganisation</entityField>
<view>DuplicateFilter_view</view>
</neonViewReference>
<neonViewReference>
......
......@@ -17,7 +17,7 @@
<descriptionField>CUSTOMERCODE_DISPLAY_fieldGroup</descriptionField>
<favoriteAction1>newActivity</favoriteAction1>
<entityField>#ENTITY</entityField>
<informationField>COMMRESTRICTIONS_ACTIVE</informationField>
<informationField>Information</informationField>
</cardViewTemplate>
<favoriteViewTemplate>
<name>Favorite</name>
......
......@@ -14,7 +14,7 @@
<children>
<neonViewReference>
<name>a6b55bfc-7b0c-4020-a78d-18ee9a1d2b26</name>
<entityField>Duplicates</entityField>
<entityField>DuplicatesPerson</entityField>
<view>DuplicateEdit_view</view>
</neonViewReference>
<genericViewTemplate>
......
......@@ -61,7 +61,7 @@
</neonViewReference>
<neonViewReference>
<name>24ea8bc9-7ed0-4bed-a984-b1a9f3815c7c</name>
<entityField>Duplicates</entityField>
<entityField>DuplicatesPerson</entityField>
<view>DuplicateFilter_view</view>
</neonViewReference>
<neonViewReference>
......
......@@ -17,7 +17,7 @@
<descriptionField>ORGANISATION_CONTACTID</descriptionField>
<favoriteAction1>newActivity</favoriteAction1>
<entityField>#ENTITY</entityField>
<informationField>COMMRESTRICTIONS_ACTIVE</informationField>
<informationField>Information</informationField>
</cardViewTemplate>
<favoriteViewTemplate>
<name>Favorites</name>
......
......@@ -24,18 +24,29 @@ function DuplicateScannerUtils() {}
*/
DuplicateScannerUtils.getDuplicateProviderName = function()
{
return "Dublicates";
return "Duplicates";
}
/**
* Returns a list of permitted filteroperator for the duplicatescanner
* All other filteroperator will be changed to "CONTAINS"
* All other filteroperator will be changed to the default operator
*
* @returns {Array} of filteroperatornames
*/
DuplicateScannerUtils.getPermittedFilterOperator = function()
{
return ["CONTAINS", "CONTAINSNOT"];
return ["CONTAINS", "CONTAINSNOT", "EQUAL", "NOT_EQUAL"];
}
/**
* Returns the default filteroperator for the duplicatescanner
* Its needed if a not permitted filteroperator is used.
*
* @returns {String} the filteroperator
*/
DuplicateScannerUtils.getDefaultOperator = function()
{
return "EQUAL";
}
/**
......@@ -392,6 +403,7 @@ DuplicateUtils.prototype.modifyFilterForProvider = function(pFilterObject)
if(pFilterObject.key.exclude)
{
var regExpArray = pFilterObject.key.exclude.map(function(value) {
value = value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
return "\\W+" + value + "\\W+|\\W+" + value + "$|^" + value + "\\W+|^" + value + "$";
});
......@@ -419,7 +431,7 @@ DuplicateUtils.prototype._modifyFilterForProviderType = function(pFilterObjects)
case project.RECORDCONTAINERTYPE_INDEX:
if(!permittedOperator.includes(pFilterObjects.operator))
{
pFilterObjects.operator = "CONTAINS";
pFilterObjects.operator = DuplicateScannerUtils.getDefaultOperator();
}
if(pFilterObjects.key.fuzzy)
......@@ -427,14 +439,20 @@ DuplicateUtils.prototype._modifyFilterForProviderType = function(pFilterObjects)
this.dataObject[pFilterObjects.name] += "~" + pFilterObjects.key.fuzzy;
pFilterObjects.operator = "EQUAL";
}
if(pFilterObjects == "EQUAL")
{
this.dataObject[pFilterObjects.name] = "\"" + this.dataObject[pFilterObjects.name] + "\"";
}
break;
case project.RECORDCONTAINERTYPE_DATALESS:
throw new Error("Can't use dataless-RecordContainer for dublicates");
throw new Error("Can't use dataless-RecordContainer for duplicates");
break;
case project.RECORDCONTAINERTYPE_DB:
if(!permittedOperator.includes(pFilterObjects.operator))
{
pFilterObjects.operator = "CONTAINS";
pFilterObjects.operator = DuplicateScannerUtils.getDefaultOperator();
}
case project.RECORDCONTAINERTYPE_JDITO:
if(pFilterObjects.key.fuzzy)
......
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