diff --git a/entity/DuplicatesUnrelated_entity/DuplicatesUnrelated_entity.aod b/entity/DuplicatesUnrelated_entity/DuplicatesUnrelated_entity.aod index 77c9ac4403ce9a02b45b1694656a8ff4d94afc1c..442d4d2c2c92b5bc004243b5ba1fde6c264437bc 100644 --- a/entity/DuplicatesUnrelated_entity/DuplicatesUnrelated_entity.aod +++ b/entity/DuplicatesUnrelated_entity/DuplicatesUnrelated_entity.aod @@ -2,13 +2,20 @@ <entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.11" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.11"> <name>DuplicatesUnrelated_entity</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <recordContainer>recordContainer</recordContainer> + <recordContainer>jditoRecordContainer</recordContainer> <entityFields> <entityProvider> <name>#PROVIDER</name> </entityProvider> <entityProvider> <name>UnrelatedPersonsProvider</name> + <children> + <entityParameter> + <name>TargetEntity</name> + <expose v="true" /> + <mandatory v="true" /> + </entityParameter> + </children> </entityProvider> <entityParameter> <name>TargetEntity</name> @@ -17,47 +24,40 @@ </entityParameter> <entityProvider> <name>UnrelatedOrganisationsProvider</name> + <children> + <entityParameter> + <name>TargetEntity</name> + <expose v="true" /> + <mandatory v="true" /> + </entityParameter> + </children> </entityProvider> - <entityConsumer> - <name>UnrelatedPersonsConsumer</name> - <dependency> - <name>dependency</name> - </dependency> - </entityConsumer> - <entityConsumer> - <name>UnrelatedOrganisationsConsumer</name> - <dependency> - <name>dependency</name> - </dependency> - </entityConsumer> + <entityField> + <name>SourceDuplicateDescription</name> + </entityField> + <entityField> + <name>UnrelatedDuplicateDescription</name> + </entityField> + <entityField> + <name>UID</name> + </entityField> </entityFields> <recordContainers> - <dbRecordContainer> - <name>recordContainer</name> - <alias>Data_alias</alias> - <linkInformation> - <linkInformation> - <name>c5e79738-a374-4f09-8bc3-aafe5cd7f582</name> - <tableName>UNRELATEDDUPLICATES</tableName> - <primaryKey>ID</primaryKey> - <isUIDTable v="true" /> - <readonly v="false" /> - </linkInformation> - <linkInformation> - <name>214774c2-bf2f-460e-9931-5cdc27be1b5d</name> - <tableName>CONTACT</tableName> - <primaryKey>CONTACTID</primaryKey> - <isUIDTable v="false" /> - <readonly v="false" /> - </linkInformation> - <linkInformation> - <name>820d9ef7-c3fe-4a0b-9170-5526efccfbae</name> - <tableName>PERSON</tableName> - <primaryKey>PERSONID</primaryKey> - <isUIDTable v="false" /> - <readonly v="false" /> - </linkInformation> - </linkInformation> - </dbRecordContainer> + <jDitoRecordContainer> + <name>jditoRecordContainer</name> + <jDitoRecordAlias>Data_alias</jDitoRecordAlias> + <contentProcess>%aditoprj%/entity/DuplicatesUnrelated_entity/recordcontainers/jditorecordcontainer/contentProcess.js</contentProcess> + <recordFieldMappings> + <jDitoRecordFieldMapping> + <name>UID.value</name> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>SourceDuplicateDescription.value</name> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>UnrelatedDuplicateDescription.value</name> + </jDitoRecordFieldMapping> + </recordFieldMappings> + </jDitoRecordContainer> </recordContainers> </entity> diff --git a/entity/DuplicatesUnrelated_entity/recordcontainers/jditorecordcontainer/contentProcess.js b/entity/DuplicatesUnrelated_entity/recordcontainers/jditorecordcontainer/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5dcaa82556b9924fce2e7468b5ee02aad60b187a --- /dev/null +++ b/entity/DuplicatesUnrelated_entity/recordcontainers/jditorecordcontainer/contentProcess.js @@ -0,0 +1,39 @@ +import("system.result"); +import("system.vars"); +import("system.db"); + +var INDEX_ID = 0; +var INDEX_SOURCE_INFO1 = 1; +var INDEX_SOURCE_INFO2 = 2; +var INDEX_UNRELATED_INFO1 = 3; +var INDEX_UNRELATED_INFO2 = 4; + +let unrelatedDuplicates = []; +let resultUnrelatedDuplicates = []; +let targetEntity = vars.get("$param.TargetEntity"); +let query = ""; +if(targetEntity == 'Person_entity') +{ + query = "select ud.ID," + + " pSource.FIRSTNAME, pSource.LASTNAME," + + " pUnrelated.FIRSTNAME, pUnrelated.LASTNAME" + + " from UNRELATEDDUPLICATES ud" + + " join CONTACT cUnrelated on cUnrelated.CONTACTID = ud.UNRELATEDDUPLICATEID" + + " join PERSON pUnrelated on pUnrelated.PERSONID = cUnrelated.PERSON_ID" + + " join CONTACT cSource on cSource.CONTACTID = ud.SOURCEDUPLICATEID" + + " join PERSON pSource on pSource.PERSONID = cSource.PERSON_ID"; +} + +unrelatedDuplicates = db.table(query); + +for (let i = 0; i < unrelatedDuplicates.length; i++) +{ + let id = unrelatedDuplicates[i][INDEX_ID]; + let sourceInfo1 = unrelatedDuplicates[i][INDEX_SOURCE_INFO1]; + let sourceInfo2 = unrelatedDuplicates[i][INDEX_SOURCE_INFO2]; + let unrelatedInfo1 = unrelatedDuplicates[i][INDEX_UNRELATED_INFO1]; + let unrelatedInfo2 = unrelatedDuplicates[i][INDEX_UNRELATED_INFO2]; + + resultUnrelatedDuplicates.push([id, sourceInfo1 + " " + sourceInfo2, unrelatedInfo1 + " " + unrelatedInfo2]); +} +result.object(resultUnrelatedDuplicates); \ No newline at end of file diff --git a/entity/Duplicates_entity/Duplicates_entity.aod b/entity/Duplicates_entity/Duplicates_entity.aod index c3fcb61abfd7f1e3b9caf6dd72baf3c69bb494cb..3416708185e25a5faa4da9a4df2a42a1178fd3be 100644 --- a/entity/Duplicates_entity/Duplicates_entity.aod +++ b/entity/Duplicates_entity/Duplicates_entity.aod @@ -71,6 +71,20 @@ <name>SelfOrganisationDuplicatesProvider</name> <titlePlural>Organisation duplicates</titlePlural> </entityProvider> + <entityConsumer> + <name>DuplicatesUnrelatedPersonConsumer</name> + <dependency> + <name>dependency</name> + <entityName>DuplicatesUnrelated_entity</entityName> + <fieldName>UnrelatedPersonsProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>TargetEntity</name> + <valueProcess>%aditoprj%/entity/Duplicates_entity/entityfields/duplicatesunrelatedpersonconsumer/children/targetentity/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/Duplicates_entity/entityfields/duplicatesunrelatedpersonconsumer/children/targetentity/valueProcess.js b/entity/Duplicates_entity/entityfields/duplicatesunrelatedpersonconsumer/children/targetentity/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..0f7bee25ea3bd34aeeceff7f47f7f9118e69b7ba --- /dev/null +++ b/entity/Duplicates_entity/entityfields/duplicatesunrelatedpersonconsumer/children/targetentity/valueProcess.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("Person_entity"); \ No newline at end of file diff --git a/neonContext/Duplicates/Duplicates.aod b/neonContext/Duplicates/Duplicates.aod index 168f8b176a1e7b1f6c809da9ab631f81a4c05280..198c0374f2343fbe8336cb5b624330d838f2ae23 100644 --- a/neonContext/Duplicates/Duplicates.aod +++ b/neonContext/Duplicates/Duplicates.aod @@ -18,5 +18,9 @@ <name>89fb0738-6d12-4bc1-9c4f-bb27c19ae9a3</name> <view>OrganisationDuplicatesFilter_view</view> </neonViewReference> + <neonViewReference> + <name>5bdeb931-4e69-4520-bbc9-94fb17679331</name> + <view>PersonDublicatesTab_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonView/DuplicatesOverview_view/DuplicatesOverview_view.aod b/neonView/DuplicatesOverview_view/DuplicatesOverview_view.aod index be92bf036f2e29caa32702a1396617a035a6059e..cdbcf32c67c97517285f40ad0c57faf8c7b02ab5 100644 --- a/neonView/DuplicatesOverview_view/DuplicatesOverview_view.aod +++ b/neonView/DuplicatesOverview_view/DuplicatesOverview_view.aod @@ -9,14 +9,9 @@ </layout> <children> <neonViewReference> - <name>a858aa7c-a751-4e99-87df-08ae3d1ea1b9</name> - <entityField>SelfPersonDuplicatesConsumer</entityField> - <view>PersonDuplicatesFilter_view</view> - </neonViewReference> - <neonViewReference> - <name>98f44c67-4371-45bf-9458-b41ec28753b3</name> - <entityField>SelfOrganisationDuplicatesConsumer</entityField> - <view>OrganisationDuplicatesFilter_view</view> + <name>b3164f16-fa7e-42b0-829f-88553add7c08</name> + <entityField>#ENTITY</entityField> + <view>PersonDublicatesTab_view</view> </neonViewReference> </children> </neonView> diff --git a/neonView/DuplicatesUnrelatedPersonFilter_view/DuplicatesUnrelatedPersonFilter_view.aod b/neonView/DuplicatesUnrelatedPersonFilter_view/DuplicatesUnrelatedPersonFilter_view.aod index 324006b6d7c68649561a94c7ec4856c98f7a5756..9fcb7fbe3592c792d55d5295e985c6668269327d 100644 --- a/neonView/DuplicatesUnrelatedPersonFilter_view/DuplicatesUnrelatedPersonFilter_view.aod +++ b/neonView/DuplicatesUnrelatedPersonFilter_view/DuplicatesUnrelatedPersonFilter_view.aod @@ -7,4 +7,22 @@ <name>layout</name> </boxLayout> </layout> + <children> + <tableViewTemplate> + <name>UnrelatedPersons</name> + <entityField>#ENTITY</entityField> + <isCreatable v="false" /> + <isEditable v="false" /> + <columns> + <neonTableColumn> + <name>734re984-6a0b-4126-ab49-452e2b54f76d</name> + <entityField>SourceDuplicateDescription</entityField> + </neonTableColumn> + <neonTableColumn> + <name>8615259b-de5b-378u-945d-2ff934ae1b8c</name> + <entityField>UnrelatedDuplicateDescription</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> </neonView> diff --git a/neonView/PersonDublicatesTab_view/PersonDublicatesTab_view.aod b/neonView/PersonDublicatesTab_view/PersonDublicatesTab_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..3edc37c8e3331b03314b1d3d92f9d3ce23a82f74 --- /dev/null +++ b/neonView/PersonDublicatesTab_view/PersonDublicatesTab_view.aod @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.2"> + <name>PersonDublicatesTab_view</name> + <title>Person duplicates</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + <direction>HORIZONTAL</direction> + </boxLayout> + </layout> + <children> + <neonViewReference> + <name>c82a1ae2-9f8f-4149-8bac-5621e36d779b</name> + <entityField>SelfPersonDuplicatesConsumer</entityField> + <view>PersonDuplicatesFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>2aee29fb-9844-4e3a-a284-a04dadf9eadc</name> + <entityField>DuplicatesUnrelatedPersonConsumer</entityField> + <view>DuplicatesUnrelatedPersonFilter_view</view> + </neonViewReference> + </children> +</neonView>