From 7f08deaa5996f5026920e192a3488a034720d32a Mon Sep 17 00:00:00 2001 From: Johannes Hoermann <j.hoermann@adito.de> Date: Fri, 24 May 2019 11:56:17 +0200 Subject: [PATCH] Classification Admin-refactorings --- .../_____SYSTEM_APPLICATION_NEON.aod | 1 + .../ClassificationAdmin_entity.aod | 6 ---- .../classificationtype_param/valueProcess.js | 4 --- .../recordcontainers/jdito/contentProcess.js | 2 +- .../Classification_entity.aod | 35 +++++++++++++++++-- .../classificationgroup/dropDownProcess.js | 10 +++--- .../classificationgroup/onValidation.js | 17 +++++++-- .../classificationtype/displayValueProcess.js | 6 ++++ .../classificationtype/stateProcess.js | 11 ++++++ .../containername_param/valueProcess.js | 4 +++ .../recordcontainers/jdito/contentProcess.js | 33 +++++++++-------- .../recordcontainers/jdito/onUpdate.js | 7 ++-- .../KeywordEntry_entity.aod | 6 ++++ .../ClassificationAdmin.aod | 5 --- .../ClassificationAdminFilter_view.aod | 22 ------------ .../ClassificationAdminTree_view.aod | 6 ++-- .../ClassificatonAdminEdit_view.aod | 4 +++ process/Classification_lib/process.js | 26 ++++++++++++++ 18 files changed, 140 insertions(+), 65 deletions(-) delete mode 100644 entity/ClassificationAdmin_entity/entityfields/classificationsadmin/children/classificationtype_param/valueProcess.js create mode 100644 entity/Classification_entity/entityfields/classificationtype/displayValueProcess.js create mode 100644 entity/Classification_entity/entityfields/classificationtype/stateProcess.js create mode 100644 entity/Classification_entity/entityfields/keywordclassificationtypes/children/containername_param/valueProcess.js delete mode 100644 neonView/ClassificationAdminFilter_view/ClassificationAdminFilter_view.aod diff --git a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod index 3ff6943361..dabfc60a3f 100644 --- a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod +++ b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod @@ -44,6 +44,7 @@ <node name="KeywordAttribute" kind="10077" /> <node name="ObjectRelationType" kind="10077" /> <node name="ClassificationAdmin" kind="10077" /> + <node name="Classification" kind="10077" /> <node name="Salutation" kind="10077" /> <node name="INTERNAL_ADMINISTRATOR" kind="159" /> </node> diff --git a/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod b/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod index cdf27e635e..c8b013c522 100644 --- a/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod +++ b/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod @@ -38,12 +38,6 @@ <entityName>Classification_entity</entityName> <fieldName>ClassificationsAdministration</fieldName> </dependency> - <children> - <entityParameter> - <name>ClassificationType_param</name> - <valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationsadmin/children/classificationtype_param/valueProcess.js</valueProcess> - </entityParameter> - </children> </entityConsumer> <entityConsumer> <name>KeywordClassificationTypes</name> diff --git a/entity/ClassificationAdmin_entity/entityfields/classificationsadmin/children/classificationtype_param/valueProcess.js b/entity/ClassificationAdmin_entity/entityfields/classificationsadmin/children/classificationtype_param/valueProcess.js deleted file mode 100644 index 16c85500b5..0000000000 --- a/entity/ClassificationAdmin_entity/entityfields/classificationsadmin/children/classificationtype_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.UID")); \ No newline at end of file diff --git a/entity/ClassificationAdmin_entity/recordcontainers/jdito/contentProcess.js b/entity/ClassificationAdmin_entity/recordcontainers/jdito/contentProcess.js index 7ac1682daa..04f641a1be 100644 --- a/entity/ClassificationAdmin_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/ClassificationAdmin_entity/recordcontainers/jdito/contentProcess.js @@ -1,4 +1,4 @@ import("system.result"); import("system.db"); -result.object(db.table("select distinct CLASSIFICATIONTYPE from CLASSIFICATIONTYPE")); \ No newline at end of file +result.object([[""]]); \ No newline at end of file diff --git a/entity/Classification_entity/Classification_entity.aod b/entity/Classification_entity/Classification_entity.aod index e2d4e933f2..a4abf0e446 100644 --- a/entity/Classification_entity/Classification_entity.aod +++ b/entity/Classification_entity/Classification_entity.aod @@ -13,12 +13,14 @@ </entityProvider> <entityField> <name>CLASSIFICATIONID</name> + <searchable v="false" /> <valueProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationid/valueProcess.js</valueProcess> </entityField> <entityField> <name>CLASSIFICATIONSCORE_ID</name> <title>Selection</title> <consumer>ClassificationScores</consumer> + <searchable v="false" /> <titleProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationscore_id/titleProcess.js</titleProcess> <displayValueProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationscore_id/displayValueProcess.js</displayValueProcess> </entityField> @@ -66,12 +68,14 @@ </entityProvider> <entityField> <name>CLASSIFICATIONTYPEID</name> + <searchable v="false" /> <valueProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationtypeid/valueProcess.js</valueProcess> </entityField> <entityField> <name>SCORETYPE</name> <title>Scoretype</title> <mandatoryProcess>%aditoprj%/entity/Classification_entity/entityfields/scoretype/mandatoryProcess.js</mandatoryProcess> + <searchable v="false" /> <groupable v="true" /> <stateProcess>%aditoprj%/entity/Classification_entity/entityfields/scoretype/stateProcess.js</stateProcess> <displayValueProcess>%aditoprj%/entity/Classification_entity/entityfields/scoretype/displayValueProcess.js</displayValueProcess> @@ -83,6 +87,7 @@ <mandatoryProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationgroup/mandatoryProcess.js</mandatoryProcess> <dropDownProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationgroup/dropDownProcess.js</dropDownProcess> <textInputAllowed v="true" /> + <searchable v="false" /> <groupable v="true" /> <titleProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationgroup/titleProcess.js</titleProcess> <displayValueProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationgroup/displayValueProcess.js</displayValueProcess> @@ -90,18 +95,22 @@ </entityField> <entityField> <name>CLASSIFICATIONTYPE_ID</name> + <searchable v="false" /> <valueProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationtype_id/valueProcess.js</valueProcess> </entityField> <entityField> <name>OBJECT_ROWID</name> + <searchable v="false" /> <valueProcess>%aditoprj%/entity/Classification_entity/entityfields/object_rowid/valueProcess.js</valueProcess> </entityField> <entityField> <name>OBJECT_TYPE</name> + <searchable v="false" /> <valueProcess>%aditoprj%/entity/Classification_entity/entityfields/object_type/valueProcess.js</valueProcess> </entityField> <entityField> <name>UID</name> + <searchable v="false" /> </entityField> <entityConsumer> <name>ClassificationScores</name> @@ -138,10 +147,13 @@ </entityParameter> <entityField> <name>CLASSIFICATIONTYPE</name> - <consumer>ClassificationTypes</consumer> + <title>Usage</title> + <consumer>KeywordClassificationTypes</consumer> + <searchable v="true" /> <groupable v="true" /> - <state>EDITABLE</state> + <stateProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationtype/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationtype/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Classification_entity/entityfields/classificationtype/displayValueProcess.js</displayValueProcess> </entityField> <entityProvider> <name>ClassificationsAdministration</name> @@ -176,11 +188,13 @@ <name>Info</name> <title>Rating</title> <contentType>HTML</contentType> + <searchable v="false" /> <state>READONLY</state> <valueProcess>%aditoprj%/entity/Classification_entity/entityfields/info/valueProcess.js</valueProcess> </entityField> <entityField> <name>SCORE_RESULTS</name> + <searchable v="false" /> </entityField> <entityConsumer> <name>ClassificationTypes</name> @@ -191,11 +205,28 @@ <fieldName>#PROVIDER</fieldName> </dependency> </entityConsumer> + <entityConsumer> + <name>KeywordClassificationTypes</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>KeywordEntry_entity</entityName> + <fieldName>SpecificContainerKeywords</fieldName> + </dependency> + <children> + <entityParameter> + <name>ContainerName_param</name> + <valueProcess>%aditoprj%/entity/Classification_entity/entityfields/keywordclassificationtypes/children/containername_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <jDitoRecordContainer> <name>jdito</name> <jDitoRecordAlias>Data_alias</jDitoRecordAlias> + <isFilterable v="true" /> + <isRequireContainerFiltering v="true" /> <contentProcess>%aditoprj%/entity/Classification_entity/recordcontainers/jdito/contentProcess.js</contentProcess> <onInsert>%aditoprj%/entity/Classification_entity/recordcontainers/jdito/onInsert.js</onInsert> <onUpdate>%aditoprj%/entity/Classification_entity/recordcontainers/jdito/onUpdate.js</onUpdate> diff --git a/entity/Classification_entity/entityfields/classificationgroup/dropDownProcess.js b/entity/Classification_entity/entityfields/classificationgroup/dropDownProcess.js index 9151a529e9..dba2ecaa51 100644 --- a/entity/Classification_entity/entityfields/classificationgroup/dropDownProcess.js +++ b/entity/Classification_entity/entityfields/classificationgroup/dropDownProcess.js @@ -4,10 +4,12 @@ import("system.neon"); import("system.vars"); import("system.db"); import("system.result"); -logging.log(vars.get("$param.IsAdminMode_param")) if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.IsAdminMode_param") && vars.get("$param.IsAdminMode_param") == "1") { - logging.log(vars.get("$param.ClassificationType_param")) - logging.log(ClassificationUtils.getAllGroups(vars.get("$param.ClassificationType_param"), true).toSource()) - result.object(ClassificationUtils.getAllGroups(vars.get("$param.ClassificationType_param"), true)); + // use param if available or current selectionRows + var classificationType = vars.get("$field.CLASSIFICATIONTYPE") + logging.log("asdf " + vars.get("$field.CLASSIFICATIONTYPE")) + + if (classificationType) + result.object(ClassificationUtils.getAllGroups(classificationType, true)); } \ No newline at end of file diff --git a/entity/Classification_entity/entityfields/classificationgroup/onValidation.js b/entity/Classification_entity/entityfields/classificationgroup/onValidation.js index 4bce0a846e..92e2b5ca56 100644 --- a/entity/Classification_entity/entityfields/classificationgroup/onValidation.js +++ b/entity/Classification_entity/entityfields/classificationgroup/onValidation.js @@ -8,10 +8,21 @@ import("Entity_lib"); if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT && vars.exists("$param.IsAdminMode_param") && vars.get("$param.IsAdminMode_param") == "1") { var newGroup = ProcessHandlingUtils.getOnValidationValue(); - var groups = ClassificationUtils.getAllGroups(vars.get("$param.ClassificationType_param"), false) + + // use param if available or current selectionRows + var classificationType = ClassificationUtils.getUsageType("$param.ClassificationType_param", "$sys.selectionRows"); - if (groups.indexOf(newGroup, 0) != -1 && ClassificationUtils.getGroupFromDb(vars.get("$field.CLASSIFICATIONTYPEID")) != newGroup) + if (classificationType) + { + var groups = ClassificationUtils.getAllGroups(classificationType, false) + + if (groups.indexOf(newGroup, 0) != -1 && ClassificationUtils.getGroupFromDb(vars.get("$field.CLASSIFICATIONTYPEID")) != newGroup) + { + result.string(translate.text("The new Classification name already exists.")); + } + } + else { - result.string(translate.text("The new Classification name already exists.")); + result.string(translate.text("Could not determine the current Classification type (usage).")); } } diff --git a/entity/Classification_entity/entityfields/classificationtype/displayValueProcess.js b/entity/Classification_entity/entityfields/classificationtype/displayValueProcess.js new file mode 100644 index 0000000000..e56601c615 --- /dev/null +++ b/entity/Classification_entity/entityfields/classificationtype/displayValueProcess.js @@ -0,0 +1,6 @@ +import("system.result"); +import("system.vars"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +result.string(KeywordUtils.getViewValue($KeywordRegistry.classificationType(), vars.get("$this.value"))); \ No newline at end of file diff --git a/entity/Classification_entity/entityfields/classificationtype/stateProcess.js b/entity/Classification_entity/entityfields/classificationtype/stateProcess.js new file mode 100644 index 0000000000..bcc88cc57c --- /dev/null +++ b/entity/Classification_entity/entityfields/classificationtype/stateProcess.js @@ -0,0 +1,11 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) +{ + result.string(neon.COMPONENTSTATE_EDITABLE); +} +else +{ + result.string(neon.COMPONENTSTATE_READONLY); +} \ No newline at end of file diff --git a/entity/Classification_entity/entityfields/keywordclassificationtypes/children/containername_param/valueProcess.js b/entity/Classification_entity/entityfields/keywordclassificationtypes/children/containername_param/valueProcess.js new file mode 100644 index 0000000000..b5e82ac383 --- /dev/null +++ b/entity/Classification_entity/entityfields/keywordclassificationtypes/children/containername_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("KeywordRegistry_basic") + +result.string($KeywordRegistry.classificationType()) \ No newline at end of file diff --git a/entity/Classification_entity/recordcontainers/jdito/contentProcess.js b/entity/Classification_entity/recordcontainers/jdito/contentProcess.js index d0d8001f50..71b3cab9ca 100644 --- a/entity/Classification_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Classification_entity/recordcontainers/jdito/contentProcess.js @@ -1,3 +1,4 @@ +import("JditoFilter_lib"); import("system.logging"); import("Classification_lib"); import("system.vars"); @@ -8,6 +9,8 @@ import("system.result"); var admin = (vars.exists("$param.IsAdminMode_param") && vars.get("$param.IsAdminMode_param") == "1") var scores = {}; + + if (!admin) { scores = JSON.stringify(ClassificationUtils.getScore(vars.get("$param.ClassificationType_param"), vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowid_param"))); @@ -48,19 +51,21 @@ if (!classificationId) .or("CLASSIFICATION.OBJECT_ROWID is null")) } -logging.log(db.translateStatement(cond.buildSql("select case when CLASSIFICATIONID is not null then 'C,' || CLASSIFICATIONID else 'T,' || CLASSIFICATIONTYPEID end, CLASSIFICATIONID, CLASSIFICATIONGROUP, CLASSIFICATIONSCORE_ID, CLASSIFICATIONTYPEID, CLASSIFICATIONTYPE_ID, OBJECT_TYPE, OBJECT_ROWID, SCORETYPE, CLASSIFICATIONTYPE.CLASSIFICATIONTYPE from CLASSIFICATION \n\ - right join CLASSIFICATIONTYPE on " + db.translateCondition(SqlCondition.begin() - .and("CLASSIFICATIONTYPE_ID = CLASSIFICATIONTYPEID") - .andPrepareVars("CLASSIFICATION.OBJECT_TYPE", "$param.ObjectType_param") - .andPrepareVars("CLASSIFICATION.OBJECT_ROWID", "$param.ObjectRowid_param").build()), (admin ? "1=1" : "1=2"), "order by CLASSIFICATIONGROUP asc"))) +if (vars.exists("$local.userfilter") && vars.get("$local.userfilter")) +{ + var filter = vars.get("$local.userfilter"); + cond.andSqlCondition((JditoFilterUtils.getSqlCondition(filter, "CLASSIFICATION", undefined, { + CLASSIFICATIONTYPE : "CLASSIFICATIONTYPE.CLASSIFICATIONTYPE" + }))); +} result.object(db.table(cond.buildSql("select case when CLASSIFICATIONID is not null then 'C,' || CLASSIFICATIONID else 'T,' || CLASSIFICATIONTYPEID end, CLASSIFICATIONID, CLASSIFICATIONGROUP, CLASSIFICATIONSCORE_ID, CLASSIFICATIONTYPEID, CLASSIFICATIONTYPE_ID, OBJECT_TYPE, OBJECT_ROWID, SCORETYPE, CLASSIFICATIONTYPE.CLASSIFICATIONTYPE from CLASSIFICATION \n\ - right join CLASSIFICATIONTYPE on " + db.translateCondition(SqlCondition.begin() - .and("CLASSIFICATIONTYPE_ID = CLASSIFICATIONTYPEID") - .andPrepareVars("CLASSIFICATION.OBJECT_TYPE", "$param.ObjectType_param") - .andPrepareVars("CLASSIFICATION.OBJECT_ROWID", "$param.ObjectRowid_param").build()), (admin ? "1=1" : "1=2"), "order by CLASSIFICATIONGROUP asc")) - .map(function(pRow) - { - pRow.push(scores); - return pRow; - })); \ No newline at end of file + right join CLASSIFICATIONTYPE on " + db.translateCondition(SqlCondition.begin() + .and("CLASSIFICATIONTYPE_ID = CLASSIFICATIONTYPEID") + .andPrepareVars("CLASSIFICATION.OBJECT_TYPE", "$param.ObjectType_param") + .andPrepareVars("CLASSIFICATION.OBJECT_ROWID", "$param.ObjectRowid_param").build()), (admin ? "1=1" : "1=2"), "order by CLASSIFICATIONGROUP asc")) + .map(function(pRow) + { + pRow.push(scores); + return pRow; + })); \ No newline at end of file diff --git a/entity/Classification_entity/recordcontainers/jdito/onUpdate.js b/entity/Classification_entity/recordcontainers/jdito/onUpdate.js index 9a5b1a4a15..3040fd59b6 100644 --- a/entity/Classification_entity/recordcontainers/jdito/onUpdate.js +++ b/entity/Classification_entity/recordcontainers/jdito/onUpdate.js @@ -8,7 +8,6 @@ import("system.vars"); var changed = vars.get("$local.changed"); -logging.log(vars.get("$field.CLASSIFICATIONID")) // check if it already exists. Else it only exists as ScoreType but has no Classification-Entry if (vars.get("$field.CLASSIFICATIONID")) { @@ -42,7 +41,6 @@ if (vars.exists("$param.IsAdminMode_param") && vars.exists("$param.IsAdminMode_p { changed.forEach(function(change) { - logging.log(change) switch (change) { case "CLASSIFICATIONGROUP.value": @@ -50,6 +48,11 @@ if (vars.exists("$param.IsAdminMode_param") && vars.exists("$param.IsAdminMode_p var newGroupName = vars.get("$field.CLASSIFICATIONGROUP"); ClassificationUtils.changeGroupName(oldGroupName, newGroupName, vars.get("$field.CLASSIFICATIONTYPE")) + case "SCORE_TYPE.value": + var scoreId = vars.get("$field.CLASSIFICATIONSCORE_ID"); + var newScoreName = vars.get("$field.SCORE_TYPE"); + + ClassificationUtils.changeScoreName(newScoreName, scoreId); } }) diff --git a/entity/KeywordEntry_entity/KeywordEntry_entity.aod b/entity/KeywordEntry_entity/KeywordEntry_entity.aod index b4b9660d0b..38f57758f1 100644 --- a/entity/KeywordEntry_entity/KeywordEntry_entity.aod +++ b/entity/KeywordEntry_entity/KeywordEntry_entity.aod @@ -392,6 +392,12 @@ <fieldName>KeywordClassificationTypes</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>3a81e886-0d83-47f0-9ec7-c864ffc57cda</name> + <entityName>Classification_entity</entityName> + <fieldName>KeywordClassificationTypes</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> diff --git a/neonContext/ClassificationAdmin/ClassificationAdmin.aod b/neonContext/ClassificationAdmin/ClassificationAdmin.aod index 39b6239be4..26b6e61e6e 100644 --- a/neonContext/ClassificationAdmin/ClassificationAdmin.aod +++ b/neonContext/ClassificationAdmin/ClassificationAdmin.aod @@ -3,13 +3,8 @@ <name>ClassificationAdmin</name> <majorModelMode>DISTRIBUTED</majorModelMode> <mainview>ClassificationAdminMain_view</mainview> - <filterview>ClassificationAdminFilter_view</filterview> <entity>ClassificationAdmin_entity</entity> <references> - <neonViewReference> - <name>e29a0221-6ac6-47d3-bee0-950def1847a8</name> - <view>ClassificationAdminFilter_view</view> - </neonViewReference> <neonViewReference> <name>4a240156-6c62-46d8-890e-b5c239ef8128</name> <view>ClassificationAdminMain_view</view> diff --git a/neonView/ClassificationAdminFilter_view/ClassificationAdminFilter_view.aod b/neonView/ClassificationAdminFilter_view/ClassificationAdminFilter_view.aod deleted file mode 100644 index 3185915eb0..0000000000 --- a/neonView/ClassificationAdminFilter_view/ClassificationAdminFilter_view.aod +++ /dev/null @@ -1,22 +0,0 @@ -<?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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> - <name>ClassificationAdminFilter_view</name> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <boxLayout> - <name>layout</name> - </boxLayout> - </layout> - <children> - <tableViewTemplate> - <name>Classificationtypes</name> - <entityField>#ENTITY</entityField> - <columns> - <neonTableColumn> - <name>44e91668-7947-49e2-8aa4-b9a03bc87842</name> - <entityField>UID</entityField> - </neonTableColumn> - </columns> - </tableViewTemplate> - </children> -</neonView> diff --git a/neonView/ClassificationAdminTree_view/ClassificationAdminTree_view.aod b/neonView/ClassificationAdminTree_view/ClassificationAdminTree_view.aod index 2d44f2e088..423b78a6c9 100644 --- a/neonView/ClassificationAdminTree_view/ClassificationAdminTree_view.aod +++ b/neonView/ClassificationAdminTree_view/ClassificationAdminTree_view.aod @@ -2,16 +2,18 @@ <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> <name>ClassificationAdminTree_view</name> <majorModelMode>DISTRIBUTED</majorModelMode> + <filterable v="true" /> <layout> - <noneLayout> + <boxLayout> <name>layout</name> - </noneLayout> + </boxLayout> </layout> <children> <treeViewTemplate> <name>classificationTree</name> <titleField>SCORETYPE</titleField> <defaultGroupFields> + <element>CLASSIFICATIONTYPE</element> <element>CLASSIFICATIONGROUP</element> </defaultGroupFields> <hideContentSearch v="true" /> diff --git a/neonView/ClassificatonAdminEdit_view/ClassificatonAdminEdit_view.aod b/neonView/ClassificatonAdminEdit_view/ClassificatonAdminEdit_view.aod index 208379bfca..b0ef52c8a9 100644 --- a/neonView/ClassificatonAdminEdit_view/ClassificatonAdminEdit_view.aod +++ b/neonView/ClassificatonAdminEdit_view/ClassificatonAdminEdit_view.aod @@ -15,6 +15,10 @@ <drawerCaption>Classification</drawerCaption> <entityField>#ENTITY</entityField> <fields> + <entityFieldLink> + <name>31662c73-7352-4eb2-889d-3f63bff25686</name> + <entityField>CLASSIFICATIONTYPE</entityField> + </entityFieldLink> <entityFieldLink> <name>7fddc4d4-6bdc-4c7a-9d69-bba4a9506707</name> <entityField>CLASSIFICATIONGROUP</entityField> diff --git a/process/Classification_lib/process.js b/process/Classification_lib/process.js index a790e3fa72..a29e03f144 100644 --- a/process/Classification_lib/process.js +++ b/process/Classification_lib/process.js @@ -89,6 +89,32 @@ ClassificationUtils.changeGroupName = function(pOldName, pNewName, pClassificati { var groups = ClassificationUtils.getAllGroups(pClassificationType, false) + if (groups.indexOf(pNewName, 0) == -1) + { + db.updateData("CLASSIFICATIONTYPE", ["CLASSIFICATIONGROUP"], null, [pNewName], SqlCondition.equals("CLASSIFICATIONTYPE.CLASSIFICATIONGROUP", pOldName, "1=2")); + } +} + +ClassificationUtils.getUsageType = function(pParamField, pSelectionField) +{ + if (vars.exists(pParamField) && vars.get(pParamField)) + classificationType = vars.get(pParamField); + else if (vars.exists(pSelectionField) && vars.get(pSelectionField)) + { + var selection = vars.get(pSelectionField); + if (selection.length > 0 && selection[0]["CLASSIFICATIONTYPE"]) + { + classificationType = selection[0]["CLASSIFICATIONTYPE"]; + } + } + + return classificationType; +} + +ClassificationUtils.changeScoreName = function(pOldScoreName, pNewScoreName, pScoreId) +{ + var groups = ClassificationUtils.getAllScores(pClassificationGroup, false) + if (groups.indexOf(pNewName, 0) == -1) { db.updateData("CLASSIFICATIONTYPE", ["CLASSIFICATIONGROUP"], null, [pNewName], SqlCondition.equals("CLASSIFICATIONTYPE.CLASSIFICATIONGROUP", pOldName, "1=2")); -- GitLab