diff --git a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod index 1991fe78ecbd39bf8d2705bf172f5355ce0942d4..a27ce68caa45c48538ab846a22556d363249f264 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 e1a36b9deb60495c6151df1c964cdbec7907b066..9414f06a232884c8201e9f6c708b8bc0a3729a24 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 0000000000000000000000000000000000000000..20938e93f594c2d2e64717e1079456d90e61008c --- /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 0000000000000000000000000000000000000000..db23dc640cdb99f86570478770bd76a37acdbeaf --- /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 0000000000000000000000000000000000000000..749c17f2401775fb86abb79f7b2baf00744a5681 --- /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 0000000000000000000000000000000000000000..622e00f05f77bd63405f4487831518087cc38d27 --- /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 0000000000000000000000000000000000000000..fe458c9ab433005cbde2e975aa2c02621a1a7f42 --- /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 0000000000000000000000000000000000000000..7937f8e04a370bd7ddee7d8604a6609d3e86f5e8 --- /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 0000000000000000000000000000000000000000..59280880c332f6d5a36c650a1ef0fccfbf3e2651 --- /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 0000000000000000000000000000000000000000..7acb3c80848f54a4c6dfee5efa7a5b8514dd4a71 --- /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 0000000000000000000000000000000000000000..99b42d18f75e3441154047d5f9b7136e8ef5166e --- /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 0000000000000000000000000000000000000000..66c6cdedc9052d770105010df3701efec0e71e5f --- /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 0000000000000000000000000000000000000000..a8a5e28793c742f8f3e10907976e746faf43c67c --- /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 0000000000000000000000000000000000000000..689065291e1ef2f0f3d59d09cac9d07ec7faeae5 --- /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 0000000000000000000000000000000000000000..e4aa4657a299ef907e6fb0b44865b0b97c35bd8c --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Attribute_entity/Attribute_entity.aod b/entity/Attribute_entity/Attribute_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..9a4ed6eb7a35f7f4cd09d15c1e18af18b59f628f --- /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 0000000000000000000000000000000000000000..7df83b4096e7df4d63cc4d81f8fadf0884444479 --- /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 0000000000000000000000000000000000000000..229750916e60d67850d99af11ea9f1de22c7c8f5 --- /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 0000000000000000000000000000000000000000..3ad103318252b8d15150a637ef00da854b5f7927 --- /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 0000000000000000000000000000000000000000..7acb3c80848f54a4c6dfee5efa7a5b8514dd4a71 --- /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 0000000000000000000000000000000000000000..a8a5e28793c742f8f3e10907976e746faf43c67c --- /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 0000000000000000000000000000000000000000..2c2d8e0a101e1051fb616a6b74bf859065b787cb --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Org_entity/Org_entity.aod b/entity/Org_entity/Org_entity.aod index 0530657e991ad5e006b0c65b85b9820d8e834bef..aebaf241f2a4b2f78e7af4fcfb3bf83cd29456bc 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 0000000000000000000000000000000000000000..0e435a3d15ece690e8f94844a8ac57ad2f3c2b08 --- /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 b0047f43f07c4f962b6165f3a429dac26ea689b7..a2bda1f54c6408cb82440aae4bcfd276ca567608 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 a6b15592693cc0ae3333433d9c3c31de7cb1132e..1827341f95eac8a925c1bd316d285373208a5e8b 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 133c768f66871f7c83e350f0379360dc98120f61..1d1edeea216fc05ee7996b7c522c53b0b9a6ce49 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 e851009f1d3001359ae878ae5a154c6814d51002..ea7e8213f71c4113797f8fb6b391461d8fc40bea 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 0000000000000000000000000000000000000000..4604a512c94044f9b5f1e9c4157158e63712faad --- /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 0000000000000000000000000000000000000000..63209dcd4c959033893c525a167ee46d0967c84a --- /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 e0fa06319ca80dd75e43e38d2c10af3efc74eaac..60a769bd9d3b7e03293cb832b6c904b70a19630c 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 a4d5fe9263d10885d94fa5b9653a1a85f6634908..78f5d08807b8c870c61f898395c631ad52193115 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 e947fb863feb2b6ce28009ea7936885c386dec3c..ab275f2b133aa5e18f0c73f3a177f71a4f29c44a 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 b754b2220048536cf7c4ea7dd2944f92bafe5ab6..4192daba616b5f41261d4545ae65b0fb90d82dc5 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 0000000000000000000000000000000000000000..8b8e4d7257f0306adec5f8944570728b343cb119 --- /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 0000000000000000000000000000000000000000..c3090529d6cd218b1fe2662d9930498bb9a1d86e --- /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 0000000000000000000000000000000000000000..a05ff63592482a74910ad7c4acb5d15c63d3c7c5 --- /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 0000000000000000000000000000000000000000..39928da62cb424594ac8ab1cd284a8743a01ccbf --- /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 0000000000000000000000000000000000000000..ca31736c723a102cd2a0f3bb847bed95199fe535 --- /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 0000000000000000000000000000000000000000..f2ce9e62c6ed051430b89e2c7a94178ded87c1a0 --- /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 84b506c276756bf85e1101644d23570ec76dc917..3503cc145ffb92d69ca89adcaa7148fff6a550b3 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 4c801b173f0262c80eb0aac639b39869794dd878..8c01252daf7d5a6a06a16b8850e01d97513742f8 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 0000000000000000000000000000000000000000..c273b1d47371ffc9301454e9dbc0857376a0a75f --- /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 0000000000000000000000000000000000000000..cf41044fa1bbb8a96838a1141eeaaacb6e184eac --- /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 4b7365bb064dd953d9d276d51579a56806e2261f..1bdf1e87d10fb835e4208bf21b3fc89f298c58f4 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 0000000000000000000000000000000000000000..f50b749c9645b06fd60039a0b9597148d22850c7 --- /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 0000000000000000000000000000000000000000..83a8f7163a8703181b5b42c2a52d9343056015e1 --- /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 98d834bfa9ad8ce865cd75264e9f550717bee9ff..41a63250c9604e51983201630073f57980284b92 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");