From 3032c3c4cd41842a4b35e5e252e950bec4ec59d5 Mon Sep 17 00:00:00 2001 From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local> Date: Wed, 27 Mar 2019 08:58:22 +0100 Subject: [PATCH] Attribute and Index optimization --- aliasDefinition/Data_alias/Data_alias.aod | 6 +++--- .../Data_alias/indexsearchgroups/offer/query.js | 10 +++++++--- .../indexsearchgroups/organisation/query.js | 2 +- .../Data_alias/indexsearchgroups/person/query.js | 2 +- .../indexsearchgroups/salesorder/query.js | 13 +++++++------ .../AttributeRelation_entity.aod | 2 ++ .../attribute_parent_id/displayValueProcess.js | 5 +++++ .../recordcontainers/db/orderClauseProcess.js | 5 +++++ entity/Attribute_entity/Attribute_entity.aod | 3 +++ .../AttributeRelationFilter_view.aod | 8 +++++--- 10 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 entity/AttributeRelation_entity/entityfields/attribute_parent_id/displayValueProcess.js create mode 100644 entity/AttributeRelation_entity/recordcontainers/db/orderClauseProcess.js diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 7e09926aa3..7e3443fa75 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -5134,7 +5134,7 @@ <name>OFFER</name> <title>Offer</title> <icon>VAADIN:CART</icon> - <active v="false" /> + <active v="true" /> <idColumn>OFFERID</idColumn> <titleColumn>TITLECOLUMN</titleColumn> <descriptionColumn>DESCCOLUMN</descriptionColumn> @@ -5147,9 +5147,9 @@ </indexSearchGroup> <indexSearchGroup> <name>SALESORDER</name> - <title>Order</title> + <title>Receipt</title> <icon>VAADIN:DOLLAR</icon> - <active v="false" /> + <active v="true" /> <idColumn>SALESORDERID</idColumn> <titleColumn>TITLECOLUMN</titleColumn> <descriptionColumn>DESCCOLUMN</descriptionColumn> diff --git a/aliasDefinition/Data_alias/indexsearchgroups/offer/query.js b/aliasDefinition/Data_alias/indexsearchgroups/offer/query.js index d8bff6962e..1ad88702c6 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/offer/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/offer/query.js @@ -2,9 +2,12 @@ import("system.result"); import("system.vars"); import("system.calendars"); import("system.db"); +import("Keyword_lib"); import("Sql_lib"); +import("KeywordRegistry_basic"); var sqlQuery, sqlHelper, queryCondition, affectedIds; +queryCondition = ""; if (vars.exists("$local.idvalue")) { affectedIds = vars.get("$local.idvalue"); queryCondition = "where OFFERID in ('" + affectedIds.map(function (v){return db.quote(v);}).join("', '") + "')"; @@ -12,9 +15,10 @@ if (vars.exists("$local.idvalue")) { } sqlHelper = new SqlMaskingUtils(); sqlQuery = "select OFFERID, " - + "OFFERCODE as TITLECOLUMN, " - + sqlHelper.concat(["ORGNAME", "'| Kd-Nr.: '", "CUSTOMERCODE"]) - + " as DESCCOLUMN, OFFERCODE, ORGNAME, CUSTOMERCODE " + + sqlHelper.concat(["OFFERCODE", KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.offerStatus(), "OFFER.STATUS")], " | ") + + " as TITLECOLUMN, " + + sqlHelper.concat(["ORGANISATION.NAME", "'| Kd-Nr.: '", "CUSTOMERCODE"]) + + " as DESCCOLUMN, OFFERCODE, ORGANISATION.NAME, CUSTOMERCODE " + " from OFFER " + " join CONTACT on OFFER.CONTACT_ID = CONTACTID " + " join ORGANISATION on ORGANISATIONID = CONTACT.ORGANISATION_ID " diff --git a/aliasDefinition/Data_alias/indexsearchgroups/organisation/query.js b/aliasDefinition/Data_alias/indexsearchgroups/organisation/query.js index 8deb7a7a4f..5778a7f9e4 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/organisation/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/organisation/query.js @@ -12,7 +12,7 @@ if (vars.exists("$local.idvalue")) { } sqlHelper = new SqlMaskingUtils(); sqlQuery = "select CONTACT.CONTACTID " - + "," + sqlHelper.concat(["ORGANISATION.NAME", "ORGANISATION.CUSTOMERCODE"]) + + "," + sqlHelper.concat(["ORGANISATION.NAME", "ORGANISATION.CUSTOMERCODE"], " | ") + " as TITLECOLUMN " + "," + sqlHelper.concat([ sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO"]) diff --git a/aliasDefinition/Data_alias/indexsearchgroups/person/query.js b/aliasDefinition/Data_alias/indexsearchgroups/person/query.js index 8dd398447f..6178113261 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/person/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/person/query.js @@ -12,7 +12,7 @@ if (vars.exists("$local.idvalue")) { } sqlHelper = new SqlMaskingUtils(); sqlQuery = "select CONTACT.CONTACTID " - + "," + sqlHelper.concat(["PERSON.SALUTATION", "PERSON.FIRSTNAME", "PERSON.LASTNAME", "ORGANISATION.NAME"]) + + "," + sqlHelper.concat(["PERSON.SALUTATION", "PERSON.FIRSTNAME", "PERSON.LASTNAME", "'|'", "ORGANISATION.NAME"]) + " as TITLECOLUMN " + "," + sqlHelper.concat([ sqlHelper.concat(["defaultAddress.ADDRESS", "defaultAddress.BUILDINGNO"]) diff --git a/aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js b/aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js index 39a1d15028..02db43bf56 100644 --- a/aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js +++ b/aliasDefinition/Data_alias/indexsearchgroups/salesorder/query.js @@ -5,6 +5,7 @@ import("system.db"); import("Sql_lib"); var sqlQuery, sqlHelper, queryCondition, affectedIds; +queryCondition = ""; if (vars.exists("$local.idvalue")) { affectedIds = vars.get("$local.idvalue"); queryCondition = "where OFFERID in ('" + affectedIds.map(function (v){return db.quote(v);}).join("', '") + "')"; @@ -12,11 +13,11 @@ if (vars.exists("$local.idvalue")) { } sqlHelper = new SqlMaskingUtils(); sqlQuery = "select SALESORDERID, " - + " ORDERCODE as TITLECOLUMN, " - + sqlHelper.concat(["ORGNAME", "'| Kd-Nr.: '", "CUSTOMERCODE"]) - + " as DESCCOLUMN, ORDERCODE, ORGNAME, CUSTOMERCODE " + + " SALESORDERCODE as TITLECOLUMN, " + + sqlHelper.concat(["ORGANISATION.NAME", "'| Kd-Nr.: '", "CUSTOMERCODE"]) + + " as DESCCOLUMN, SALESORDERCODE, ORGANISATION.NAME, CUSTOMERCODE " + " from SALESORDER " - + " join RELATION on SALESORDER.RELATION_ID = RELATIONID " - + " join ORG on ORGID = RELATION.ORG_ID " - + queryCondition + " order by ORDERCODE "; + + " join CONTACT on SALESORDER.CONTACT_ID = CONTACTID " + + " join ORGANISATION on ORGANISATIONID = CONTACT.ORGANISATION_ID " + + queryCondition + " order by SALESORDERCODE "; result.string(sqlQuery); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/AttributeRelation_entity.aod b/entity/AttributeRelation_entity/AttributeRelation_entity.aod index e257ce32b6..f4ad545d26 100644 --- a/entity/AttributeRelation_entity/AttributeRelation_entity.aod +++ b/entity/AttributeRelation_entity/AttributeRelation_entity.aod @@ -130,6 +130,7 @@ <title>Superordinate Attribute</title> <possibleItemsProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attribute_parent_id/possibleItemsProcess.js</possibleItemsProcess> <groupable v="true" /> + <displayValueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attribute_parent_id/displayValueProcess.js</displayValueProcess> <onValueChangeTypes> <element>MASK</element> <element>PROCESS</element> @@ -198,6 +199,7 @@ <alias>Data_alias</alias> <fromClauseProcess>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> <conditionProcess>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <orderClauseProcess>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> <linkInformation> <linkInformation> <name>14697123-47ee-4ff0-8ab2-2b8d1217f637</name> diff --git a/entity/AttributeRelation_entity/entityfields/attribute_parent_id/displayValueProcess.js b/entity/AttributeRelation_entity/entityfields/attribute_parent_id/displayValueProcess.js new file mode 100644 index 0000000000..b853103366 --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/attribute_parent_id/displayValueProcess.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.result"); +import("Attribute_lib"); + +result.string(AttributeUtil.getFullAttributeName(vars.get("$field.ATTRIBUTE_PARENT_ID"))); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/recordcontainers/db/orderClauseProcess.js b/entity/AttributeRelation_entity/recordcontainers/db/orderClauseProcess.js new file mode 100644 index 0000000000..b70300ec1e --- /dev/null +++ b/entity/AttributeRelation_entity/recordcontainers/db/orderClauseProcess.js @@ -0,0 +1,5 @@ +import("system.db"); +import("system.result"); +result.object({ + "AB_ATTRIBUTE.ATTRIBUTE_PARENT_ID" : db.ASCENDING +}); \ No newline at end of file diff --git a/entity/Attribute_entity/Attribute_entity.aod b/entity/Attribute_entity/Attribute_entity.aod index 405955e8bd..ead7f6425a 100644 --- a/entity/Attribute_entity/Attribute_entity.aod +++ b/entity/Attribute_entity/Attribute_entity.aod @@ -38,6 +38,7 @@ <title>Superordinate Attribute</title> <consumer>AttributeChildren</consumer> <linkedContext>Attribute</linkedContext> + <searchable v="false" /> <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> @@ -122,6 +123,7 @@ <title>Active</title> <contentType>BOOLEAN</contentType> <possibleItemsProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_active/possibleItemsProcess.js</possibleItemsProcess> + <groupable v="true" /> <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_active/valueProcess.js</valueProcess> </entityField> <entityConsumer> @@ -152,6 +154,7 @@ <name>KEYWORD_CONTAINER</name> <title>Keyword</title> <possibleItemsProcess>%aditoprj%/entity/Attribute_entity/entityfields/keyword_container/possibleItemsProcess.js</possibleItemsProcess> + <searchable v="false" /> <state>AUTO</state> <stateProcess>%aditoprj%/entity/Attribute_entity/entityfields/keyword_container/stateProcess.js</stateProcess> </entityField> diff --git a/neonView/AttributeRelationFilter_view/AttributeRelationFilter_view.aod b/neonView/AttributeRelationFilter_view/AttributeRelationFilter_view.aod index 73c5a2e0f2..d655cdd2da 100644 --- a/neonView/AttributeRelationFilter_view/AttributeRelationFilter_view.aod +++ b/neonView/AttributeRelationFilter_view/AttributeRelationFilter_view.aod @@ -27,9 +27,11 @@ </tableViewTemplate> <treetableViewTemplate> <name>RelationsTreetable</name> - <parentField>ATTRIBUTE_PARENT_ID</parentField> - <titleField>AB_ATTRIBUTE_ID</titleField> - <descriptionField>ATTRIBUTERELATION_VALUE</descriptionField> + <titleField>valueProxy</titleField> + <defaultGroupFields> + <element>ATTRIBUTE_PARENT_ID</element> + <element>AB_ATTRIBUTE_ID</element> + </defaultGroupFields> <entityField>#ENTITY</entityField> </treetableViewTemplate> </children> -- GitLab