From 1893ef448709238c6e7c12452e82e8d04b1835cf Mon Sep 17 00:00:00 2001 From: "b.ulrich" <b.ulrich@adito.de> Date: Thu, 21 Jan 2021 14:48:25 +0100 Subject: [PATCH] 1070913 updateClassificationsServerProcess recalculate all classifications --- .liquibase/Data_alias/changelog.xml | 2 +- .../ClassificationAdmin_entity.aod | 4 ++-- .../_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod | 9 +++++++++ language/_____LANGUAGE_de/_____LANGUAGE_de.aod | 16 ++++++++++++++++ language/_____LANGUAGE_en/_____LANGUAGE_en.aod | 9 +++++++++ .../process.js | 11 ++++++----- 6 files changed, 43 insertions(+), 8 deletions(-) diff --git a/.liquibase/Data_alias/changelog.xml b/.liquibase/Data_alias/changelog.xml index c6e5850fd70..e49dccc3c73 100644 --- a/.liquibase/Data_alias/changelog.xml +++ b/.liquibase/Data_alias/changelog.xml @@ -22,5 +22,5 @@ <include relativeToChangelogFile="true" file="basic/2021.0.0/changelog.xml"/> <!--enable this only when you definetly want to overwrite the existing data with demo records:--> - <include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/> + <!--<include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/>--> </databaseChangeLog> diff --git a/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod b/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod index 70859b3cb7a..a2ecf6d0ca9 100644 --- a/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod +++ b/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod @@ -95,14 +95,14 @@ <title>Recalculate Classifications</title> <onActionProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/filterviewactiongroup/children/updateclassification/onActionProcess.js</onActionProcess> <iconId>VAADIN:AUTOMATION</iconId> - <tooltip>Use this to manually start the serverprocess after changes to the configuration of classifications. It will recalculate all outdated classifications.</tooltip> + <tooltip>Starts the serverprocess manually, which will recalculate all (potentially) outdated classifications. Use this after changes to the configuration of classifications.</tooltip> </entityActionField> <entityActionField> <name>UpdateAllClassifications</name> <title>Recalculate all Classifications</title> <onActionProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/filterviewactiongroup/children/updateallclassifications/onActionProcess.js</onActionProcess> <iconId>VAADIN:AUTOMATION</iconId> - <tooltip>Use this to manually start the serverprocess, which will this time recalculate all classifications. Do this after e.g importing data from elswhere where the outdated flag couldn't been set correctly</tooltip> + <tooltip>Starts the serverprocess manually, which will recalculate all classifications from scratch. Only do this after e.g importing data from elsewhere where the outdated flag couldn't been set correctly. Since this can take some time.</tooltip> </entityActionField> </children> </entityActionGroup> diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index 7fa729d0445..f6b1ed30ec8 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -7869,6 +7869,15 @@ <entry> <key>refresh classifications</key> </entry> + <entry> + <key>Starts the serverprocess manually, which will recalculate all (potentially) outdated classifications. Use this after changes to the configuration of classifications.</key> + </entry> + <entry> + <key>Recalculate Classifications</key> + </entry> + <entry> + <key>Starts the serverprocess manually, which will recalculate all classifications from scratch. Only do this after e.g importing data from elsewhere where the outdated flag couldn't been set correctly. Since this can take some time.</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index eeb0d827e44..f00c1296f54 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -9469,6 +9469,22 @@ Bitte Datumseingabe prüfen</value> <key>Recalculate all Classifications</key> <value>Alle Klassifizierungen neuberechnen</value> </entry> + <entry> + <key>Recalculate Classifications</key> + <value>Klassifizierungen neuberechnen</value> + </entry> + <entry> + <key>Starts the serverprocess manually, which will recalculate all (potentially) outdated classifications. Use this after changes to the configuration of classifications.</key> + <value>Startet den Serverprozess Manuell. Berechnet alle (potenziell) veralteten Klassifizierungen. Benutze dies nach Änderungen an den Klassifizierungseinstellungen.</value> + </entry> + <entry> + <key>Starts the serverprocess manually, which will recalculate all classifications from scratch. Only do this after e.g importing data from elsewhere where the outdated flag couldn't been set correctly. Since this can take some time.</key> + <value>Startet den Serverprozess Manuell. Berechnet alle Klassifizierungen neu. Benutze dies nur nach z.B dem Importieren von Daten von ausserhalb des Systems bei denen der outdated flag nciht richtig gesetzt wurde, da dieser Durchlauf länger dauen kann</value> + </entry> + <entry> + <key>Are you sure you want to recalculate all classifications using the current classificationgradings? This can take some time, since ALL classifications will get freshly calculated and updated if needed.</key> + <value>Sind sie sich sicher, dass sie alle Klassifizierungen anhand der konfigurierten Bewertungen neuberechnen willst? Dies kann länger dauern, da ALLE Klassifizierungen neuberechnet werden und wenn nötig geupdated werden.</value> + </entry> <entry> <key>Reminder:</key> <value>Erinnerung:</value> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index d98310a5d1c..a542d184f9c 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -7950,6 +7950,15 @@ <entry> <key>refresh classifications</key> </entry> + <entry> + <key>Starts the serverprocess manually, which will recalculate all (potentially) outdated classifications. Use this after changes to the configuration of classifications.</key> + </entry> + <entry> + <key>Recalculate Classifications</key> + </entry> + <entry> + <key>Starts the serverprocess manually, which will recalculate all classifications from scratch. Only do this after e.g importing data from elsewhere where the outdated flag couldn't been set correctly. Since this can take some time.</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/process/updateClassifications_serverProcess/process.js b/process/updateClassifications_serverProcess/process.js index 09cb9c38790..30a7d27f5d9 100644 --- a/process/updateClassifications_serverProcess/process.js +++ b/process/updateClassifications_serverProcess/process.js @@ -556,6 +556,11 @@ for (xyz = 0; xyz < runUpdating; xyz++) outputInformation[objectTypes[i]].persistentDatasetsUpdated++; helperObject[uid + classificationTypeId] = ""; + + if(recalculateAll) + { +// if(storedClassificationValues[objectTypes[i]][uid][""]) + } } } } @@ -603,11 +608,8 @@ for (xyz = 0; xyz < runUpdating; xyz++) if(isOrganisation) bestPossibleScoreStmt.and("CONTACT.PERSON_ID is null"); - bestPossibleScoreStmt.orderBy(currentObjectColumn + ", CLASSIFICATIONTYPE.CLASSIFICATIONGROUP_ID"); - - bestPossibleScoresGroupObj = {}; helperObject = {}; bestPossibleScoreStmt.pageSize(100) @@ -625,7 +627,6 @@ for (xyz = 0; xyz < runUpdating; xyz++) //If this would be done in the batch function it would result in false classificationstorage-results because not all records for a rowId have been used for (var row_Id in achievedScoresObj) { - chainedGrading = classificationStorageObject[objectTypes[i]][row_Id][1]; for (var groupId in achievedScoresObj[row_Id]) @@ -885,7 +886,7 @@ function _buildBestPossibleScoresGroupObjFn(pBatchData, pBatchNum) } if(!helperObject.hasOwnProperty(uid + classificationTypeId)) //classificationType { - if(_isRelevant() != false) + if(_isRelevant()) { if(bestPossibleScoresGroupObj[uid][classificationGroupId] == "") bestPossibleScoresGroupObj[uid][classificationGroupId] = 0; -- GitLab