From 09bce7590d0a09b81f3f67e05b940868536f0cdb Mon Sep 17 00:00:00 2001 From: "S.Listl" <S.Listl@SLISTL.aditosoftware.local> Date: Tue, 29 Jan 2019 08:20:47 +0100 Subject: [PATCH] [Projekt: Entwicklung - Neon][TicketNr.: 1032314][Attribut-Entity erstellen] --- .../_____SYSTEM_APPLICATION_NEON.aod | 7 + entity/Address_entity/Address_entity.aod | 2 +- .../AttributeRelation_entity.aod | 165 ++++++++++++++++++ .../ab_attribute_id/possibleItemsProcess.js | 11 ++ .../ab_attribute_id/stateProcess.js | 5 + .../ab_attributerelationid/valueProcess.js | 7 + .../contentTypeProcess.js | 6 + .../attributerelation_value/onValueChange.js | 11 ++ .../attributerelation_value/valueProcess.js | 14 ++ .../entityfields/date_new/valueProcess.js | 6 + .../entityfields/object_rowid/valueProcess.js | 6 + .../entityfields/object_type/valueProcess.js | 6 + .../entityfields/user_new/valueProcess.js | 6 + .../recordcontainers/db/conditionProcess.js | 14 ++ .../attribute_name.value/expression.js | 3 + .../attribute_type.value/expression.js | 0 entity/Attribute_entity/Attribute_entity.aod | 99 +++++++++++ .../ab_attributeid/valueProcess.js | 7 + .../attribute_parent_id/valueProcess.js | 5 + .../attribute_type/possibleItemsProcess.js | 12 ++ .../entityfields/date_new/valueProcess.js | 6 + .../entityfields/user_new/valueProcess.js | 6 + .../recordcontainers/db/conditionProcess.js | 6 + .../entityfields/medium_id/valueProcess.js | 0 entity/Org_entity/Org_entity.aod | 17 ++ .../orgattr_dfo/children/objectrowid/code.js | 4 + .../recordcontainers/db/onDBUpdate.js | 2 +- .../_____LANGUAGE_EXTRA.aod | 3 + .../_____LANGUAGE_de/_____LANGUAGE_de.aod | 4 + .../_____LANGUAGE_en/_____LANGUAGE_en.aod | 4 + .../AttributeRelation_context.aod | 19 ++ .../Attribute_context/Attribute_context.aod | 30 ++++ .../AddressEdit_view/AddressEdit_view.aod | 4 + .../AddressFilter_view/AddressFilter_view.aod | 4 + .../AddressList_view/AddressList_view.aod | 4 + .../AdressMultiEdit_view.aod | 4 + .../AttributeEdit_view/AttributeEdit_view.aod | 27 +++ .../AttributeFilter_view.aod | 29 +++ .../AttributeMain_view/AttributeMain_view.aod | 23 +++ .../AttributePreview_view.aod | 18 ++ .../AttributeRelationMultiEdit_view.aod | 26 +++ .../AttributeRelationTree_view.aod | 20 +++ neonView/OrgEdit_view/OrgEdit_view.aod | 5 + neonView/OrgMain_view/OrgMain_view.aod | 7 +- .../struct/AditoBasic/create_ab_attribute.xml | 26 +++ .../create_ab_attributerelation.xml | 31 ++++ others/db_changes/masterChangelog.xml | 2 + process/Attribute_lib/Attribute_lib.aod | 10 ++ process/Attribute_lib/process.js | 63 +++++++ process/Sql_lib/process.js | 1 + 50 files changed, 794 insertions(+), 3 deletions(-) create mode 100644 entity/AttributeRelation_entity/AttributeRelation_entity.aod create mode 100644 entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js create mode 100644 entity/AttributeRelation_entity/entityfields/ab_attribute_id/stateProcess.js create mode 100644 entity/AttributeRelation_entity/entityfields/ab_attributerelationid/valueProcess.js create mode 100644 entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js create mode 100644 entity/AttributeRelation_entity/entityfields/attributerelation_value/onValueChange.js create mode 100644 entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js create mode 100644 entity/AttributeRelation_entity/entityfields/date_new/valueProcess.js create mode 100644 entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js create mode 100644 entity/AttributeRelation_entity/entityfields/object_type/valueProcess.js create mode 100644 entity/AttributeRelation_entity/entityfields/user_new/valueProcess.js create mode 100644 entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js create mode 100644 entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_name.value/expression.js create mode 100644 entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_type.value/expression.js create mode 100644 entity/Attribute_entity/Attribute_entity.aod create mode 100644 entity/Attribute_entity/entityfields/ab_attributeid/valueProcess.js create mode 100644 entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js create mode 100644 entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js create mode 100644 entity/Attribute_entity/entityfields/date_new/valueProcess.js create mode 100644 entity/Attribute_entity/entityfields/user_new/valueProcess.js create mode 100644 entity/Attribute_entity/recordcontainers/db/conditionProcess.js create mode 100644 entity/Comm_entity/entityfields/medium_id/valueProcess.js create mode 100644 entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid/code.js create mode 100644 neonContext/AttributeRelation_context/AttributeRelation_context.aod create mode 100644 neonContext/Attribute_context/Attribute_context.aod create mode 100644 neonView/AttributeEdit_view/AttributeEdit_view.aod create mode 100644 neonView/AttributeFilter_view/AttributeFilter_view.aod create mode 100644 neonView/AttributeMain_view/AttributeMain_view.aod create mode 100644 neonView/AttributePreview_view/AttributePreview_view.aod create mode 100644 neonView/AttributeRelationMultiEdit_view/AttributeRelationMultiEdit_view.aod create mode 100644 neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod create mode 100644 others/db_changes/data_alias/struct/AditoBasic/create_ab_attribute.xml create mode 100644 others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml create mode 100644 process/Attribute_lib/Attribute_lib.aod create mode 100644 process/Attribute_lib/process.js diff --git a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod index 1991fe78ecb..a27ce68caa4 100644 --- a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod +++ b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod @@ -26,6 +26,13 @@ <node name="INTERNAL_ADMINISTRATOR" kind="159" /> </node> </node> + <node name="Administration" kind="123" title="Administration"> + <icon>NEON:WRENCH</icon> + <node name="Group3" kind="123" title=""> + <node name="Attribute_context" kind="10077" /> + <node name="INTERNAL_ADMINISTRATOR" kind="159" /> + </node> + </node> </entityNode> <company> <name>company</name> diff --git a/entity/Address_entity/Address_entity.aod b/entity/Address_entity/Address_entity.aod index e1a36b9deb6..9414f06a232 100644 --- a/entity/Address_entity/Address_entity.aod +++ b/entity/Address_entity/Address_entity.aod @@ -66,7 +66,7 @@ </entityField> <entityField> <name>STATE</name> - <title>State</title> + <title>${ADDRESS_STATE}</title> <mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/state/mandatoryProcess.js</mandatoryProcess> </entityField> <entityField> diff --git a/entity/AttributeRelation_entity/AttributeRelation_entity.aod b/entity/AttributeRelation_entity/AttributeRelation_entity.aod new file mode 100644 index 00000000000..20938e93f59 --- /dev/null +++ b/entity/AttributeRelation_entity/AttributeRelation_entity.aod @@ -0,0 +1,165 @@ +<?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>AttributeRelation_entity</name> + <title>Attributes</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <recordContainer>db</recordContainer> + <entityFields> + <entityIncomingField> + <name>#INCOMING</name> + </entityIncomingField> + <entityField> + <name>AB_ATTRIBUTERELATIONID</name> + <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/ab_attributerelationid/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>AB_ATTRIBUTE_ID</name> + <title>Attribute</title> + <mandatory v="true" /> + <possibleItemsProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js</possibleItemsProcess> + <stateProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/ab_attribute_id/stateProcess.js</stateProcess> + </entityField> + <entityField> + <name>OBJECT_ROWID</name> + <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>OBJECT_TYPE</name> + <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/object_type/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>DATE_NEW</name> + <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/date_new/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>DATE_EDIT</name> + </entityField> + <entityField> + <name>USER_NEW</name> + <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/user_new/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>USER_EDIT</name> + </entityField> + <entityField> + <name>ATTRIBUTERELATION_VALUE</name> + <title>Value</title> + <contentTypeProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js</contentTypeProcess> + <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js</valueProcess> + <onValueChange>%aditoprj%/entity/AttributeRelation_entity/entityfields/attributerelation_value/onValueChange.js</onValueChange> + </entityField> + <entityField> + <name>CHAR_VALUE</name> + <state>EDITABLE</state> + </entityField> + <entityIncomingField> + <name>OrgAttr_dfi</name> + <fieldType>DEPENDENCY_IN</fieldType> + <recordContainer>db</recordContainer> + <dependencies> + <entityDependency> + <name>2226c7fc-45d4-45e8-a5d3-a5e13dff4b59</name> + <entityName>Org_entity</entityName> + <fieldName>OrgAttr_dfo</fieldName> + <isOutgoing v="false" /> + </entityDependency> + </dependencies> + </entityIncomingField> + <entityField> + <name>ATTRIBUTE_NAME</name> + </entityField> + <entityParameter> + <name>objectRowId</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityField> + <name>DATE_VALUE</name> + <contentType>DATE</contentType> + <state>EDITABLE</state> + </entityField> + <entityField> + <name>NUMBER_VALUE</name> + <contentType>NUMBER</contentType> + <state>EDITABLE</state> + </entityField> + <entityField> + <name>ATTRIBUTE_TYPE</name> + </entityField> + <entityParameter> + <name>objectType</name> + <expose v="true" /> + <description>PARAMETER</description> + </entityParameter> + </entityFields> + <recordContainers> + <dbRecordContainer> + <name>db</name> + <alias>Data_alias</alias> + <conditionProcess>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <linkInformation> + <linkInformation> + <name>1ffc8a7d-56a2-4516-abd9-071e857058e9</name> + <tableName>AB_ATTRIBUTERELATION</tableName> + <primaryKey>AB_ATTRIBUTERELATIONID</primaryKey> + <isUIDTable v="true" /> + <readonly v="false" /> + </linkInformation> + </linkInformation> + <recordFieldMappings> + <dbRecordFieldMapping> + <name>AB_ATTRIBUTE_ID.value</name> + <recordfield>AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>AB_ATTRIBUTERELATIONID.value</name> + <recordfield>AB_ATTRIBUTERELATION.AB_ATTRIBUTERELATIONID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OBJECT_ROWID.value</name> + <recordfield>AB_ATTRIBUTERELATION.OBJECT_ROWID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OBJECT_TYPE.value</name> + <recordfield>AB_ATTRIBUTERELATION.OBJECT_TYPE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DATE_EDIT.value</name> + <recordfield>AB_ATTRIBUTERELATION.DATE_EDIT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DATE_NEW.value</name> + <recordfield>AB_ATTRIBUTERELATION.DATE_NEW</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>USER_EDIT.value</name> + <recordfield>AB_ATTRIBUTERELATION.USER_EDIT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>USER_NEW.value</name> + <recordfield>AB_ATTRIBUTERELATION.USER_NEW</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>CHAR_VALUE.value</name> + <recordfield>AB_ATTRIBUTERELATION.CHAR_VALUE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DATE_VALUE.value</name> + <recordfield>AB_ATTRIBUTERELATION.DATE_VALUE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>NUMBER_VALUE.value</name> + <recordfield>AB_ATTRIBUTERELATION.NUMBER_VALUE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ATTRIBUTE_NAME.value</name> + <expression>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_name.value/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ATTRIBUTE_TYPE.value</name> + <expression>%aditoprj%/entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_type.value/expression.js</expression> + </dbRecordFieldMapping> + </recordFieldMappings> + </dbRecordContainer> + </recordContainers> +</entity> diff --git a/entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js new file mode 100644 index 00000000000..db23dc640cd --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js @@ -0,0 +1,11 @@ +import("system.db"); +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 diff --git a/entity/AttributeRelation_entity/entityfields/ab_attribute_id/stateProcess.js b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/stateProcess.js new file mode 100644 index 00000000000..749c17f2401 --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/stateProcess.js @@ -0,0 +1,5 @@ +//import("system.vars"); +//import("system.result"); +// +//if (vars.get("$field.ATTRIBUTERELATION_VALUE")) +// result.string("READONLY"); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/ab_attributerelationid/valueProcess.js b/entity/AttributeRelation_entity/entityfields/ab_attributerelationid/valueProcess.js new file mode 100644 index 00000000000..622e00f05f7 --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/ab_attributerelationid/valueProcess.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.util"); +import("system.vars"); +import("system.result"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string(util.getNewUUID()); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js b/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js new file mode 100644 index 00000000000..fe458c9ab43 --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js @@ -0,0 +1,6 @@ +import("system.vars"); +import("system.result"); +import("Attribute_lib"); + +var attrType = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeType(); +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 new file mode 100644 index 00000000000..7937f8e04a3 --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/onValueChange.js @@ -0,0 +1,11 @@ +import("system.logging"); +import("system.vars"); +import("Entity_lib"); +import("Attribute_lib"); + +attrValue = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.ATTRIBUTERELATION_VALUE")); +var attribute = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")); + +attribute.setAttributeValue(attrValue); + +//logging.log("field is " + field + " and attrvalue is " + attrValue) \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js b/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js new file mode 100644 index 00000000000..59280880c33 --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js @@ -0,0 +1,14 @@ +import("system.logging"); +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 != "") +{ + logging.log("value of " + vars.get("$field.AB_ATTRIBUTERELATIONID") + " (" + vars.get("$field.ATTRIBUTE_NAME") + ") = " + attrValue) + result.string(attrValue); +} + diff --git a/entity/AttributeRelation_entity/entityfields/date_new/valueProcess.js b/entity/AttributeRelation_entity/entityfields/date_new/valueProcess.js new file mode 100644 index 00000000000..7acb3c80848 --- /dev/null +++ b/entity/AttributeRelation_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/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js b/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js new file mode 100644 index 00000000000..99b42d18f75 --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/object_rowid/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.objectRowId") && vars.get("$param.objectRowId") != null) + result.string(vars.get("$param.objectRowId")); \ 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 new file mode 100644 index 00000000000..66c6cdedc90 --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/object_type/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.objectType") && vars.get("$param.objectType") != null) + result.string(vars.get("$param.objectType")); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/user_new/valueProcess.js b/entity/AttributeRelation_entity/entityfields/user_new/valueProcess.js new file mode 100644 index 00000000000..a8a5e28793c --- /dev/null +++ b/entity/AttributeRelation_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/AttributeRelation_entity/recordcontainers/db/conditionProcess.js b/entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js new file mode 100644 index 00000000000..689065291e1 --- /dev/null +++ b/entity/AttributeRelation_entity/recordcontainers/db/conditionProcess.js @@ -0,0 +1,14 @@ +import("system.db"); +import("system.vars"); +import("system.result"); +import("Sql_lib"); + +if (vars.exists("$param.objectRowId")) +{ + cond = SqlCondition.begin() + .andPrepare("AB_ATTRIBUTERELATION.OBJECT_ROWID", vars.get("$param.objectRowId")) + .build(); + result.string(db.translateCondition(cond)); +} +else + result.string("1 = 2"); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_name.value/expression.js b/entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_name.value/expression.js new file mode 100644 index 00000000000..e4aa4657a29 --- /dev/null +++ b/entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_name.value/expression.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("select ATTRIBUTE_NAME from AB_ATTRIBUTE where AB_ATTRIBUTE.AB_ATTRIBUTEID = AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID"); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_type.value/expression.js b/entity/AttributeRelation_entity/recordcontainers/db/recordfieldmappings/attribute_type.value/expression.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/entity/Attribute_entity/Attribute_entity.aod b/entity/Attribute_entity/Attribute_entity.aod new file mode 100644 index 00000000000..9a4ed6eb7a3 --- /dev/null +++ b/entity/Attribute_entity/Attribute_entity.aod @@ -0,0 +1,99 @@ +<?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>Attribute_entity</name> + <title>Attributes</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <iconId>VAADIN:TAG</iconId> + <recordContainer>db</recordContainer> + <entityFields> + <entityIncomingField> + <name>#INCOMING</name> + </entityIncomingField> + <entityField> + <name>ATTRIBUTE_NAME</name> + <title>Name</title> + <mandatory v="true" /> + </entityField> + <entityField> + <name>ATTRIBUTE_TYPE</name> + <title>Type</title> + <mandatory v="true" /> + <possibleItemsProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js</possibleItemsProcess> + </entityField> + <entityField> + <name>AB_ATTRIBUTEID</name> + <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/ab_attributeid/valueProcess.js</valueProcess> + </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> + <contentType>DATE</contentType> + <state>READONLY</state> + <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/date_new/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>DATE_EDIT</name> + <contentType>DATE</contentType> + </entityField> + <entityField> + <name>USER_NEW</name> + <state>READONLY</state> + <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/user_new/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>USER_EDIT</name> + </entityField> + </entityFields> + <recordContainers> + <dbRecordContainer> + <name>db</name> + <alias>Data_alias</alias> + <conditionProcess>%aditoprj%/entity/Attribute_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <linkInformation> + <linkInformation> + <name>b5fd38e1-b315-4e66-bd68-569dfc04710c</name> + <tableName>AB_ATTRIBUTE</tableName> + <primaryKey>AB_ATTRIBUTEID</primaryKey> + <isUIDTable v="true" /> + </linkInformation> + </linkInformation> + <recordFieldMappings> + <dbRecordFieldMapping> + <name>AB_ATTRIBUTEID.value</name> + <recordfield>AB_ATTRIBUTE.AB_ATTRIBUTEID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ATTRIBUTE_NAME.value</name> + <recordfield>AB_ATTRIBUTE.ATTRIBUTE_NAME</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ATTRIBUTE_PARENT_ID.value</name> + <recordfield>AB_ATTRIBUTE.ATTRIBUTE_PARENT_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ATTRIBUTE_TYPE.value</name> + <recordfield>AB_ATTRIBUTE.ATTRIBUTE_TYPE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DATE_EDIT.value</name> + <recordfield>AB_ATTRIBUTE.DATE_EDIT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DATE_NEW.value</name> + <recordfield>AB_ATTRIBUTE.DATE_NEW</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>USER_EDIT.value</name> + <recordfield>AB_ATTRIBUTE.USER_EDIT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>USER_NEW.value</name> + <recordfield>AB_ATTRIBUTE.USER_NEW</recordfield> + </dbRecordFieldMapping> + </recordFieldMappings> + </dbRecordContainer> + </recordContainers> +</entity> diff --git a/entity/Attribute_entity/entityfields/ab_attributeid/valueProcess.js b/entity/Attribute_entity/entityfields/ab_attributeid/valueProcess.js new file mode 100644 index 00000000000..7df83b4096e --- /dev/null +++ b/entity/Attribute_entity/entityfields/ab_attributeid/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/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js b/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js new file mode 100644 index 00000000000..229750916e6 --- /dev/null +++ b/entity/Attribute_entity/entityfields/attribute_parent_id/valueProcess.js @@ -0,0 +1,5 @@ +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 new file mode 100644 index 00000000000..3ad10331825 --- /dev/null +++ b/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js @@ -0,0 +1,12 @@ +import("system.translate"); +import("system.result"); + +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 diff --git a/entity/Attribute_entity/entityfields/date_new/valueProcess.js b/entity/Attribute_entity/entityfields/date_new/valueProcess.js new file mode 100644 index 00000000000..7acb3c80848 --- /dev/null +++ b/entity/Attribute_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/Attribute_entity/entityfields/user_new/valueProcess.js b/entity/Attribute_entity/entityfields/user_new/valueProcess.js new file mode 100644 index 00000000000..a8a5e28793c --- /dev/null +++ b/entity/Attribute_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/Attribute_entity/recordcontainers/db/conditionProcess.js b/entity/Attribute_entity/recordcontainers/db/conditionProcess.js new file mode 100644 index 00000000000..2c2d8e0a101 --- /dev/null +++ b/entity/Attribute_entity/recordcontainers/db/conditionProcess.js @@ -0,0 +1,6 @@ +import("system.vars"); +import("system.result"); +import("Sql_lib"); + +//if (vars.exists("$field.AB_ATTRIBUTEID") && vars.get("$field.AB_ATTRIBUTEID") != "") +// result.string(SqlCondition.begin().andPrepare("ATTRIBUTE_PARENT_ID", vars.get("$field.AB_ATTRIBUTEID"))); \ No newline at end of file diff --git a/entity/Comm_entity/entityfields/medium_id/valueProcess.js b/entity/Comm_entity/entityfields/medium_id/valueProcess.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/entity/Org_entity/Org_entity.aod b/entity/Org_entity/Org_entity.aod index 0530657e991..aebaf241f2a 100644 --- a/entity/Org_entity/Org_entity.aod +++ b/entity/Org_entity/Org_entity.aod @@ -456,6 +456,23 @@ <onActionProcess>%aditoprj%/entity/Org_entity/entityfields/orgreport/onActionProcess.js</onActionProcess> <iconId>VAADIN:FILE_TEXT_O</iconId> </entityActionField> + <entityOutgoingField> + <name>OrgAttr_dfo</name> + <title>Attributes</title> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>AttributeRelation_entity</entityName> + <fieldName>OrgAttr_dfi</fieldName> + </dependency> + <children> + <entityParameter> + <name>objectRowId</name> + <code>%aditoprj%/entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid/code.js</code> + <triggerRecalculation v="true" /> + </entityParameter> + </children> + </entityOutgoingField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid/code.js b/entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid/code.js new file mode 100644 index 00000000000..0e435a3d15e --- /dev/null +++ b/entity/Org_entity/entityfields/orgattr_dfo/children/objectrowid/code.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.ORGID")); \ No newline at end of file diff --git a/entity/Org_entity/recordcontainers/db/onDBUpdate.js b/entity/Org_entity/recordcontainers/db/onDBUpdate.js index b0047f43f07..a2bda1f54c6 100644 --- a/entity/Org_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/Org_entity/recordcontainers/db/onDBUpdate.js @@ -3,7 +3,7 @@ import("Org_lib"); import("Comm_lib"); import("Entity_lib"); -// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer +// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Container FieldChanges.assimilateChangeAndDispose("$field.IMAGE", function(state, value){ if (state == FieldChanges.STATE_CHANGED()) OrgUtils.setImage(vars.get("$field.ORGID"), value); diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index a6b15592693..1827341f95e 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -1458,6 +1458,9 @@ <entry> <key>responsible</key> </entry> + <entry> + <key>${ADDRESS_STATE}</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 133c768f668..1d1edeea216 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -34,6 +34,10 @@ <key>Show all activities</key> <value>Alle Aktivitäten anzeigen</value> </entry> + <entry> + <key>${ADDRESS_STATE}</key> + <value>Staat</value> + </entry> <entry> <key>Show all contracts</key> <value>Alle Verträge anzeigen</value> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index e851009f1d3..ea7e8213f71 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -1487,6 +1487,10 @@ <entry> <key>responsible</key> </entry> + <entry> + <key>${ADDRESS_STATE}</key> + <value>state</value> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/AttributeRelation_context/AttributeRelation_context.aod b/neonContext/AttributeRelation_context/AttributeRelation_context.aod new file mode 100644 index 00000000000..4604a512c94 --- /dev/null +++ b/neonContext/AttributeRelation_context/AttributeRelation_context.aod @@ -0,0 +1,19 @@ +<?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>AttributeRelation_context</name> + <title>Attributes</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <filterview>AttributeRelationTree_view</filterview> + <editview>AttributeRelationMultiEdit_view</editview> + <entity>AttributeRelation_entity</entity> + <references> + <neonViewReference> + <name>d21d2e1b-db79-4013-a056-6e9ce35a5757</name> + <view>AttributeRelationTree_view</view> + </neonViewReference> + <neonViewReference> + <name>52dd8729-c22d-4767-b491-1e8c9d157ddb</name> + <view>AttributeRelationMultiEdit_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonContext/Attribute_context/Attribute_context.aod b/neonContext/Attribute_context/Attribute_context.aod new file mode 100644 index 00000000000..63209dcd4c9 --- /dev/null +++ b/neonContext/Attribute_context/Attribute_context.aod @@ -0,0 +1,30 @@ +<?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>Attribute_context</name> + <title>Attributes</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <icon>VAADIN:TAGS</icon> + <mainview>AttributeMain_view</mainview> + <filterview>AttributeFilter_view</filterview> + <editview>AttributeEdit_view</editview> + <preview>AttributePreview_view</preview> + <entity>Attribute_entity</entity> + <references> + <neonViewReference> + <name>058f2577-b598-4d92-90ad-628342302a9c</name> + <view>AttributeFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>96bf484d-dc8d-42ad-9242-dfefacc87956</name> + <view>AttributePreview_view</view> + </neonViewReference> + <neonViewReference> + <name>59089acc-a6db-48c2-8061-2d3ca8246e37</name> + <view>AttributeEdit_view</view> + </neonViewReference> + <neonViewReference> + <name>05d998e7-7364-4425-aefe-3cf284933d52</name> + <view>AttributeMain_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonView/AddressEdit_view/AddressEdit_view.aod b/neonView/AddressEdit_view/AddressEdit_view.aod index e0fa06319ca..60a769bd9d3 100644 --- a/neonView/AddressEdit_view/AddressEdit_view.aod +++ b/neonView/AddressEdit_view/AddressEdit_view.aod @@ -21,6 +21,10 @@ <name>d8a7a16b-9d7f-44d7-bbb1-b0404d5b8b8f</name> <entityField>COUNTRY</entityField> </entityFieldLink> + <entityFieldLink> + <name>e7804363-405d-429d-91c9-23de9685cc9a</name> + <entityField>STATE</entityField> + </entityFieldLink> <entityFieldLink> <name>c70668f3-6722-4a90-86d6-0d89be06dbe1</name> <entityField>ADDRESS</entityField> diff --git a/neonView/AddressFilter_view/AddressFilter_view.aod b/neonView/AddressFilter_view/AddressFilter_view.aod index a4d5fe9263d..78f5d08807b 100644 --- a/neonView/AddressFilter_view/AddressFilter_view.aod +++ b/neonView/AddressFilter_view/AddressFilter_view.aod @@ -37,6 +37,10 @@ <name>10e9e08f-db9b-4789-a4b4-b2a0a750b069</name> <entityField>COUNTRY</entityField> </neonTableColumn> + <neonTableColumn> + <name>9a965a25-a8aa-4777-865e-138624f2d848</name> + <entityField>STATE</entityField> + </neonTableColumn> </columns> </tableViewTemplate> </children> diff --git a/neonView/AddressList_view/AddressList_view.aod b/neonView/AddressList_view/AddressList_view.aod index e947fb863fe..ab275f2b133 100644 --- a/neonView/AddressList_view/AddressList_view.aod +++ b/neonView/AddressList_view/AddressList_view.aod @@ -22,6 +22,10 @@ <name>dfaa01a1-0b11-4f92-aa18-89f12ebb2db5</name> <entityField>COUNTRY</entityField> </neonTableColumn> + <neonTableColumn> + <name>17039f2e-4253-4242-bcc4-b75483adfbd0</name> + <entityField>STATE</entityField> + </neonTableColumn> <neonTableColumn> <name>4e5e6a4f-f43e-4861-a912-fb05e576f960</name> <entityField>ADDRESS</entityField> diff --git a/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod b/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod index b754b222004..4192daba616 100644 --- a/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod +++ b/neonView/AdressMultiEdit_view/AdressMultiEdit_view.aod @@ -36,6 +36,10 @@ <name>d8a7a26b-9d7f-44d7-bbb1-b0404d5b8b2f</name> <entityField>COUNTRY</entityField> </neonTableColumn> + <neonTableColumn> + <name>945bd8e7-9d0d-4e32-8908-24d8dfb74463</name> + <entityField>STATE</entityField> + </neonTableColumn> </columns> </genericMultipleViewTemplate> </children> diff --git a/neonView/AttributeEdit_view/AttributeEdit_view.aod b/neonView/AttributeEdit_view/AttributeEdit_view.aod new file mode 100644 index 00000000000..8b8e4d7257f --- /dev/null +++ b/neonView/AttributeEdit_view/AttributeEdit_view.aod @@ -0,0 +1,27 @@ +<?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>AttributeEdit_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericViewTemplate> + <name>AttrEdit_template</name> + <editMode v="true" /> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>0c6cd7c6-cced-4719-b0c5-08f8e3d13f2f</name> + <entityField>ATTRIBUTE_NAME</entityField> + </entityFieldLink> + <entityFieldLink> + <name>8cbc6049-2530-4960-b45f-830f3220889e</name> + <entityField>ATTRIBUTE_TYPE</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + </children> +</neonView> diff --git a/neonView/AttributeFilter_view/AttributeFilter_view.aod b/neonView/AttributeFilter_view/AttributeFilter_view.aod new file mode 100644 index 00000000000..c3090529d6c --- /dev/null +++ b/neonView/AttributeFilter_view/AttributeFilter_view.aod @@ -0,0 +1,29 @@ +<?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>AttributeFilter_view</name> + <title>Attributes</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <filterable v="true" /> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <tableViewTemplate> + <name>Table_template</name> + <entityField>#ENTITY</entityField> + <title>Attributes</title> + <columns> + <neonTableColumn> + <name>a8065137-406d-49ea-9ebf-a04fbecba2fb</name> + <entityField>ATTRIBUTE_NAME</entityField> + </neonTableColumn> + <neonTableColumn> + <name>054d2c18-8434-4a47-bc0d-c8782f4d1a8f</name> + <entityField>ATTRIBUTE_TYPE</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/neonView/AttributeMain_view/AttributeMain_view.aod b/neonView/AttributeMain_view/AttributeMain_view.aod new file mode 100644 index 00000000000..a05ff635924 --- /dev/null +++ b/neonView/AttributeMain_view/AttributeMain_view.aod @@ -0,0 +1,23 @@ +<?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>AttributeMain_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <masterSlaveLayout> + <name>layout</name> + <master>b8e5b606-4fbb-4a74-b7c4-ac612a9797f2</master> + </masterSlaveLayout> + </layout> + <children> + <neonViewReference> + <name>b8e5b606-4fbb-4a74-b7c4-ac612a9797f2</name> + <entityField>#ENTITY</entityField> + <view>AttributePreview_view</view> + </neonViewReference> + <neonViewReference> + <name>d8009eea-f473-4f65-8796-a1ab48ef3b49</name> + <entityField>#ENTITY</entityField> + <view>AttributeFilter_view</view> + </neonViewReference> + </children> +</neonView> diff --git a/neonView/AttributePreview_view/AttributePreview_view.aod b/neonView/AttributePreview_view/AttributePreview_view.aod new file mode 100644 index 00000000000..39928da62cb --- /dev/null +++ b/neonView/AttributePreview_view/AttributePreview_view.aod @@ -0,0 +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.0.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.0.1"> + <name>AttributePreview_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <cardViewTemplate> + <name>Attr_template</name> + <titleField>ATTRIBUTE_NAME</titleField> + <descriptionField>ATTRIBUTE_TYPE</descriptionField> + <entityField>#ENTITY</entityField> + </cardViewTemplate> + </children> +</neonView> diff --git a/neonView/AttributeRelationMultiEdit_view/AttributeRelationMultiEdit_view.aod b/neonView/AttributeRelationMultiEdit_view/AttributeRelationMultiEdit_view.aod new file mode 100644 index 00000000000..ca31736c723 --- /dev/null +++ b/neonView/AttributeRelationMultiEdit_view/AttributeRelationMultiEdit_view.aod @@ -0,0 +1,26 @@ +<?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>AttributeRelationMultiEdit_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericMultipleViewTemplate> + <name>AttrEdit_template</name> + <entityField>#ENTITY</entityField> + <columns> + <neonTableColumn> + <name>1f770fc2-2a07-4f7b-b699-b7bbbeb6e9aa</name> + <entityField>AB_ATTRIBUTE_ID</entityField> + </neonTableColumn> + <neonTableColumn> + <name>f0d587b2-86c2-4bc2-9d6b-61a5e64c7929</name> + <entityField>ATTRIBUTERELATION_VALUE</entityField> + </neonTableColumn> + </columns> + </genericMultipleViewTemplate> + </children> +</neonView> diff --git a/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod b/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod new file mode 100644 index 00000000000..f2ce9e62c6e --- /dev/null +++ b/neonView/AttributeRelationTree_view/AttributeRelationTree_view.aod @@ -0,0 +1,20 @@ +<?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>AttributeRelationTree_view</name> + <title>Attributes</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <treetableViewTemplate> + <name>AttrRelationTree_template</name> + <titleField>ATTRIBUTE_NAME</titleField> + <descriptionField>ATTRIBUTERELATION_VALUE</descriptionField> + <entityField>#ENTITY</entityField> + <title>Attributes</title> + </treetableViewTemplate> + </children> +</neonView> diff --git a/neonView/OrgEdit_view/OrgEdit_view.aod b/neonView/OrgEdit_view/OrgEdit_view.aod index 84b506c2767..3503cc145ff 100644 --- a/neonView/OrgEdit_view/OrgEdit_view.aod +++ b/neonView/OrgEdit_view/OrgEdit_view.aod @@ -52,5 +52,10 @@ <entityField>OrgComm_dfo</entityField> <view>CommMultiEdit_view</view> </neonViewReference> + <neonViewReference> + <name>2e648487-73d1-41ce-a562-5ce6bce3b599</name> + <entityField>OrgAttr_dfo</entityField> + <view>AttributeRelationMultiEdit_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/OrgMain_view/OrgMain_view.aod b/neonView/OrgMain_view/OrgMain_view.aod index 4c801b173f0..8c01252daf7 100644 --- a/neonView/OrgMain_view/OrgMain_view.aod +++ b/neonView/OrgMain_view/OrgMain_view.aod @@ -1,7 +1,7 @@ <?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>OrgMain_view</name> - <title></title> + <title>Attribute</title> <majorModelMode>DISTRIBUTED</majorModelMode> <layout> <masterSlaveLayout> @@ -40,5 +40,10 @@ <entityField>OrgContract_dfo</entityField> <view>ContractFilter_view</view> </neonViewReference> + <neonViewReference> + <name>39c98ccb-7f77-4df0-818f-1f302f69fec4</name> + <entityField>OrgAttr_dfo</entityField> + <view>AttributeRelationTree_view</view> + </neonViewReference> </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 new file mode 100644 index 00000000000..c273b1d4737 --- /dev/null +++ b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attribute.xml @@ -0,0 +1,26 @@ +<?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="fbe17fba-5bf7-4203-8f6f-01723e07654c"> + <createTable tableName="AB_ATTRIBUTE"> + <column name="AB_ATTRIBUTEID" type="CHAR(36)"> + <constraints primaryKey="true" primaryKeyName="PK_AB_ATTRIBUTE_AB_ATTRIBUTEID"/> + </column> + <column name="ATTRIBUTE_PARENT_ID" type="CHAR(36)"> + </column> + <column name="ATTRIBUTE_TYPE" type="NVARCHAR(63)"> + <constraints nullable="false"/> + </column> + <column name="ATTRIBUTE_NAME" type="NVARCHAR(63)"> + <constraints nullable="false"/> + </column> + <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/data_alias/struct/AditoBasic/create_ab_attributerelation.xml b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml new file mode 100644 index 00000000000..cf41044fa1b --- /dev/null +++ b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml @@ -0,0 +1,31 @@ +<?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="e7699654-7d2f-4657-a0f6-50416f76386b"> + <createTable tableName="AB_ATTRIBUTERELATION"> + <column name="AB_ATTRIBUTERELATIONID" type="CHAR(36)"> + <constraints primaryKey="true" primaryKeyName="PK_AB_ATTRIBUTERELATION_AB_ATTRIBUTERELATIONID"/> + </column> + <column name="AB_ATTRIBUTE_ID" type="CHAR(36)"> + <constraints nullable="false"/> + </column> + <column name="OBJECT_ROWID" type="CHAR(36)"> + <constraints nullable="false"/> + </column> + <column name="OBJECT_TYPE" type="NVARCHAR(63)"> + <constraints nullable="false"/> + </column> + <column name="CHAR_VALUE" type="NVARCHAR(63)"/> + <column name="DATE_VALUE" type="TIMESTAMP"/> + <column name="NUMBER_VALUE" type="NUMERIC(14,2)"/> + <column name="ID_VALUE" type="CHAR(36)"/> + <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 4b7365bb064..1bdf1e87d10 100644 --- a/others/db_changes/masterChangelog.xml +++ b/others/db_changes/masterChangelog.xml @@ -1,6 +1,8 @@ <?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"> <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/create_pers.xml"/> <include file="data_alias/struct/create_org.xml"/> diff --git a/process/Attribute_lib/Attribute_lib.aod b/process/Attribute_lib/Attribute_lib.aod new file mode 100644 index 00000000000..f50b749c964 --- /dev/null +++ b/process/Attribute_lib/Attribute_lib.aod @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.7" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.1.7"> + <name>Attribute_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/Attribute_lib/process.js</process> + <alias>Data_alias</alias> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js new file mode 100644 index 00000000000..83a8f7163a8 --- /dev/null +++ b/process/Attribute_lib/process.js @@ -0,0 +1,63 @@ +import("system.neon"); +import("system.vars"); +import("system.db"); +import("Sql_lib"); + +function AttributeUtil () {} + + + +function AttributeHandler (pAttrId) +{ + this.attributeId = pAttrId; + this._attributeType = null; +} + +AttributeHandler.begin = function (pAttrId) +{ + return new AttributeHandler(pAttrId); +} + +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); + this._attributeType = db.cell(attrTypeSelect); + } + return this._attributeType; +} + +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 + } +} + +AttributeHandler.prototype.getAttributeValue = function () +{ + var field = this.getAttributeField(); + if (field != null && vars.exists(field)) + return vars.get(field); + return null; //TODO: change default value maybe +} + +AttributeHandler.prototype.setAttributeValue = function (pValue) +{ + var field = this.getAttributeField(); + if (field != null && vars.exists(field)) + neon.setFieldValue(field, pValue) + return pValue; +} \ No newline at end of file diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index 98d834bfa9a..41a63250c96 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.translate"); import("system.vars"); import("system.db"); -- GitLab