Skip to content
Snippets Groups Projects
Commit 9f90edfa authored by David Büchler's avatar David Büchler
Browse files

Zwei Aktionen verfügbar, Integrieren: Selektion -> Current, Current -> Selektion

Logik zum erstellen der Update und Delete Statements wurde implementiert
Es muss zur Ermittlung der Dubletten nun nicht mehr bei der Person die Personid dem Provider per Consumer als Parameter übergeben werden, sondern die Contactid
Es werden nun die korrekten Filterkonfigurationen zum Dubletten-Filter angezeigt
Erste Integration der Dublettenermittlung in die Organisation.!! Noch nicht upgedated auf die neuen Parameter und Aktionen!!
parent 0b439503
No related branches found
No related tags found
No related merge requests found
Showing
with 155 additions and 13 deletions
import("system.neon");
import("system.vars");
import("Campaign_lib");
......@@ -9,4 +10,6 @@ if(selectedElement.length > 0)
CampaignUtils.deleteCampaignStepData(selectedElement[0].UID);
else
CampaignUtils.deleteCampaignData(selectedElement[0].UID);
//todo temporary fix for #1041096. As soon as entities.delete is available and integrated into the deletion process, this can be removed
neon.refreshAll();
}
\ No newline at end of file
import("system.vars");
import("system.result");
if(vars.exists("$param.campaignId_param") && vars.get("$param.campaignId_param"))
if(vars.get("$param.campaignId_param"))
{
result.string("CAMPAIGN_ID = '" + vars.getString("$param.campaignId_param") + "'");
}
......@@ -82,19 +82,21 @@
</entityField>
<entityField>
<name>MAX_RESULTS_THRESHOLD</name>
<title>Max results threshold</title>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>DBRecordContainer</name>
<alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/DuplicateScanConditionConfig_entity/recordcontainers/dbrecordcontainer/conditionProcess.js</conditionProcess>
<onDBUpdate>%aditoprj%/entity/DuplicateScanConditionConfig_entity/recordcontainers/dbrecordcontainer/onDBUpdate.js</onDBUpdate>
<linkInformation>
<linkInformation>
<name>22217bb2-6fbf-4a7f-94f3-b200ef54c49f</name>
<name>072783b0-8914-4886-bfa3-74565db81474</name>
<tableName>DUPLICATESCANCONDITIONCONFIG</tableName>
<primaryKey>ID</primaryKey>
<isUIDTable v="false" />
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
</linkInformation>
......
import("system.vars");
import("system.result");
if(vars.get("$param.DuplicateScanId_param"))
{
result.string("DUPLICATESCAN_ID = '" + vars.getString("$param.DuplicateScanId_param") + "'");
}
\ No newline at end of file
......@@ -6,8 +6,6 @@
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
<targetContextField>targetEntity</targetContextField>
<targetIdField>UID</targetIdField>
</entityProvider>
<entityParameter>
<name>filterName_param</name>
......@@ -40,6 +38,9 @@
</entityField>
<entityProvider>
<name>DuplicatesProvider</name>
<targetContextField>targetContext</targetContextField>
<targetIdField>UID</targetIdField>
<titlePlural>Duplicates</titlePlural>
<dependencies>
<entityDependency>
<name>ea8abf2a-d8b8-4f83-a68e-664b3b23d822</name>
......@@ -47,10 +48,16 @@
<fieldName>PersonDuplicates</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>4d787122-cc91-4afa-a85a-dd0265cb289e</name>
<entityName>Organisation_entity</entityName>
<fieldName>OrganisationDuplicates</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
</entityProvider>
<entityField>
<name>targetEntity</name>
<name>targetContext</name>
</entityField>
<entityField>
<name>UID</name>
......@@ -69,6 +76,33 @@
<expose v="true" />
<mandatory v="true" />
</entityParameter>
<entityParameter>
<name>targetContext_param</name>
<expose v="true" />
<mandatory v="true" />
</entityParameter>
<entityActionGroup>
<name>ActionGroup</name>
<children>
<entityActionField>
<name>IntegrateSelectedIntoCurrentAction</name>
<title>Integrate selected into current contact</title>
<onActionProcess>%aditoprj%/entity/Duplicates_entity/entityfields/actiongroup/children/integrateselectedintocurrentaction/onActionProcess.js</onActionProcess>
<isSelectionAction v="true" />
</entityActionField>
<entityActionField>
<name>IntegrateCurrentIntoSelectedAction</name>
<title>Integrate current into selected contact</title>
<onActionProcess>%aditoprj%/entity/Duplicates_entity/entityfields/actiongroup/children/integratecurrentintoselectedaction/onActionProcess.js</onActionProcess>
<isSelectionAction v="true" />
</entityActionField>
</children>
</entityActionGroup>
<entityParameter>
<name>sourceContactId_param</name>
<expose v="true" />
<mandatory v="true" />
</entityParameter>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......@@ -80,7 +114,7 @@
<name>UID.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>targetEntity.value</name>
<name>targetContext.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>VALUE1.value</name>
......
import("system.vars");
import("system.neon");
import("DuplicateScanner_lib");
let sourceContactId = vars.get("$param.sourceContactId_param");
let targetContactId = vars.get("$sys.selection");
//todo the actual merge ought to happen in a separate view where the contact infos can be merged manually by the user.
let mergeSuccess = DuplicateScannerUtils.MergePerson(sourceContactId, targetContactId);
if(mergeSuccess)
{
neon.openContext("Person", "PersonMain_view", [targetContactId], neon.OPERATINGSTATE_VIEW, null)
}
\ No newline at end of file
import("system.vars");
import("system.neon");
import("DuplicateScanner_lib");
let targetContactId = vars.get("$param.sourceContactId_param");
let sourceContactId = vars.get("$sys.selection");
//todo the actual merge ought to happen in a separate view where the contact infos can be merged manually by the user.
let mergeSuccess = DuplicateScannerUtils.MergePerson(sourceContactId, targetContactId);
if(mergeSuccess)
{
neon.refreshAll();
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import("system.logging");
var filterName = vars.get("$param.filterName_param");
var targetEntity = vars.get("$param.targetEntity_param");
var targetContext = vars.get("$param.targetContext_param");
var values = JSON.parse(vars.get("$param.valuesToScan_param"));
var resultFields = JSON.parse(vars.get("$param.resultFields_param"));
var resultFieldsIdFieldName = vars.get("$param.resultFieldsIdFieldName_param");
......@@ -25,7 +26,7 @@ var returnRay = [];
logging.log("duplicates.length -> " + duplicates.length);
for (i = 0; i < duplicates.length; i++)
{
let newRecord = _compileSingleRecord(duplicates[i], resultFieldsIdFieldName, maxRecorValues, targetEntity);
let newRecord = _compileSingleRecord(duplicates[i], resultFieldsIdFieldName, maxRecorValues, targetContext);
logging.log("newRecord -> " + newRecord);
returnRay.push(newRecord);
......@@ -33,13 +34,13 @@ for (i = 0; i < duplicates.length; i++)
result.object(returnRay);
function _compileSingleRecord(pDuplicate, pIdFieldName, maxRecordValues, pTargetEntity)
function _compileSingleRecord(pDuplicate, pIdFieldName, maxRecordValues, pTargetContext)
{
let newRecord = [];
let recordId = pDuplicate[pIdFieldName];
newRecord.push(recordId);
newRecord.push(pTargetEntity);
newRecord.push(pTargetContext);
let recordCount = 0;
......
......@@ -852,6 +852,44 @@
<onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newletter/onActionProcess.js</onActionProcess>
<iconId>VAADIN:ENVELOPE</iconId>
</entityActionField>
<entityConsumer>
<name>OrganisationDuplicates</name>
<dependency>
<name>dependency</name>
<entityName>Duplicates_entity</entityName>
<fieldName>DuplicatesProvider</fieldName>
</dependency>
<children>
<entityParameter>
<name>filterName_param</name>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/organisationduplicates/children/filtername_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>recordIdToIgnore_param</name>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/organisationduplicates/children/recordidtoignore_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>resultFields_param</name>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/organisationduplicates/children/resultfields_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>resultFieldsIdFieldName_param</name>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/organisationduplicates/children/resultfieldsidfieldname_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>targetEntity_param</name>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/organisationduplicates/children/targetentity_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>valuesToScan_param</name>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/organisationduplicates/children/valuestoscan_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>targetContext_param</name>
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/organisationduplicates/children/targetcontext_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.result");
result.string("OrganisationDuplicates");
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.ORGANISATIONID"));
import("system.result");
result.string(JSON.stringify(["NAME", "STANDARD_PHONE_COMMUNICATION", "STANDARD_EMAIL_COMMUNICATION", "ORGANISATIONID"]));
\ No newline at end of file
import("system.result");
result.string("ORGANISATIONID");
\ No newline at end of file
import("system.result");
result.string("Organisation");
\ No newline at end of file
import("system.result");
result.string("Organisation_entity");
\ No newline at end of file
import("system.logging");
import("system.result");
import("system.vars");
var picture = vars.get("$field.PICTURE");
var name = vars.get("$field.NAME");
let status = vars.get("$field.STATUS");
let recordId = vars.get("$field.ORGANISATIONID");
logging.log("picture -> " + picture);
result.object({PICTURE: picture, NAME: name, STATUS: status, ORGANISATIONID: recordId});
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.PERSONID"));
\ No newline at end of file
result.string(vars.get("$field.CONTACTID"));
\ No newline at end of file
import("system.result");
result.string(JSON.stringify(["FIRSTNAME", "LASTNAME", "PERSONID"]));
\ No newline at end of file
result.string(JSON.stringify(["FIRSTNAME", "LASTNAME", "CONTACTID"]));
\ No newline at end of file
import("system.result");
result.string("PERSONID");
\ No newline at end of file
result.string("CONTACTID");
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$field.CONTACTID"));
\ No newline at end of file
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