diff --git a/entity/Activity_entity/Activity_entity.aod b/entity/Activity_entity/Activity_entity.aod index 3f998199e73bd8addc2b6b5bf9a945d68533dcee..ce3be161074ff8548815219db99e0e7d641a1e4e 100644 --- a/entity/Activity_entity/Activity_entity.aod +++ b/entity/Activity_entity/Activity_entity.aod @@ -391,6 +391,28 @@ <documentation>%aditoprj%/entity/Activity_entity/entityfields/presetlinks_param/documentation.adoc</documentation> <description>PARAMETER</description> </entityParameter> + <entityConsumer> + <name>AttributeTree</name> + <title>Attribute Tree</title> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>AttributeRelationTree_entity</entityName> + <fieldName>TreeProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectRowId_param</name> + <valueProcess>%aditoprj%/entity/Activity_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Activity_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Activity_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js b/entity/Activity_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..6717e012d6f73633d708947198ce7e04dee68d82 --- /dev/null +++ b/entity/Activity_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.ACTIVITYID")); \ No newline at end of file diff --git a/entity/Activity_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js b/entity/Activity_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..431bcc952145cb451362fc69754f84ff1514bac5 --- /dev/null +++ b/entity/Activity_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); diff --git a/entity/AttributeRelationTree_entity/AttributeRelationTree_entity.aod b/entity/AttributeRelationTree_entity/AttributeRelationTree_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..12f10e91e643aa32eb5fa04b73ea1cd44ec91736 --- /dev/null +++ b/entity/AttributeRelationTree_entity/AttributeRelationTree_entity.aod @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="UTF-8"?> +<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.0"> + <name>AttributeRelationTree_entity</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <recordContainer>jdito</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + </entityProvider> + <entityField> + <name>PARENT_ID</name> + </entityField> + <entityField> + <name>TITLE</name> + </entityField> + <entityField> + <name>UID</name> + </entityField> + <entityParameter> + <name>ObjectType_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityParameter> + <name>ObjectRowId_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityProvider> + <name>TreeProvider</name> + <fieldType>DEPENDENCY_IN</fieldType> + <dependencies> + <entityDependency> + <name>e0a7a4bc-ec7f-4f09-9b94-cbeb328cd7b8</name> + <entityName>Organisation_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>f29d91fe-2537-486f-b9de-44065a7790d4</name> + <entityName>Person_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>445c1bd7-4e72-4ab7-a5b1-cc77924eb562</name> + <entityName>Product_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>4498139f-067c-4cca-b122-d9bc9100c53d</name> + <entityName>Activity_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>d6d5f9aa-4582-4ec5-9381-394a38a726e8</name> + <entityName>Offer_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>b728166d-a74f-4ca1-8ce7-7e57032f2a7d</name> + <entityName>Contract_entity</entityName> + <fieldName>AttributeTree</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> + </entityProvider> + </entityFields> + <recordContainers> + <jDitoRecordContainer> + <name>jdito</name> + <jDitoRecordAlias>Data_alias</jDitoRecordAlias> + <contentProcess>%aditoprj%/entity/AttributeRelationTree_entity/recordcontainers/jdito/contentProcess.js</contentProcess> + <recordFields> + <element>UID.value</element> + <element>PARENT_ID.value</element> + <element>TITLE.value</element> + </recordFields> + </jDitoRecordContainer> + </recordContainers> +</entity> diff --git a/entity/AttributeRelationTree_entity/recordcontainers/jdito/contentProcess.js b/entity/AttributeRelationTree_entity/recordcontainers/jdito/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e6b4f8a5171e30c73818b120f6f4de53eabef89f --- /dev/null +++ b/entity/AttributeRelationTree_entity/recordcontainers/jdito/contentProcess.js @@ -0,0 +1,44 @@ +import("system.vars"); +import("system.result"); +import("system.db"); +import("Attribute_lib"); +import("Sql_lib"); + +var objectType = vars.get("$param.ObjectType_param"); +var rowId = vars.get("$param.ObjectRowId_param"); +var attributeObj = {}; +var allAttributes = []; +var sqlSelect = "select AB_ATTRIBUTEID, ATTRIBUTE_PARENT_ID, ATTRIBUTE_NAME, ATTRIBUTE_LEVEL from AB_ATTRIBUTE"; + +var attributeValues = AttributeRelationUtils.getAllAttributes(rowId, objectType, false, true); + +_fetchAttributes(attributeValues.map(function (row) {return row[1]})); + +allAttributes = allAttributes + .sort(function (a, b) {return a[3] - b[3];}) //sort by level to make sure parents are added first + .map(function (row) {return [row[0], row[1], row[2]];}) //remove level from array + .concat(attributeValues); +result.object(allAttributes); + +function _fetchAttributes (pAttributeIds) +{ + var condition = SqlCondition.begin(); + var nextIds = []; + pAttributeIds.forEach(function (id) + { + if (!(id in this)) + condition.orPrepare("AB_ATTRIBUTE.AB_ATTRIBUTEID", id); + }, attributeObj); + db.table(condition.buildSql(sqlSelect, "1=2")) + .forEach(function (row) + { + this[row[0]] = true; + if (row[1]) + nextIds.push(row[1]); + else + row[1] = null; + allAttributes.push(row); + }, attributeObj); + if (nextIds.length) + _fetchAttributes(nextIds); +} \ No newline at end of file diff --git a/entity/AttributeRelation_entity/AttributeRelation_entity.aod b/entity/AttributeRelation_entity/AttributeRelation_entity.aod index f4ad545d26a03290a3be5fceeea76144a6947366..73827d2c937d3a4705dcf0efceab4d66b1a493c2 100644 --- a/entity/AttributeRelation_entity/AttributeRelation_entity.aod +++ b/entity/AttributeRelation_entity/AttributeRelation_entity.aod @@ -11,6 +11,7 @@ </entityProvider> <entityField> <name>AB_ATTRIBUTERELATIONID</name> + <searchable v="false" /> <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/ab_attributerelationid/valueProcess.js</valueProcess> </entityField> <entityField> @@ -25,11 +26,13 @@ <entityField> <name>OBJECT_ROWID</name> <mandatory v="true" /> + <searchable v="false" /> <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js</valueProcess> </entityField> <entityField> <name>OBJECT_TYPE</name> <mandatory v="true" /> + <searchable v="false" /> <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/object_type/valueProcess.js</valueProcess> </entityField> <entityField> @@ -46,6 +49,7 @@ <entityField> <name>CHAR_VALUE</name> <mandatory v="false" /> + <searchable v="false" /> </entityField> <entityProvider> <name>RelationsForSpecificObject</name> @@ -105,11 +109,13 @@ <entityField> <name>DATE_VALUE</name> <contentType>DATE</contentType> + <searchable v="false" /> <state>EDITABLE</state> </entityField> <entityField> <name>NUMBER_VALUE</name> <contentType>NUMBER</contentType> + <searchable v="false" /> <state>EDITABLE</state> </entityField> <entityParameter> @@ -120,16 +126,18 @@ <entityField> <name>BOOL_VALUE</name> <contentType>BOOLEAN</contentType> + <searchable v="false" /> <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js</valueProcess> </entityField> <entityField> <name>ID_VALUE</name> + <searchable v="false" /> </entityField> <entityField> <name>ATTRIBUTE_PARENT_ID</name> <title>Superordinate Attribute</title> <possibleItemsProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attribute_parent_id/possibleItemsProcess.js</possibleItemsProcess> - <groupable v="true" /> + <searchable v="false" /> <displayValueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attribute_parent_id/displayValueProcess.js</displayValueProcess> <onValueChangeTypes> <element>MASK</element> @@ -155,6 +163,7 @@ </entityConsumer> <entityField> <name>MEMO_VALUE</name> + <searchable v="false" /> </entityField> <entityParameter> <name>FilteredAttributeIds_param</name> diff --git a/entity/Contract_entity/Contract_entity.aod b/entity/Contract_entity/Contract_entity.aod index f50f874903380b9bae968e1122c47acd05a391b8..0e8b88c74865d3fe48c3612e865a07143dc34da9 100644 --- a/entity/Contract_entity/Contract_entity.aod +++ b/entity/Contract_entity/Contract_entity.aod @@ -300,6 +300,28 @@ </entityParameter> </children> </entityConsumer> + <entityConsumer> + <name>AttributeTree</name> + <title>Attribute Tree</title> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>AttributeRelationTree_entity</entityName> + <fieldName>TreeProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + <entityParameter> + <name>ObjectRowId_param</name> + <valueProcess>%aditoprj%/entity/Contract_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Contract_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js b/entity/Contract_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1dc63e18dbeacd2fbb1e7d09775000f40e26d483 --- /dev/null +++ b/entity/Contract_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.CONTRACTID")); diff --git a/entity/Contract_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js b/entity/Contract_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..431bcc952145cb451362fc69754f84ff1514bac5 --- /dev/null +++ b/entity/Contract_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod index 381b03b869942f2855c4d4f4614be6af156712cc..d1ed43232368d6f39dda7272862e065d670bcd31 100644 --- a/entity/Offer_entity/Offer_entity.aod +++ b/entity/Offer_entity/Offer_entity.aod @@ -636,6 +636,28 @@ <expose v="true" /> <description>PARAMETER</description> </entityParameter> + <entityConsumer> + <name>AttributeTree</name> + <title>Attribute Tree</title> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>AttributeRelationTree_entity</entityName> + <fieldName>TreeProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectRowId_param</name> + <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Offer_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js b/entity/Offer_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..4adebe4edff067c1964160dfa9f90a08cc5fdfe0 --- /dev/null +++ b/entity/Offer_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.OFFERID")); \ No newline at end of file diff --git a/entity/Offer_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js b/entity/Offer_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..431bcc952145cb451362fc69754f84ff1514bac5 --- /dev/null +++ b/entity/Offer_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 90e490097c536b2d957bce793f81218be764cbca..71a1654983f67461cdfc01401ad5b0da373c5b0c 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -398,6 +398,7 @@ <children> <entityParameter> <name>ObjectRowId_param</name> + <title></title> <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/attributes/children/objectrowid_param/valueProcess.js</valueProcess> <triggerRecalculation v="true" /> </entityParameter> @@ -721,6 +722,28 @@ <expose v="true" /> <description>PARAMETER</description> </entityParameter> + <entityConsumer> + <name>AttributeTree</name> + <title>Attribute Tree</title> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>AttributeRelationTree_entity</entityName> + <fieldName>TreeProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectRowId_param</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Organisation_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js b/entity/Organisation_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..957f645b377f903d61ab5ecab7a1a48ee34d0eab --- /dev/null +++ b/entity/Organisation_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.ORGANISATIONID")); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js b/entity/Organisation_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..431bcc952145cb451362fc69754f84ff1514bac5 --- /dev/null +++ b/entity/Organisation_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index b8b639094ddf118196ebc689d6b123fc1686b2ee..3772446a2fc27d63c6492fc487cf90cd650aba77 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -781,6 +781,28 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact </entityParameter> </children> </entityConsumer> + <entityConsumer> + <name>AttributeTree</name> + <title>Attribute Tree</title> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>AttributeRelationTree_entity</entityName> + <fieldName>TreeProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectRowId_param</name> + <valueProcess>%aditoprj%/entity/Person_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Person_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Person_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js b/entity/Person_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..07081dc34f62162ad93f6b7b28f0caeb67dc283e --- /dev/null +++ b/entity/Person_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.PERSONID")); diff --git a/entity/Person_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js b/entity/Person_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..431bcc952145cb451362fc69754f84ff1514bac5 --- /dev/null +++ b/entity/Person_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); diff --git a/entity/Product_entity/Product_entity.aod b/entity/Product_entity/Product_entity.aod index cd11c3d2bc3ab36211de3f5256de7898ef4d1395..481c5df54c98daa85cbff2e23d2cb67dfdd44e39 100644 --- a/entity/Product_entity/Product_entity.aod +++ b/entity/Product_entity/Product_entity.aod @@ -404,6 +404,28 @@ </entityParameter> </children> </entityConsumer> + <entityConsumer> + <name>AttributeTree</name> + <title>Attribute Tree</title> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>AttributeRelationTree_entity</entityName> + <fieldName>TreeProvider</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectRowId_param</name> + <valueProcess>%aditoprj%/entity/Product_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Product_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js</valueProcess> + <triggerRecalculation v="true" /> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Product_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js b/entity/Product_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..60b7269a1beff4e4c23e81cf7254f2ef95633365 --- /dev/null +++ b/entity/Product_entity/entityfields/attributetree/children/objectrowid_param/valueProcess.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.result"); +import("Context_lib"); + +result.string(vars.get("$field.PRODUCTID")); diff --git a/entity/Product_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js b/entity/Product_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..431bcc952145cb451362fc69754f84ff1514bac5 --- /dev/null +++ b/entity/Product_entity/entityfields/attributetree/children/objecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 7b30b805b9b00d7c9134551d3097dd2bab877c4c..4e36c06524b0a50724556598a1c36da71026f7fb 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -359,6 +359,10 @@ <key>Touchpoints</key> <value>Kontaktpunkte</value> </entry> + <entry> + <key>Attribute Tree</key> + <value>Eigenschaftsbaum</value> + </entry> <entry> <key>Company Addresses</key> <value>Firmenadressen</value> diff --git a/neonContext/AttributeRelationTree/AttributeRelationTree.aod b/neonContext/AttributeRelationTree/AttributeRelationTree.aod new file mode 100644 index 0000000000000000000000000000000000000000..bcd7bec8f8c74b3791ebdd93a728c950493b2781 --- /dev/null +++ b/neonContext/AttributeRelationTree/AttributeRelationTree.aod @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> + <name>AttributeRelationTree</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <entity>AttributeRelationTree_entity</entity> + <references> + <neonViewReference> + <name>55f89863-72b0-4179-8494-b1e320d79de9</name> + <view>AttributeRelationTree_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonView/ActivityMain_view/ActivityMain_view.aod b/neonView/ActivityMain_view/ActivityMain_view.aod index eb9974e40d7cd64f15e8899e7530ffeda07acc89..af453fbc92e75cadbedb0cbd0afd3c00e8c5be2e 100644 --- a/neonView/ActivityMain_view/ActivityMain_view.aod +++ b/neonView/ActivityMain_view/ActivityMain_view.aod @@ -39,5 +39,10 @@ <entityField>Attributes</entityField> <view>AttributeRelationFilter_view</view> </neonViewReference> + <neonViewReference> + <name>f57fb116-d356-47c7-8da6-ee64b4a01b46</name> + <entityField>AttributeTree</entityField> + <view>AttributeRelationTree_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/AttributeRelationFilter_view/AttributeRelationFilter_view.aod b/neonView/AttributeRelationFilter_view/AttributeRelationFilter_view.aod index d655cdd2dacfb9464b285475f0726c65aa390dba..3a0762d98f996ccbc67bc31b51e76fdbe84eff4d 100644 --- a/neonView/AttributeRelationFilter_view/AttributeRelationFilter_view.aod +++ b/neonView/AttributeRelationFilter_view/AttributeRelationFilter_view.aod @@ -5,9 +5,9 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <filterable v="true" /> <layout> - <groupLayout> + <boxLayout> <name>layout</name> - </groupLayout> + </boxLayout> </layout> <children> <tableViewTemplate> @@ -25,14 +25,5 @@ </neonTableColumn> </columns> </tableViewTemplate> - <treetableViewTemplate> - <name>RelationsTreetable</name> - <titleField>valueProxy</titleField> - <defaultGroupFields> - <element>ATTRIBUTE_PARENT_ID</element> - <element>AB_ATTRIBUTE_ID</element> - </defaultGroupFields> - <entityField>#ENTITY</entityField> - </treetableViewTemplate> </children> </neonView> diff --git a/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod b/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod index b1cd03b35f0c1b8f137ba724fe03ceba32679326..cdb9d9672088b1fa2ce64e759906d8260cbf1f75 100644 --- a/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod +++ b/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod @@ -1,21 +1,18 @@ -<?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.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.0"> - <name>AttributeRelationTree_view</name> - <title>Attributes</title> - <majorModelMode>DISTRIBUTED</majorModelMode> - <filterable v="true" /> - <layout> - <groupLayout> - <name>layout</name> - </groupLayout> - </layout> - <children> - <treetableViewTemplate> - <name>Treetable</name> - <titleField>AB_ATTRIBUTE_ID</titleField> - <descriptionField>ATTRIBUTERELATION_VALUE</descriptionField> - <entityField>#ENTITY</entityField> - <title></title> - </treetableViewTemplate> - </children> -</neonView> +<?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.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.0"> + <name>AttributeRelationTree_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <treetableViewTemplate> + <name>AttributeRelationTree</name> + <parentField>PARENT_ID</parentField> + <titleField>TITLE</titleField> + <entityField>#ENTITY</entityField> + </treetableViewTemplate> + </children> +</neonView> diff --git a/neonView/ContractMain_view/ContractMain_view.aod b/neonView/ContractMain_view/ContractMain_view.aod index 3ceece90590160970331f5d228422451f617b2a5..a40e7c73b8f9fa3664b0588566a151a6aa889791 100644 --- a/neonView/ContractMain_view/ContractMain_view.aod +++ b/neonView/ContractMain_view/ContractMain_view.aod @@ -29,5 +29,10 @@ <entityField>Attributes</entityField> <view>AttributeRelationFilter_view</view> </neonViewReference> + <neonViewReference> + <name>940f0dca-aee3-4af6-ae50-9334964ce414</name> + <entityField>AttributeTree</entityField> + <view>AttributeRelationTree_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/OfferMain_view/OfferMain_view.aod b/neonView/OfferMain_view/OfferMain_view.aod index 5acba02e0c0f1c8adb885739dfa7835a4cc84ec8..bd7a35f5f6aa3edc2aa06de6651ab5eadcb05770 100644 --- a/neonView/OfferMain_view/OfferMain_view.aod +++ b/neonView/OfferMain_view/OfferMain_view.aod @@ -44,5 +44,10 @@ <entityField>Attributes</entityField> <view>AttributeRelationFilter_view</view> </neonViewReference> + <neonViewReference> + <name>e1554e33-710f-4bb5-a345-953c15985ca4</name> + <entityField>AttributeTree</entityField> + <view>AttributeRelationTree_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/OrganisationMain_view/OrganisationMain_view.aod b/neonView/OrganisationMain_view/OrganisationMain_view.aod index 3e7ccf4980fd9dbc0b4cf0a6d79e67e4daba73ec..a8dde5ffe1a569d4f988291c2ab7b3b82fe061f4 100644 --- a/neonView/OrganisationMain_view/OrganisationMain_view.aod +++ b/neonView/OrganisationMain_view/OrganisationMain_view.aod @@ -60,5 +60,10 @@ <entityField>Attributes</entityField> <view>AttributeRelationFilter_view</view> </neonViewReference> + <neonViewReference> + <name>ba50e069-06da-440e-b04a-5a686fcf5303</name> + <entityField>AttributeTree</entityField> + <view>AttributeRelationTree_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/PersonMain_view/PersonMain_view.aod b/neonView/PersonMain_view/PersonMain_view.aod index afe8033aeea91388e82572f75e0c350f0524b51b..6ab7d40c76a2814f8119978f334037ed0a5758b1 100644 --- a/neonView/PersonMain_view/PersonMain_view.aod +++ b/neonView/PersonMain_view/PersonMain_view.aod @@ -49,6 +49,11 @@ <entityField>Attributes</entityField> <view>AttributeRelationFilter_view</view> </neonViewReference> + <neonViewReference> + <name>cf989bf6-3e49-44fc-ba98-322aae377da3</name> + <entityField>AttributeTree</entityField> + <view>AttributeRelationTree_view</view> + </neonViewReference> <neonViewReference> <name>c2606a8b-eac1-412e-893d-bb788d4a5b5c</name> <entityField>OtherContacts</entityField> diff --git a/neonView/ProductMain_view/ProductMain_view.aod b/neonView/ProductMain_view/ProductMain_view.aod index 7ac4a87c4db385d9c6be171334d2084be0cbe6e9..28de5da8164ab75a02cc6e603114a21e1cc448df 100644 --- a/neonView/ProductMain_view/ProductMain_view.aod +++ b/neonView/ProductMain_view/ProductMain_view.aod @@ -49,5 +49,10 @@ <entityField>Attributes</entityField> <view>AttributeRelationFilter_view</view> </neonViewReference> + <neonViewReference> + <name>6ee1258f-b571-45c1-b833-f292361b5a04</name> + <entityField>AttributeTree</entityField> + <view>AttributeRelationTree_view</view> + </neonViewReference> </children> </neonView> diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js index 6614f1c74149370b5d9309558f6f797f8d6a5031..08b0fba8f927bb1a913d8a2a65c8d4adf20f383a 100644 --- a/process/Attribute_lib/process.js +++ b/process/Attribute_lib/process.js @@ -199,17 +199,18 @@ AttributeRelationUtils.getAttribute = function (pAttributeId, pObjectRowId, pObj * @param {String} pObjectRowId object rowid * @param {String} [pObjectType=null] object-type * @param {String} [pResolveNames=false] if true the full attribute names are used instead of the ids + * @param {String} [pGetUID=false] include the attributeRelation id * - * @return {String[][]} two-dimensional array a row is [attributeId|attributeName, value] + * @return {String[][]} two-dimensional array a row is [attributeId|attributeName, value] or if pGetUID is true, [attriuteRelationId, attributeId|attributeName, value] */ -AttributeRelationUtils.getAllAttributes = function (pObjectRowId, pObjectType, pResolveNames) +AttributeRelationUtils.getAllAttributes = function (pObjectRowId, pObjectType, pResolveNames, pGetUID) { var attrCond = SqlCondition.begin() .andPrepare("AB_ATTRIBUTERELATION.OBJECT_ROWID", pObjectRowId); if (pObjectType != null) - attrCond.andPrepare("AB_ATTRIBUTERELATION.OBJECT_TYPE", pAttributeId); + attrCond.andPrepare("AB_ATTRIBUTERELATION.OBJECT_TYPE", pObjectType); - var attributeSql = attrCond.buildSql("select AB_ATTRIBUTE_ID, AB_ATTRIBUTE.ATTRIBUTE_TYPE, AB_ATTRIBUTE.KEYWORD_CONTAINER, COMBOVAL.ATTRIBUTE_NAME, " + var attributeSql = attrCond.buildSql("select AB_ATTRIBUTERELATIONID, AB_ATTRIBUTE_ID, AB_ATTRIBUTE.ATTRIBUTE_TYPE, AB_ATTRIBUTE.KEYWORD_CONTAINER, COMBOVAL.ATTRIBUTE_NAME, " + AttributeTypeUtil.getAllDatabaseFields().join(", ") + " from AB_ATTRIBUTERELATION join AB_ATTRIBUTE on AB_ATTRIBUTE_ID = AB_ATTRIBUTE.AB_ATTRIBUTEID" + " left join AB_ATTRIBUTE COMBOVAL on " + $AttributeTypes.COMBO.databaseField + " = COMBOVAL.AB_ATTRIBUTEID"); @@ -217,7 +218,7 @@ AttributeRelationUtils.getAllAttributes = function (pObjectRowId, pObjectType, p var attributeNameMap = {}; var attributeValues = db.table(attributeSql).map(function (row) { - let attribute = row[0]; + let attribute = row[1]; if (pResolveNames) { if (!(attribute in attributeNameMap)) @@ -225,13 +226,15 @@ AttributeRelationUtils.getAllAttributes = function (pObjectRowId, pObjectType, p attribute = attributeNameMap[attribute]; } let value; - if (row[1].trim() == $AttributeTypes.COMBO) - value = row[3]; + if (row[2].trim() == $AttributeTypes.COMBO) + value = row[4]; else { - value = row[AttributeTypeUtil.getTypeColumnIndex(row[1]) + 4]; - value = AttributeTypeUtil.getAttributeViewValue(row[1].trim(), value, row[2]); + value = row[AttributeTypeUtil.getTypeColumnIndex(row[2]) + 5]; + value = AttributeTypeUtil.getAttributeViewValue(row[2].trim(), value, row[3]); } + if (pGetUID) + return [row[0], attribute, value]; return [attribute, value]; });