diff --git a/entity/Attribute_entity/Attribute_entity.aod b/entity/Attribute_entity/Attribute_entity.aod index c822242ce84c3769f716300ea8f0e0a5bdd76e48..6a7b1297888bd82a331f6c1d6f8417112012f9ba 100644 --- a/entity/Attribute_entity/Attribute_entity.aod +++ b/entity/Attribute_entity/Attribute_entity.aod @@ -33,6 +33,7 @@ <consumer>AttributeChildren</consumer> <linkedContext>Attribute</linkedContext> <groupable v="true" /> + <stateProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_parent_id/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_parent_id/displayValueProcess.js</displayValueProcess> </entityField> @@ -130,6 +131,9 @@ </entityParameter> <entityField> <name>ATTRIBUTE_LEVEL</name> + <title>Level</title> + <contentType>NUMBER</contentType> + <state>INVISIBLE</state> <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_level/valueProcess.js</valueProcess> </entityField> </entityFields> @@ -139,6 +143,7 @@ <alias>Data_alias</alias> <conditionProcess>%aditoprj%/entity/Attribute_entity/recordcontainers/db/conditionProcess.js</conditionProcess> <orderClauseProcess>%aditoprj%/entity/Attribute_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> + <onDBInsert>%aditoprj%/entity/Attribute_entity/recordcontainers/db/onDBInsert.js</onDBInsert> <onDBDelete>%aditoprj%/entity/Attribute_entity/recordcontainers/db/onDBDelete.js</onDBDelete> <linkInformation> <linkInformation> diff --git a/entity/Attribute_entity/entityfields/attribute_level/valueProcess.js b/entity/Attribute_entity/entityfields/attribute_level/valueProcess.js index 8e8d195242aa5735e81a244fedec148bcf5184cb..5098441456e49ebb7530ad34d47f27c41b925849 100644 --- a/entity/Attribute_entity/entityfields/attribute_level/valueProcess.js +++ b/entity/Attribute_entity/entityfields/attribute_level/valueProcess.js @@ -1,5 +1,4 @@ import("system.neon"); -import("system.logging"); import("system.result"); import("system.vars"); @@ -8,4 +7,4 @@ if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) && vars.exists("$param.attrParentId_param") && vars.get("$param.attrParentId_param")) result.string(parseInt(vars.get("$param.attributeLevel_param")) + 1); else - result.string("0"); \ No newline at end of file + result.string("0"); diff --git a/entity/Attribute_entity/entityfields/attribute_parent_id/displayValueProcess.js b/entity/Attribute_entity/entityfields/attribute_parent_id/displayValueProcess.js index 9f1862b57265475b757e10d636d9f5ae5a31e2f2..24c340a034a026f42e40928fa7713e86dac60cb8 100644 --- a/entity/Attribute_entity/entityfields/attribute_parent_id/displayValueProcess.js +++ b/entity/Attribute_entity/entityfields/attribute_parent_id/displayValueProcess.js @@ -5,3 +5,5 @@ import("Attribute_lib"); if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.attrParentId_param") && vars.get("$param.attrParentId_param")) result.string(AttributeUtil.getAttributeNameById(vars.get("$param.attrParentId_param"))); +else + result.string(AttributeUtil.getAttributeNameById(vars.get("$field.ATTRIBUTE_PARENT_ID"))) \ No newline at end of file diff --git a/entity/Attribute_entity/entityfields/attribute_parent_id/stateProcess.js b/entity/Attribute_entity/entityfields/attribute_parent_id/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..876969048dfe73156cafbe8c083b7df89e968694 --- /dev/null +++ b/entity/Attribute_entity/entityfields/attribute_parent_id/stateProcess.js @@ -0,0 +1,11 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +var fieldState; +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + fieldState = neon.COMPONENTSTATE_AUTO; +else + fieldState = neon.COMPONENTSTATE_READONLY; + +result.string(fieldState); \ No newline at end of file diff --git a/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js b/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js index 6698c1cd9bf3b2ee1ef19ced286b6f620fe93df2..331013e78c636d6fe4a95599377299a83abebe16 100644 --- a/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js +++ b/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js @@ -1,5 +1,4 @@ import("system.neon"); -import("system.logging"); import("system.result"); import("system.vars"); diff --git a/entity/Attribute_entity/recordcontainers/db/onDBInsert.js b/entity/Attribute_entity/recordcontainers/db/onDBInsert.js new file mode 100644 index 0000000000000000000000000000000000000000..4d04bd35a23a9b71da2fe8d62ae17fbd32cb6bb8 --- /dev/null +++ b/entity/Attribute_entity/recordcontainers/db/onDBInsert.js @@ -0,0 +1,31 @@ +import("system.db"); +import("system.neon"); +import("system.result"); +import("system.vars"); +import("system.util"); +import("Sql_lib"); + +if (vars.exists("$param.attrParentId_param") && vars.get("$param.attrParentId_param")) +{ + var parentId = vars.get("$param.attrParentId_param"); + var attributeId = vars.get("$field.AB_ATTRIBUTEID"); + var cols = [ + "AB_ATTRIBUTEUSAGEID", + "OBJECT_TYPE", + "AB_ATTRIBUTE_ID" + ]; + var usageSql = SqlCondition.begin() + .andPrepare("AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID", parentId) + .buildSql("select " + cols.join(", ") + " from AB_ATTRIBUTEUSAGE", "1=0"); + var usages = db.table(usageSql); + + var table = "AB_ATTRIBUTEUSAGE"; + var types = db.getColumnTypes(table, cols); + + var toInsert = usages.map(function (row) + { + return [table, cols, types, [util.getNewUUID(), row[1], attributeId]]; + }); + + db.inserts(toInsert); +} \ No newline at end of file diff --git a/neonView/AttributeEdit_view/AttributeEdit_view.aod b/neonView/AttributeEdit_view/AttributeEdit_view.aod index e68bf0bc073627df37ef7548b26597b685bc879a..bae017aaf8b595285763e83ec8707b9e84a4abbd 100644 --- a/neonView/AttributeEdit_view/AttributeEdit_view.aod +++ b/neonView/AttributeEdit_view/AttributeEdit_view.aod @@ -29,6 +29,10 @@ <name>d26696ac-199c-45f0-9147-b75dee3f4b65</name> <entityField>ATTRIBUTE_ACTIVE</entityField> </entityFieldLink> + <entityFieldLink> + <name>c8a5f45e-8092-45f4-ac22-681700447235</name> + <entityField>ATTRIBUTE_LEVEL</entityField> + </entityFieldLink> </fields> </genericViewTemplate> <neonViewReference> diff --git a/neonView/AttributePreview_view/AttributePreview_view.aod b/neonView/AttributePreview_view/AttributePreview_view.aod index 58359b8d75dcc8ad9bfb9f0bd2e78653cc71b21e..59adbab341fa443a18be81de0097635898b4fc31 100644 --- a/neonView/AttributePreview_view/AttributePreview_view.aod +++ b/neonView/AttributePreview_view/AttributePreview_view.aod @@ -24,6 +24,10 @@ <name>e00bfeb1-7003-4d5a-b71a-c6921e255c9d</name> <entityField>ATTRIBUTE_ACTIVE</entityField> </entityFieldLink> + <entityFieldLink> + <name>00a51564-0eca-43f9-8235-b811df1dbafd</name> + <entityField>ATTRIBUTE_LEVEL</entityField> + </entityFieldLink> </fields> </genericViewTemplate> </children> diff --git a/neonView/AttributeUsageFilter_view/AttributeUsageFilter_view.aod b/neonView/AttributeUsageFilter_view/AttributeUsageFilter_view.aod index ebd9d7f89a2d5a7476b9f31c8ee24f84118aee9b..eeb1eed20e2d6eb13d75e245cbeb7e8b79bb76b1 100644 --- a/neonView/AttributeUsageFilter_view/AttributeUsageFilter_view.aod +++ b/neonView/AttributeUsageFilter_view/AttributeUsageFilter_view.aod @@ -11,20 +11,13 @@ <children> <tableViewTemplate> <name>UsageTable_template</name> + <autoNewRow v="true" /> <entityField>#ENTITY</entityField> <columns> <neonTableColumn> <name>ba8d5468-4e59-4ab8-8174-afcca1ae0d9e</name> <entityField>OBJECT_TYPE</entityField> </neonTableColumn> - <neonTableColumn> - <name>7e7ebe69-2c09-402c-9264-5c5ea48a202b</name> - <entityField>MIN_COUNT</entityField> - </neonTableColumn> - <neonTableColumn> - <name>07683f36-9b32-43aa-8bd5-51c3d7761c76</name> - <entityField>MAX_COUNT</entityField> - </neonTableColumn> </columns> </tableViewTemplate> </children> diff --git a/neonView/AttributeUsageMultiEdit_view/AttributeUsageMultiEdit_view.aod b/neonView/AttributeUsageMultiEdit_view/AttributeUsageMultiEdit_view.aod index d4c440597438eeaa4c21caa866e4262314bc19d6..231d9cf048557708638e4a93eeb3a471d91cda3a 100644 --- a/neonView/AttributeUsageMultiEdit_view/AttributeUsageMultiEdit_view.aod +++ b/neonView/AttributeUsageMultiEdit_view/AttributeUsageMultiEdit_view.aod @@ -17,18 +17,6 @@ <entityField>OBJECT_TYPE</entityField> <width v="75" /> </neonTableColumn> - <neonTableColumn> - <name>0ea0ead0-99a7-460a-ab8a-d3ef5f780682</name> - <entityField>MIN_COUNT</entityField> - <width v="75" /> - <expandRatio v="100" /> - </neonTableColumn> - <neonTableColumn> - <name>6fcd2a5b-641f-4b8f-aee0-cb18987b8a04</name> - <entityField>MAX_COUNT</entityField> - <width v="75" /> - <expandRatio v="100" /> - </neonTableColumn> </columns> </genericMultipleViewTemplate> </children>