Skip to content
Snippets Groups Projects
Commit d03439ba authored by S.Listl's avatar S.Listl
Browse files

Attribute groups

parent d13c2525
No related branches found
No related tags found
No related merge requests found
Showing
with 59 additions and 23 deletions
......@@ -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>
......
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");
......@@ -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
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
import("system.neon");
import("system.logging");
import("system.result");
import("system.vars");
......
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
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
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