From 9efa178caa07c454b0cb588beee50a5560d8ad60 Mon Sep 17 00:00:00 2001 From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local> Date: Thu, 31 Jan 2019 11:44:34 +0100 Subject: [PATCH] [Projekt: Entwicklung - Neon][TicketNr.: 1032314][Attribut-Entity erstellen] --- aliasDefinition/Data_alias/Data_alias.aod | 781 ++++++++++++++++++ .../country/displayValueProcess.js | 2 +- .../AttributeRelation_entity.aod | 20 +- .../ab_attribute_id/possibleItemsProcess.js | 14 +- .../contentTypeProcess.js | 4 +- .../attributerelation_value/onValueChange.js | 3 +- .../attributerelation_value/valueProcess.js | 12 +- .../entityfields/bool_value/valueProcess.js | 3 + .../entityfields/object_rowid/valueProcess.js | 4 +- .../entityfields/object_type/valueProcess.js | 4 +- .../recordcontainers/db/conditionProcess.js | 4 +- .../AttributeUsage_entity.aod | 126 +++ .../ab_attribute_id/valueProcess.js | 6 + .../ab_attributeusageid/valueProcess.js | 7 + .../entityfields/date_new/valueProcess.js | 6 + .../entityfields/max_count/onValidation.js | 13 + .../entityfields/min_count/onValidation.js | 13 + .../object_type/possibleItemsProcess.js | 3 + .../entityfields/user_new/valueProcess.js | 6 + .../recordcontainers/db/conditionProcess.js | 7 + entity/Attribute_entity/Attribute_entity.aod | 48 +- .../attribute_active/possibleItemsProcess.js | 7 + .../attribute_active/valueProcess.js | 6 + .../attribute_parent_id/valueProcess.js | 5 - .../attribute_type/possibleItemsProcess.js | 12 +- .../children/attributeid_param/code.js | 4 + .../recordcontainers/db/onDBDelete.js | 11 + entity/Org_entity/Org_entity.aod | 11 +- .../language/displayValueProcess.js | 2 +- .../code.js | 0 .../children/objecttype_param/code.js | 4 + .../_____LANGUAGE_EXTRA.aod | 12 + .../_____LANGUAGE_de/_____LANGUAGE_de.aod | 16 + .../_____LANGUAGE_en/_____LANGUAGE_en.aod | 13 + .../AttributeUsage_context.aod | 16 + .../AttributeEdit_view/AttributeEdit_view.aod | 9 + .../AttributeMain_view/AttributeMain_view.aod | 5 + .../AttributeRelationMultiEdit_view.aod | 6 +- .../AttributeRelationTree_view.aod | 20 +- .../AttributeUsageFilter_view.aod | 30 + .../AttributeUsageMultiEdit_view.aod | 35 + .../struct/AditoBasic/create_ab_attribute.xml | 3 + .../create_ab_attributerelation.xml | 5 +- .../AditoBasic/create_ab_attributeusage.xml | 25 + others/db_changes/masterChangelog.xml | 1 + process/Attribute_lib/process.js | 155 +++- 46 files changed, 1423 insertions(+), 76 deletions(-) create mode 100644 entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js create mode 100644 entity/AttributeUsage_entity/AttributeUsage_entity.aod create mode 100644 entity/AttributeUsage_entity/entityfields/ab_attribute_id/valueProcess.js create mode 100644 entity/AttributeUsage_entity/entityfields/ab_attributeusageid/valueProcess.js create mode 100644 entity/AttributeUsage_entity/entityfields/date_new/valueProcess.js create mode 100644 entity/AttributeUsage_entity/entityfields/max_count/onValidation.js create mode 100644 entity/AttributeUsage_entity/entityfields/min_count/onValidation.js create mode 100644 entity/AttributeUsage_entity/entityfields/object_type/possibleItemsProcess.js create mode 100644 entity/AttributeUsage_entity/entityfields/user_new/valueProcess.js create mode 100644 entity/AttributeUsage_entity/recordcontainers/db/conditionProcess.js create mode 100644 entity/Attribute_entity/entityfields/attribute_active/possibleItemsProcess.js create mode 100644 entity/Attribute_entity/entityfields/attribute_active/valueProcess.js delete mode 100644 entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js create mode 100644 entity/Attribute_entity/entityfields/attributeusage_dfo/children/attributeid_param/code.js create mode 100644 entity/Attribute_entity/recordcontainers/db/onDBDelete.js rename entity/Org_entity/entityfields/orgattr_dfo/children/{objectrowid => objectrowid_param}/code.js (100%) create mode 100644 entity/Org_entity/entityfields/orgattr_dfo/children/objecttype_param/code.js create mode 100644 neonContext/AttributeUsage_context/AttributeUsage_context.aod create mode 100644 neonView/AttributeUsageFilter_view/AttributeUsageFilter_view.aod create mode 100644 neonView/AttributeUsageMultiEdit_view/AttributeUsageMultiEdit_view.aod create mode 100644 others/db_changes/data_alias/struct/AditoBasic/create_ab_attributeusage.xml diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 0b734992cb..eed1bb5761 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -5116,6 +5116,787 @@ </entityFieldDb> </entityFields> </entityDb> + <entityDb> + <name>AB_ATTRIBUTEUSAGE</name> + <dbName></dbName> + <idColumn>AB_ATTRIBUTEUSAGEID</idColumn> + <idGeneratorType v="0" /> + <idGeneratorInterval v="1" /> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>AB_ATTRIBUTEUSAGEID</name> + <dbName></dbName> + <primaryKey v="true" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_EDIT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>AB_ATTRIBUTE_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_NEW</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>USER_NEW</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>OBJECT_TYPE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="63" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>USER_EDIT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>MIN_COUNT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="4" /> + <size v="10" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>MAX_COUNT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="4" /> + <size v="10" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> + <entityDb> + <name>AB_ATTRIBUTE</name> + <dbName></dbName> + <idColumn>AB_ATTRIBUTEID</idColumn> + <idGeneratorType v="0" /> + <idGeneratorInterval v="1" /> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>ATTRIBUTE_NAME</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="63" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>ATTRIBUTE_TYPE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="63" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_EDIT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>AB_ATTRIBUTEID</name> + <dbName></dbName> + <primaryKey v="true" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>ATTRIBUTE_ACTIVE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="5" /> + <size v="5" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>ATTRIBUTE_PARENT_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_NEW</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>USER_NEW</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>USER_EDIT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> + <entityDb> + <name>AB_ATTRIBUTERELATION</name> + <dbName></dbName> + <idColumn>AB_ATTRIBUTERELATIONID</idColumn> + <idGeneratorType v="0" /> + <idGeneratorInterval v="1" /> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>OBJECT_ROWID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_EDIT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>BOOL_VALUE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="5" /> + <size v="5" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_VALUE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>NUMBER_VALUE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="2" /> + <size v="14" /> + <scale v="2" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>AB_ATTRIBUTERELATIONID</name> + <dbName></dbName> + <primaryKey v="true" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>OBJECT_TYPE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="63" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>USER_EDIT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>CHAR_VALUE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="63" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>AB_ATTRIBUTE_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>ID_VALUE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="1" /> + <size v="36" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATE_NEW</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>USER_NEW</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> + <entityDb> + <name>DATABASECHANGELOG</name> + <dbName></dbName> + <idColumn></idColumn> + <idGeneratorType v="1" /> + <idGeneratorInterval v="1" /> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>EXECTYPE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="10" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DATEEXECUTED</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>ORDEREXECUTED</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="4" /> + <size v="10" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>COMMENTS</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>AUTHOR</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>CONTEXTS</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>MD5SUM</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="35" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DESCRIPTION</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>LIQUIBASE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="20" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>DEPLOYMENT_ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="10" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>ID</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>TAG</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>LABELS</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>FILENAME</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> + <entityDb> + <name>DATABASECHANGELOGLOCK</name> + <dbName></dbName> + <idColumn>ID</idColumn> + <idGeneratorType v="1" /> + <idGeneratorInterval v="1" /> + <title></title> + <description></description> + <auditSyncConfig> + <name>auditSyncConfig</name> + <auditMode v="0" /> + <syncActive v="false" /> + <syncComplete v="true" /> + <syncDirection v="1" /> + <syncIds></syncIds> + </auditSyncConfig> + <entityFields> + <entityFieldDb> + <name>LOCKGRANTED</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="93" /> + <size v="29" /> + <scale v="9" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>LOCKED</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="16" /> + <size v="1" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>LOCKEDBY</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="255" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>ID</name> + <dbName></dbName> + <primaryKey v="true" /> + <columnType v="4" /> + <size v="10" /> + <scale v="0" /> + <notNull v="true" /> + <isUnique v="true" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + </entityFields> + </entityDb> </entities> </entityGroup> </aliasDefDb> diff --git a/entity/Address_entity/entityfields/country/displayValueProcess.js b/entity/Address_entity/entityfields/country/displayValueProcess.js index c030b65a02..227f7b918b 100644 --- a/entity/Address_entity/entityfields/country/displayValueProcess.js +++ b/entity/Address_entity/entityfields/country/displayValueProcess.js @@ -6,6 +6,6 @@ import("Sql_lib"); //TODO: temporary testing code var isoCode = vars.get("$field.COUNTRY"); -var countryName = db.cell(SqlCondition.begin().andPrepare("COUNTRYINFO.ISO2", isoCode).buildSelect("select COUNTRYINFO.NAME_LATIN from COUNTRYINFO")); +var countryName = db.cell(SqlCondition.begin().andPrepare("COUNTRYINFO.ISO2", isoCode).buildSql("select COUNTRYINFO.NAME_LATIN from COUNTRYINFO")); countryName = translate.text(countryName); result.string(countryName); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/AttributeRelation_entity.aod b/entity/AttributeRelation_entity/AttributeRelation_entity.aod index 20938e93f5..1e4c91f04c 100644 --- a/entity/AttributeRelation_entity/AttributeRelation_entity.aod +++ b/entity/AttributeRelation_entity/AttributeRelation_entity.aod @@ -69,7 +69,7 @@ <name>ATTRIBUTE_NAME</name> </entityField> <entityParameter> - <name>objectRowId</name> + <name>objectRowId_param</name> <expose v="true" /> <description>PARAMETER</description> </entityParameter> @@ -87,10 +87,18 @@ <name>ATTRIBUTE_TYPE</name> </entityField> <entityParameter> - <name>objectType</name> + <name>objectType_param</name> <expose v="true" /> <description>PARAMETER</description> </entityParameter> + <entityField> + <name>BOOL_VALUE</name> + <contentType>BOOLEAN</contentType> + <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>ID_VALUE</name> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -159,6 +167,14 @@ <name>ATTRIBUTE_TYPE.value</name> <expression>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_type.value/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>BOOL_VALUE.value</name> + <recordfield>AB_ATTRIBUTERELATION.BOOL_VALUE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ID_VALUE.value</name> + <recordfield>AB_ATTRIBUTERELATION.ID_VALUE</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js index db23dc640c..2449074c96 100644 --- a/entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js +++ b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js @@ -1,11 +1,5 @@ -import("system.db"); +import("system.vars"); import("system.result"); -import("Sql_lib"); - -//get all attributes for that context - -var attrSql = "select AB_ATTRIBUTEID, ATTRIBUTE_NAME from AB_ATTRIBUTE"; -attrSql = SqlCondition.begin() //TODO: add condition - .buildSelect(attrSql); - -result.object(db.table(attrSql)); \ No newline at end of file +import("Attribute_lib"); + +result.object(AttributeUtil.getPossibleAttributes(vars.get("$param.objectType_param"))); diff --git a/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js b/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js index fe458c9ab4..ccd7b53d9e 100644 --- a/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js +++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js @@ -1,6 +1,8 @@ +import("system.logging"); import("system.vars"); import("system.result"); import("Attribute_lib"); -var attrType = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeType(); +var attrType = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeContentType(); +logging.log("type is " + attrType) result.string(attrType); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/attributerelation_value/onValueChange.js b/entity/AttributeRelation_entity/entityfields/attributerelation_value/onValueChange.js index 7937f8e04a..0dcab8e25a 100644 --- a/entity/AttributeRelation_entity/entityfields/attributerelation_value/onValueChange.js +++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/onValueChange.js @@ -3,7 +3,8 @@ import("system.vars"); import("Entity_lib"); import("Attribute_lib"); -attrValue = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.ATTRIBUTERELATION_VALUE")); +var attrValue = vars.exists("$field.ATTRIBUTERELATION_VALUE") ? vars.get("$field.ATTRIBUTERELATION_VALUE") : ""; +attrValue = ProcessHandlingUtils.getOnValidationValue(attrValue); var attribute = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")); attribute.setAttributeValue(attrValue); diff --git a/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js b/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js index 59280880c3..dc4b3c47ba 100644 --- a/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js @@ -3,12 +3,12 @@ import("system.result"); import("system.vars"); import("Attribute_lib"); -var attrValue = vars.getString("$field.ATTRIBUTERELATION_VALUE"); -var attrValue = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeValue(); - -if (attrValue != "") +//var attrValue = vars.getString("$field.ATTRIBUTERELATION_VALUE"); +var attrField = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeField(); + +if (attrField != null) { - logging.log("value of " + vars.get("$field.AB_ATTRIBUTERELATIONID") + " (" + vars.get("$field.ATTRIBUTE_NAME") + ") = " + attrValue) - result.string(attrValue); + logging.log("value of " + vars.get("$field.AB_ATTRIBUTERELATIONID") + " (" + vars.get("$field.ATTRIBUTE_NAME") + ") = " + attrField) + result.string(vars.get(attrField)); } diff --git a/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js b/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js new file mode 100644 index 0000000000..13b11be60e --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("0") \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js b/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js index 99b42d18f7..83fdc17951 100644 --- a/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js @@ -2,5 +2,5 @@ import("system.vars"); import("system.result"); import("system.neon"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.objectRowId") && vars.get("$param.objectRowId") != null) - result.string(vars.get("$param.objectRowId")); \ No newline at end of file +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.objectRowId_param") && vars.get("$param.objectRowId_param") != null) + result.string(vars.get("$param.objectRowId_param")); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/object_type/valueProcess.js b/entity/AttributeRelation_entity/entityfields/object_type/valueProcess.js index 66c6cdedc9..a2239bdb8c 100644 --- a/entity/AttributeRelation_entity/entityfields/object_type/valueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/object_type/valueProcess.js @@ -2,5 +2,5 @@ import("system.vars"); import("system.result"); import("system.neon"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.objectType") && vars.get("$param.objectType") != null) - result.string(vars.get("$param.objectType")); \ No newline at end of file +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.objectType_param") && vars.get("$param.objectType_param") != null) + result.string(vars.get("$param.objectType_param")); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js b/entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js index 689065291e..f83ae05aba 100644 --- a/entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js +++ b/entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js @@ -3,10 +3,10 @@ import("system.vars"); import("system.result"); import("Sql_lib"); -if (vars.exists("$param.objectRowId")) +if (vars.exists("$param.objectRowId_param") && vars.get("$param.objectRowId_param") != null) { cond = SqlCondition.begin() - .andPrepare("AB_ATTRIBUTERELATION.OBJECT_ROWID", vars.get("$param.objectRowId")) + .andPrepare("AB_ATTRIBUTERELATION.OBJECT_ROWID", vars.get("$param.objectRowId_param")) .build(); result.string(db.translateCondition(cond)); } diff --git a/entity/AttributeUsage_entity/AttributeUsage_entity.aod b/entity/AttributeUsage_entity/AttributeUsage_entity.aod new file mode 100644 index 0000000000..02591fac2b --- /dev/null +++ b/entity/AttributeUsage_entity/AttributeUsage_entity.aod @@ -0,0 +1,126 @@ +<?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.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.1.1"> + <name>AttributeUsage_entity</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <recordContainer>db</recordContainer> + <entityFields> + <entityIncomingField> + <name>#INCOMING</name> + </entityIncomingField> + <entityField> + <name>OBJECT_TYPE</name> + <title>Entity</title> + <possibleItemsProcess>%aditoprj%/entity/AttributeUsage_entity/entityfields/object_type/possibleItemsProcess.js</possibleItemsProcess> + </entityField> + <entityField> + <name>DATE_NEW</name> + <contentType>DATE</contentType> + <valueProcess>%aditoprj%/entity/AttributeUsage_entity/entityfields/date_new/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>DATE_EDIT</name> + <contentType>DATE</contentType> + </entityField> + <entityField> + <name>USER_NEW</name> + <valueProcess>%aditoprj%/entity/AttributeUsage_entity/entityfields/user_new/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>USER_EDIT</name> + </entityField> + <entityField> + <name>AB_ATTRIBUTEUSAGEID</name> + <valueProcess>%aditoprj%/entity/AttributeUsage_entity/entityfields/ab_attributeusageid/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>AB_ATTRIBUTE_ID</name> + <valueProcess>%aditoprj%/entity/AttributeUsage_entity/entityfields/ab_attribute_id/valueProcess.js</valueProcess> + </entityField> + <entityIncomingField> + <name>Attribute_dfi</name> + <fieldType>DEPENDENCY_IN</fieldType> + <recordContainer>db</recordContainer> + <dependencies> + <entityDependency> + <name>47ac9f95-8879-43fd-92a9-86079e735e58</name> + <entityName>Attribute_entity</entityName> + <fieldName>AttributeUsage_dfo</fieldName> + <isOutgoing v="false" /> + </entityDependency> + </dependencies> + </entityIncomingField> + <entityParameter> + <name>attributeId_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityField> + <name>MIN_COUNT</name> + <title>Minimal Count</title> + <contentType>NUMBER</contentType> + <searchable v="false" /> + <onValidation>%aditoprj%/entity/AttributeUsage_entity/entityfields/min_count/onValidation.js</onValidation> + </entityField> + <entityField> + <name>MAX_COUNT</name> + <title>Maximal Count</title> + <contentType>NUMBER</contentType> + <searchable v="false" /> + <onValidation>%aditoprj%/entity/AttributeUsage_entity/entityfields/max_count/onValidation.js</onValidation> + </entityField> + </entityFields> + <recordContainers> + <dbRecordContainer> + <name>db</name> + <alias>Data_alias</alias> + <conditionProcess>%aditoprj%/entity/AttributeUsage_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <linkInformation> + <linkInformation> + <name>c30f5670-580e-4621-95dd-0fec4a99190f</name> + <tableName>AB_ATTRIBUTEUSAGE</tableName> + <primaryKey>AB_ATTRIBUTEUSAGEID</primaryKey> + <isUIDTable v="true" /> + <readonly v="false" /> + </linkInformation> + </linkInformation> + <recordFieldMappings> + <dbRecordFieldMapping> + <name>AB_ATTRIBUTE_ID.value</name> + <recordfield>AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>AB_ATTRIBUTEUSAGEID.value</name> + <recordfield>AB_ATTRIBUTEUSAGE.AB_ATTRIBUTEUSAGEID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DATE_EDIT.value</name> + <recordfield>AB_ATTRIBUTEUSAGE.DATE_EDIT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DATE_NEW.value</name> + <recordfield>AB_ATTRIBUTEUSAGE.DATE_NEW</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OBJECT_TYPE.value</name> + <recordfield>AB_ATTRIBUTEUSAGE.OBJECT_TYPE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>USER_EDIT.value</name> + <recordfield>AB_ATTRIBUTEUSAGE.USER_EDIT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>USER_NEW.value</name> + <recordfield>AB_ATTRIBUTEUSAGE.USER_NEW</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>MAX_COUNT.value</name> + <recordfield>AB_ATTRIBUTEUSAGE.MAX_COUNT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>MIN_COUNT.value</name> + <recordfield>AB_ATTRIBUTEUSAGE.MIN_COUNT</recordfield> + </dbRecordFieldMapping> + </recordFieldMappings> + </dbRecordContainer> + </recordContainers> +</entity> diff --git a/entity/AttributeUsage_entity/entityfields/ab_attribute_id/valueProcess.js b/entity/AttributeUsage_entity/entityfields/ab_attribute_id/valueProcess.js new file mode 100644 index 0000000000..d3399e6890 --- /dev/null +++ b/entity/AttributeUsage_entity/entityfields/ab_attribute_id/valueProcess.js @@ -0,0 +1,6 @@ +import("system.vars"); +import("system.result"); +import("system.neon"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.attributeId_param") && vars.get("$param.attributeId_param") != null) + result.string(vars.get("$param.attributeId_param")); \ No newline at end of file diff --git a/entity/AttributeUsage_entity/entityfields/ab_attributeusageid/valueProcess.js b/entity/AttributeUsage_entity/entityfields/ab_attributeusageid/valueProcess.js new file mode 100644 index 0000000000..7df83b4096 --- /dev/null +++ b/entity/AttributeUsage_entity/entityfields/ab_attributeusageid/valueProcess.js @@ -0,0 +1,7 @@ +import("system.util"); +import("system.result"); +import("system.neon"); +import("system.vars"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string(util.getNewUUID()); \ No newline at end of file diff --git a/entity/AttributeUsage_entity/entityfields/date_new/valueProcess.js b/entity/AttributeUsage_entity/entityfields/date_new/valueProcess.js new file mode 100644 index 0000000000..7acb3c8084 --- /dev/null +++ b/entity/AttributeUsage_entity/entityfields/date_new/valueProcess.js @@ -0,0 +1,6 @@ +import("system.vars"); +import("system.result"); +import("system.neon"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string(vars.getString("$sys.date")); \ No newline at end of file diff --git a/entity/AttributeUsage_entity/entityfields/max_count/onValidation.js b/entity/AttributeUsage_entity/entityfields/max_count/onValidation.js new file mode 100644 index 0000000000..cfec392b70 --- /dev/null +++ b/entity/AttributeUsage_entity/entityfields/max_count/onValidation.js @@ -0,0 +1,13 @@ +import("system.result"); +import("system.vars"); +import("system.translate"); +import("Entity_lib"); + +var maxCount = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.MAX_COUNT")); + +if (maxCount) +{ + maxCount = Number(maxCount); + if (maxCount <= 0 || maxCount != Math.floor(maxCount)) //when specified, max count must can't be negative, zero or not an integer + result.string(false); +} diff --git a/entity/AttributeUsage_entity/entityfields/min_count/onValidation.js b/entity/AttributeUsage_entity/entityfields/min_count/onValidation.js new file mode 100644 index 0000000000..36ddf1f1fd --- /dev/null +++ b/entity/AttributeUsage_entity/entityfields/min_count/onValidation.js @@ -0,0 +1,13 @@ +import("system.result"); +import("system.vars"); +import("system.translate"); +import("Entity_lib"); + +var minCount = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.MIN_COUNT")); + +if (minCount) +{ + minCount = Number(minCount); + if (minCount < 0 || minCount != Math.floor(minCount)) //when specified, max count must can't be negative or not an integer + result.string(false); +} diff --git a/entity/AttributeUsage_entity/entityfields/object_type/possibleItemsProcess.js b/entity/AttributeUsage_entity/entityfields/object_type/possibleItemsProcess.js new file mode 100644 index 0000000000..ad231346ea --- /dev/null +++ b/entity/AttributeUsage_entity/entityfields/object_type/possibleItemsProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.object([["Org_context", "Org"]]); \ No newline at end of file diff --git a/entity/AttributeUsage_entity/entityfields/user_new/valueProcess.js b/entity/AttributeUsage_entity/entityfields/user_new/valueProcess.js new file mode 100644 index 0000000000..a8a5e28793 --- /dev/null +++ b/entity/AttributeUsage_entity/entityfields/user_new/valueProcess.js @@ -0,0 +1,6 @@ +import("system.vars"); +import("system.result"); +import("system.neon"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string(vars.getString("$sys.user")); \ No newline at end of file diff --git a/entity/AttributeUsage_entity/recordcontainers/db/conditionProcess.js b/entity/AttributeUsage_entity/recordcontainers/db/conditionProcess.js new file mode 100644 index 0000000000..f7bc098142 --- /dev/null +++ b/entity/AttributeUsage_entity/recordcontainers/db/conditionProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.vars"); + +if(vars.exists("$param.attributeId_param") && vars.get("$param.attributeId_param") != null) + result.string("AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID = ('" + vars.getString("$param.attributeId_param") + "')"); +else + result.string("1 = 2"); \ No newline at end of file diff --git a/entity/Attribute_entity/Attribute_entity.aod b/entity/Attribute_entity/Attribute_entity.aod index 9a4ed6eb7a..2a9637e1bd 100644 --- a/entity/Attribute_entity/Attribute_entity.aod +++ b/entity/Attribute_entity/Attribute_entity.aod @@ -26,7 +26,6 @@ </entityField> <entityField> <name>ATTRIBUTE_PARENT_ID</name> - <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js</valueProcess> </entityField> <entityField> <name>DATE_NEW</name> @@ -46,12 +45,55 @@ <entityField> <name>USER_EDIT</name> </entityField> + <entityOutgoingField> + <name>AttributeChild_dfo</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <fieldName></fieldName> + </dependency> + </entityOutgoingField> + <entityIncomingField> + <name>AttributeParent_dfi</name> + <fieldType>DEPENDENCY_IN</fieldType> + <recordContainer>db</recordContainer> + </entityIncomingField> + <entityParameter> + <name>attrParentId_param</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityOutgoingField> + <name>AttributeUsage_dfo</name> + <title>Usage</title> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>AttributeUsage_entity</entityName> + <fieldName>Attribute_dfi</fieldName> + </dependency> + <children> + <entityParameter> + <name>attributeId_param</name> + <code>%aditoprj%/entity/Attribute_entity/entityfields/attributeusage_dfo/children/attributeid_param/code.js</code> + <triggerRecalculation v="true" /> + </entityParameter> + </children> + </entityOutgoingField> + <entityField> + <name>ATTRIBUTE_ACTIVE</name> + <title>Active</title> + <contentType>BOOLEAN</contentType> + <possibleItemsProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_active/possibleItemsProcess.js</possibleItemsProcess> + <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_active/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> <name>db</name> <alias>Data_alias</alias> <conditionProcess>%aditoprj%/entity/Attribute_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <onDBDelete>%aditoprj%/entity/Attribute_entity/recordcontainers/db/onDBDelete.js</onDBDelete> <linkInformation> <linkInformation> <name>b5fd38e1-b315-4e66-bd68-569dfc04710c</name> @@ -93,6 +135,10 @@ <name>USER_NEW.value</name> <recordfield>AB_ATTRIBUTE.USER_NEW</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ATTRIBUTE_ACTIVE.value</name> + <recordfield>AB_ATTRIBUTE.ATTRIBUTE_ACTIVE</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Attribute_entity/entityfields/attribute_active/possibleItemsProcess.js b/entity/Attribute_entity/entityfields/attribute_active/possibleItemsProcess.js new file mode 100644 index 0000000000..e4c1d8a782 --- /dev/null +++ b/entity/Attribute_entity/entityfields/attribute_active/possibleItemsProcess.js @@ -0,0 +1,7 @@ +import("system.translate"); +import("system.result"); + +result.object([ + ["1", translate.text("Yes")], + ["0", translate.text("No")] +]); \ No newline at end of file diff --git a/entity/Attribute_entity/entityfields/attribute_active/valueProcess.js b/entity/Attribute_entity/entityfields/attribute_active/valueProcess.js new file mode 100644 index 0000000000..246c17c087 --- /dev/null +++ b/entity/Attribute_entity/entityfields/attribute_active/valueProcess.js @@ -0,0 +1,6 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string("1"); \ 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 deleted file mode 100644 index 229750916e..0000000000 --- a/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -import("system.vars"); -import("system.result"); - -if (vars.exists("$field.AB_ATTRIBUTEID")) - result.string(vars.get("$field.AB_ATTRIBUTEID")); \ No newline at end of file diff --git a/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js b/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js index 3ad1033182..3dc3e30443 100644 --- a/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js +++ b/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js @@ -1,12 +1,4 @@ -import("system.translate"); import("system.result"); +import("Attribute_lib"); -var contentTypes = [ - ["PARENT", translate.text("Group")], - ["TEXT", translate.text("Text")], - ["NUMBER", translate.text("Number")], - ["DATE", translate.text("Date")], - ["BOOLEAN", translate.text("Checkbox")] -]; - -result.object(contentTypes); \ No newline at end of file +result.object(AttributeTypes.getTypeList()); \ No newline at end of file diff --git a/entity/Attribute_entity/entityfields/attributeusage_dfo/children/attributeid_param/code.js b/entity/Attribute_entity/entityfields/attributeusage_dfo/children/attributeid_param/code.js new file mode 100644 index 0000000000..033bf9a666 --- /dev/null +++ b/entity/Attribute_entity/entityfields/attributeusage_dfo/children/attributeid_param/code.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.AB_ATTRIBUTEID")); \ No newline at end of file diff --git a/entity/Attribute_entity/recordcontainers/db/onDBDelete.js b/entity/Attribute_entity/recordcontainers/db/onDBDelete.js new file mode 100644 index 0000000000..504e2d5e4f --- /dev/null +++ b/entity/Attribute_entity/recordcontainers/db/onDBDelete.js @@ -0,0 +1,11 @@ +import("system.vars"); +import("system.db"); +import("Sql_lib"); + +var attributeId = vars.get("$field.AB_ATTRIBUTEID"); +var usageCondition = SqlCondition.begin() + .andPrepare("AB_ATTRIBUTEUSAGE.AB_ATTRIBUTE_ID", attributeId) + .build(); + +//delete all entries in AB_ATTRIBUTEUSAGE belonging to the attribute to avoid unrelated entries +db.deleteData("AB_ATTRIBUTEUSAGE", usageCondition); \ No newline at end of file diff --git a/entity/Org_entity/Org_entity.aod b/entity/Org_entity/Org_entity.aod index ae97f276c3..7aad5dc5f5 100644 --- a/entity/Org_entity/Org_entity.aod +++ b/entity/Org_entity/Org_entity.aod @@ -466,6 +466,8 @@ <entityName>Countries_Entity</entityName> <fieldName>ISO2_NAME</fieldName> </dependency> + </entityOutgoingField> + <entityOutgoingField> <name>OrgAttr_dfo</name> <title>Attributes</title> <fieldType>DEPENDENCY_OUT</fieldType> @@ -476,8 +478,13 @@ </dependency> <children> <entityParameter> - <name>objectRowId</name> - <code>%aditoprj%/entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid/code.js</code> + <name>objectRowId_param</name> + <code>%aditoprj%/entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid_param/code.js</code> + <triggerRecalculation v="true" /> + </entityParameter> + <entityParameter> + <name>objectType_param</name> + <code>%aditoprj%/entity/Org_entity/entityfields/orgattr_dfo/children/objecttype_param/code.js</code> <triggerRecalculation v="true" /> </entityParameter> </children> diff --git a/entity/Org_entity/entityfields/language/displayValueProcess.js b/entity/Org_entity/entityfields/language/displayValueProcess.js index 434f279047..d8f39933bb 100644 --- a/entity/Org_entity/entityfields/language/displayValueProcess.js +++ b/entity/Org_entity/entityfields/language/displayValueProcess.js @@ -6,6 +6,6 @@ import("Sql_lib"); //TODO: temporary testing code var isoCode = vars.get("$field.LANGUAGE"); -var countryName = db.cell(SqlCondition.begin().andPrepare("COUNTRYINFO.ISO2", isoCode).buildSelect("select COUNTRYINFO.NAME_LATIN from COUNTRYINFO")); +var countryName = db.cell(SqlCondition.begin().andPrepare("COUNTRYINFO.ISO2", isoCode).buildSql("select COUNTRYINFO.NAME_LATIN from COUNTRYINFO")); countryName = translate.text(countryName); result.string(countryName); \ No newline at end of file diff --git a/entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid/code.js b/entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid_param/code.js similarity index 100% rename from entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid/code.js rename to entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid_param/code.js diff --git a/entity/Org_entity/entityfields/orgattr_dfo/children/objecttype_param/code.js b/entity/Org_entity/entityfields/orgattr_dfo/children/objecttype_param/code.js new file mode 100644 index 0000000000..5996e99db2 --- /dev/null +++ b/entity/Org_entity/entityfields/orgattr_dfo/children/objecttype_param/code.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index 1827341f95..7b5592f85e 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -1461,6 +1461,18 @@ <entry> <key>${ADDRESS_STATE}</key> </entry> + <entry> + <key>${NUMBER}</key> + </entry> + <entry> + <key>Usage</key> + </entry> + <entry> + <key>Maximal Count</key> + </entry> + <entry> + <key>Minimal Count</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 304422d8f2..014c54344e 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -22,6 +22,10 @@ <key>E-Mail</key> <value>E-Mail</value> </entry> + <entry> + <key>Maximal Count</key> + <value>Maximale Anzahl</value> + </entry> <entry> <key>Customer</key> <value>Kunde</value> @@ -30,6 +34,10 @@ <key>Internal</key> <value>Intern</value> </entry> + <entry> + <key>Usage</key> + <value>Verwendung</value> + </entry> <entry> <key>Show all activities</key> <value>Alle Aktivitäten anzeigen</value> @@ -114,6 +122,10 @@ <key>Online-Meeting</key> <value>Online-Meeting</value> </entry> + <entry> + <key>${NUMBER}</key> + <value>Zahl</value> + </entry> <entry> <key>Choose address</key> <value>Adresse auswählen</value> @@ -925,6 +937,10 @@ <key>Total gross</key> <value>Betrag brutto</value> </entry> + <entry> + <key>Minimal Count</key> + <value>Minimale Anzahl</value> + </entry> <entry> <key>${ORGTYPE_OTHER}</key> <value>Sonstige</value> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index ea7e8213f7..ef18f89bf9 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -1491,6 +1491,19 @@ <key>${ADDRESS_STATE}</key> <value>state</value> </entry> + <entry> + <key>${NUMBER}</key> + <value>Number</value> + </entry> + <entry> + <key>Usage</key> + </entry> + <entry> + <key>Maximal Count</key> + </entry> + <entry> + <key>Minimal Count</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/AttributeUsage_context/AttributeUsage_context.aod b/neonContext/AttributeUsage_context/AttributeUsage_context.aod new file mode 100644 index 0000000000..520b5db637 --- /dev/null +++ b/neonContext/AttributeUsage_context/AttributeUsage_context.aod @@ -0,0 +1,16 @@ +<?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.0.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.0.0"> + <name>AttributeUsage_context</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <entity>AttributeUsage_entity</entity> + <references> + <neonViewReference> + <name>6f384e66-886a-4a88-90b2-3fa74447b485</name> + <view>AttributeUsageFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>db6545ff-cbf4-4c47-aa52-30ae7e203448</name> + <view>AttributeUsageMultiEdit_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonView/AttributeEdit_view/AttributeEdit_view.aod b/neonView/AttributeEdit_view/AttributeEdit_view.aod index 8b8e4d7257..5409c8302b 100644 --- a/neonView/AttributeEdit_view/AttributeEdit_view.aod +++ b/neonView/AttributeEdit_view/AttributeEdit_view.aod @@ -21,7 +21,16 @@ <name>8cbc6049-2530-4960-b45f-830f3220889e</name> <entityField>ATTRIBUTE_TYPE</entityField> </entityFieldLink> + <entityFieldLink> + <name>d26696ac-199c-45f0-9147-b75dee3f4b65</name> + <entityField>ATTRIBUTE_ACTIVE</entityField> + </entityFieldLink> </fields> </genericViewTemplate> + <neonViewReference> + <name>8387ef27-9565-400f-a0d5-ef1d2019b722</name> + <entityField>AttributeUsage_dfo</entityField> + <view>AttributeUsageMultiEdit_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/AttributeMain_view/AttributeMain_view.aod b/neonView/AttributeMain_view/AttributeMain_view.aod index a05ff63592..38b0c466d6 100644 --- a/neonView/AttributeMain_view/AttributeMain_view.aod +++ b/neonView/AttributeMain_view/AttributeMain_view.aod @@ -19,5 +19,10 @@ <entityField>#ENTITY</entityField> <view>AttributeFilter_view</view> </neonViewReference> + <neonViewReference> + <name>5dee1c0b-c670-4eb9-bd95-6f6474709aa2</name> + <entityField>AttributeUsage_dfo</entityField> + <view>AttributeUsageFilter_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/AttributeRelationMultiEdit_view/AttributeRelationMultiEdit_view.aod b/neonView/AttributeRelationMultiEdit_view/AttributeRelationMultiEdit_view.aod index ca31736c72..e872c8b163 100644 --- a/neonView/AttributeRelationMultiEdit_view/AttributeRelationMultiEdit_view.aod +++ b/neonView/AttributeRelationMultiEdit_view/AttributeRelationMultiEdit_view.aod @@ -9,15 +9,15 @@ </layout> <children> <genericMultipleViewTemplate> - <name>AttrEdit_template</name> + <name>GenericMultiple</name> <entityField>#ENTITY</entityField> <columns> <neonTableColumn> - <name>1f770fc2-2a07-4f7b-b699-b7bbbeb6e9aa</name> + <name>beb3a9bd-ca81-42ce-8d43-d0984946c81e</name> <entityField>AB_ATTRIBUTE_ID</entityField> </neonTableColumn> <neonTableColumn> - <name>f0d587b2-86c2-4bc2-9d6b-61a5e64c7929</name> + <name>29e9bc62-c748-471e-85ae-6c87e8f2dee1</name> <entityField>ATTRIBUTERELATION_VALUE</entityField> </neonTableColumn> </columns> diff --git a/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod b/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod index f2ce9e62c6..df5ce99c93 100644 --- a/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod +++ b/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod @@ -9,12 +9,20 @@ </boxLayout> </layout> <children> - <treetableViewTemplate> - <name>AttrRelationTree_template</name> - <titleField>ATTRIBUTE_NAME</titleField> - <descriptionField>ATTRIBUTERELATION_VALUE</descriptionField> + <tableViewTemplate> + <name>Table</name> + <autoNewRow v="false" /> <entityField>#ENTITY</entityField> - <title>Attributes</title> - </treetableViewTemplate> + <columns> + <neonTableColumn> + <name>b37d207a-6119-454a-8fc6-073e9d54b1d3</name> + <entityField>AB_ATTRIBUTE_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>83a10d52-9eaf-4901-935e-2a7410831861</name> + <entityField>ATTRIBUTERELATION_VALUE</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> </children> </neonView> diff --git a/neonView/AttributeUsageFilter_view/AttributeUsageFilter_view.aod b/neonView/AttributeUsageFilter_view/AttributeUsageFilter_view.aod new file mode 100644 index 0000000000..78e83f9ef0 --- /dev/null +++ b/neonView/AttributeUsageFilter_view/AttributeUsageFilter_view.aod @@ -0,0 +1,30 @@ +<?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.0.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.0.1"> + <name>AttributeUsageFilter_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <tableViewTemplate> + <name>UsageTable_template</name> + <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> +</neonView> diff --git a/neonView/AttributeUsageMultiEdit_view/AttributeUsageMultiEdit_view.aod b/neonView/AttributeUsageMultiEdit_view/AttributeUsageMultiEdit_view.aod new file mode 100644 index 0000000000..d4c4405974 --- /dev/null +++ b/neonView/AttributeUsageMultiEdit_view/AttributeUsageMultiEdit_view.aod @@ -0,0 +1,35 @@ +<?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.0.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.0.1"> + <name>AttributeUsageMultiEdit_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericMultipleViewTemplate> + <name>UsageEdit_template</name> + <entityField>#ENTITY</entityField> + <columns> + <neonTableColumn> + <name>a2efb4ca-4e8d-4e90-9870-2cebf338d95f</name> + <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> +</neonView> diff --git a/others/db_changes/data_alias/struct/AditoBasic/create_ab_attribute.xml b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attribute.xml index c273b1d473..ccff0d6525 100644 --- a/others/db_changes/data_alias/struct/AditoBasic/create_ab_attribute.xml +++ b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attribute.xml @@ -13,6 +13,9 @@ <column name="ATTRIBUTE_NAME" type="NVARCHAR(63)"> <constraints nullable="false"/> </column> + <column name="ATTRIBUTE_ACTIVE" type="TINYINT"> + <constraints nullable="false"/> + </column> <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> diff --git a/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml index cf41044fa1..77936415ef 100644 --- a/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml +++ b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml @@ -15,9 +15,12 @@ <constraints nullable="false"/> </column> <column name="CHAR_VALUE" type="NVARCHAR(63)"/> + <column name="ID_VALUE" type="CHAR(36)"/> <column name="DATE_VALUE" type="TIMESTAMP"/> <column name="NUMBER_VALUE" type="NUMERIC(14,2)"/> - <column name="ID_VALUE" type="CHAR(36)"/> + <column name="BOOL_VALUE" type="TINYINT"> + <constraints nullable="false"/> + </column> <column name="USER_NEW" type="NVARCHAR(50)"> <constraints nullable="false"/> </column> diff --git a/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributeusage.xml b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributeusage.xml new file mode 100644 index 0000000000..0b4aa71059 --- /dev/null +++ b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributeusage.xml @@ -0,0 +1,25 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="s.listl" id="f303c620-ebe0-4c47-a05a-d987c9a1514d"> + <createTable tableName="AB_ATTRIBUTEUSAGE"> + <column name="AB_ATTRIBUTEUSAGEID" type="CHAR(36)"> + <constraints primaryKey="true" primaryKeyName="PK_AB_ATTRIBUTEUSAGE_AB_ATTRIBUTEUSAGEID"/> + </column> + <column name="AB_ATTRIBUTE_ID" type="CHAR(36)"> + </column> + <column name="OBJECT_TYPE" type="NVARCHAR(63)"> + <constraints nullable="false"/> + </column> + <column name="MIN_COUNT" type="INTEGER"/> + <column name="MAX_COUNT" type="INTEGER"/> + <column name="USER_NEW" type="NVARCHAR(50)"> + <constraints nullable="false"/> + </column> + <column name="USER_EDIT" type="NVARCHAR(50)"/> + <column name="DATE_NEW" type="TIMESTAMP"> + <constraints nullable="false"/> + </column> + <column name="DATE_EDIT" type="TIMESTAMP"/> + </createTable> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/others/db_changes/masterChangelog.xml b/others/db_changes/masterChangelog.xml index b805a9c677..c55cf19447 100644 --- a/others/db_changes/masterChangelog.xml +++ b/others/db_changes/masterChangelog.xml @@ -3,6 +3,7 @@ <include file="data_alias/struct/AditoBasic/create_ab_objectrelation.xml"/> <include file="data_alias/struct/AditoBasic/create_ab_attribute.xml"/> <include file="data_alias/struct/AditoBasic/create_ab_attributerelation.xml"/> + <include file="data_alias/struct/AditoBasic/create_ab_attributeusage.xml"/> <include file="data_alias/struct/create_pers.xml"/> <include file="data_alias/struct/create_org.xml"/> diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js index 83a8f7163a..8c541df0b1 100644 --- a/process/Attribute_lib/process.js +++ b/process/Attribute_lib/process.js @@ -1,12 +1,50 @@ +import("system.translate"); import("system.neon"); import("system.vars"); import("system.db"); import("Sql_lib"); +/** + * Provides functions for the work with attributes. + * Don't instanciate this! + * + * @class + */ function AttributeUtil () {} +AttributeUtil.getPossibleAttributes = function (pObjectType) +{ + if (pObjectType == null) + return []; + + var attrSql = "select AB_ATTRIBUTEID, ATTRIBUTE_NAME from AB_ATTRIBUTE" + + " join AB_ATTRIBUTEUSAGE on AB_ATTRIBUTEID = AB_ATTRIBUTE_ID"; + attrSql = SqlCondition.begin() + .andPrepare("AB_ATTRIBUTEUSAGE.OBJECT_TYPE", pObjectType) + .buildSql(attrSql); + + return db.table(attrSql); +} + +AttributeUtil.getAttribute = function () +{ + +} + +AttributeUtil.getAttributes = function () +{ + +} + +AttributeUtil.setAttribute = function () +{ + +} +/** + * object for handling values of the AttributeRelation entity + */ function AttributeHandler (pAttrId) { this.attributeId = pAttrId; @@ -18,40 +56,38 @@ AttributeHandler.begin = function (pAttrId) return new AttributeHandler(pAttrId); } -AttributeHandler.prototype.getAttributeType = function () +/** + * gets the type of the attribute by the attributeId, after the first call the value + * is stored so that the sql selection is done only once + * + * @return {String} attribute type + */ +AttributeHandler.prototype._getAttributeType = function () { if (this._attributeType == null && this.attributeId != null) { var attrTypeSelect = "select ATTRIBUTE_TYPE from AB_ATTRIBUTE"; attrTypeSelect = SqlCondition.begin() - .andPrepare("AB_ATTRIBUTE.AB_ATTRIBUTEID", this.attributeId) - .buildSelect(attrTypeSelect); + .andPrepare("AB_ATTRIBUTE.AB_ATTRIBUTEID", this.attributeId) + .buildSql(attrTypeSelect); this._attributeType = db.cell(attrTypeSelect); } return this._attributeType; } +/** + * returns the field that belongs to the type of the attribute + * + * @return {String} attribute field + */ AttributeHandler.prototype.getAttributeField = function () { - switch (this.getAttributeType()) - { - case "TEXT": - return "$field.CHAR_VALUE"; - case "DATE": - return "$field.DATE_VALUE"; - case "NUMBER": - return "$field.NUMBER_VALUE"; - default: - return null; //TODO: change default value maybe - } + return AttributeTypes.getAttributeField(this._getAttributeType()); } -AttributeHandler.prototype.getAttributeValue = function () +AttributeHandler.prototype.getAttributeContentType = function () { - var field = this.getAttributeField(); - if (field != null && vars.exists(field)) - return vars.get(field); - return null; //TODO: change default value maybe + return AttributeTypes.getContentType(this._getAttributeType()); } AttributeHandler.prototype.setAttributeValue = function (pValue) @@ -60,4 +96,83 @@ AttributeHandler.prototype.setAttributeValue = function (pValue) if (field != null && vars.exists(field)) neon.setFieldValue(field, pValue) return pValue; -} \ No newline at end of file +} + +/** + * Object for the enumeration of all attribute types. + */ +var AttributeTypes = { + TEXT : "TEXT", + DATE : "DATE", + NUMBER : "NUMBER", + BOOLEAN : "BOOLEAN", + COMBO : "COMBO", + GROUP : "GROUP" +} + +/** + * returns the required contentType for the given attribute type + * + * @param {String} pAttributeType the attribute type + * (use the values of the AttributeTypes object, e. g. AttributeTypes.TEXT) + * @return {String} the contentType for the attribute + */ +AttributeTypes.getContentType = function (pAttributeType) +{ + switch (pAttributeType) + { + case AttributeTypes.TEXT: + case AttributeTypes.DATE: + case AttributeTypes.NUMBER: + case AttributeTypes.BOOLEAN: + return pAttributeType; + case AttributeTypes.COMBO: + return AttributeTypes.TEXT; + default: + return null; //TODO: change default value maybe + } +} + +/** + * returns the required field for the given attribute type that holds the value of the attribute + * + * @param {String} pAttributeType the attribute type + * (use the values of the AttributeTypes object, e. g. AttributeTypes.TEXT) + * @return {String} the field for the attribute + */ +AttributeTypes.getAttributeField = function (pAttributeType) +{ + switch (pAttributeType) + { + case AttributeTypes.TEXT: + return "$field.CHAR_VALUE"; + case AttributeTypes.DATE: + return "$field.DATE_VALUE"; + case AttributeTypes.NUMBER: + return "$field.NUMBER_VALUE"; + case AttributeTypes.BOOLEAN: + return "$field.BOOL_VALUE"; + case AttributeTypes.COMBO: + return "$field.ID_VALUE"; + default: + return null; //TODO: change default value maybe + } +} + +/** + * Makes a two-dimensional array of the attribute types and the corresponding names. + * This is used for the selection of the type when creating an attribute. + * + * @return {String[][]} array with attribute types and names + */ +AttributeTypes.getTypeList = function () +{ + return [ + [AttributeTypes.TEXT, translate.text("Text")], + [AttributeTypes.DATE, translate.text("Date")], + [AttributeTypes.NUMBER, translate.text("${NUMBER}")], + [AttributeTypes.BOOLEAN, translate.text("Checkbox")], + [AttributeTypes.COMBO, translate.text("Combobox")], + [AttributeTypes.GROUP, translate.text("Group")] + ]; +} -- GitLab