diff --git a/entity/AppointmentLink_entity/AppointmentLink_entity.aod b/entity/AppointmentLink_entity/AppointmentLink_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..35cdd9cda3f498036eb3b8c6c90c58fe6fbb4277 --- /dev/null +++ b/entity/AppointmentLink_entity/AppointmentLink_entity.aod @@ -0,0 +1,79 @@ +<?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.2.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.2.0"> + <name>AppointmentLink_entity</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <recordContainer>db</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + <recordContainer>db</recordContainer> + </entityProvider> + <entityField> + <name>APPOINTMENTLINKID</name> + </entityField> + <entityField> + <name>APPOINTMENT_ID</name> + </entityField> + <entityField> + <name>OBJECTID</name> + </entityField> + <entityField> + <name>OBJECTTYPE</name> + </entityField> + <entityParameter> + <name>AppointmentId_param</name> + <expose v="true" /> + <mandatory v="false" /> + <description>PARAMETER</description> + </entityParameter> + <entityProvider> + <name>Link</name> + <fieldType>DEPENDENCY_IN</fieldType> + <targetContextField>OBJECTTYPE</targetContextField> + <targetIdField>OBJECTID</targetIdField> + <recordContainer>db</recordContainer> + <dependencies> + <entityDependency> + <name>3dde1745-18a1-4499-83d0-61e414086997</name> + <entityName>Appointment_entity</entityName> + <fieldName>AppointmentLinks</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> + </entityProvider> + </entityFields> + <recordContainers> + <dbRecordContainer> + <name>db</name> + <alias>Data_alias</alias> + <conditionProcess>%aditoprj%/entity/AppointmentLink_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <linkInformation> + <linkInformation> + <name>4b8f04a4-9d0f-4ff1-90f3-e173930788cc</name> + <tableName>APPOINTMENTLINK</tableName> + <primaryKey>APPOINTMENTLINK_ID</primaryKey> + <isUIDTable v="true" /> + <readonly v="false" /> + </linkInformation> + </linkInformation> + <recordFieldMappings> + <dbRecordFieldMapping> + <name>APPOINTMENT_ID.value</name> + <recordfield>APPOINTMENTLINK.APPOINTMENT_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>APPOINTMENTLINKID.value</name> + <recordfield>APPOINTMENTLINK.APPOINTMENTLINK_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OBJECTID.value</name> + <recordfield>APPOINTMENTLINK.OBJECT_ROWID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>OBJECTTYPE.value</name> + <recordfield>APPOINTMENTLINK.OBJECT_TYPE</recordfield> + </dbRecordFieldMapping> + </recordFieldMappings> + </dbRecordContainer> + </recordContainers> +</entity> diff --git a/entity/AppointmentLink_entity/recordcontainers/db/conditionProcess.js b/entity/AppointmentLink_entity/recordcontainers/db/conditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d07a6fc35d714eec0cb968234e7cf24d92dae098 --- /dev/null +++ b/entity/AppointmentLink_entity/recordcontainers/db/conditionProcess.js @@ -0,0 +1,9 @@ +import("system.db"); +import("system.result"); +import("Sql_lib"); + +var cond = SqlCondition.begin() + .andPrepareVars("APPOINTMENTLINK.APPOINTMENT_ID", "$param.AppointmentId_param") + +//TODO: use a preparedCondition when available +result.string(db.translateCondition(cond.build("1 = 1"))); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/AttributeRelation_entity.aod b/entity/AttributeRelation_entity/AttributeRelation_entity.aod index d15eed456adbf95057975609e862dbb79e4df192..8672e15c2837cc586414f877b1588c7294f9eeeb 100644 --- a/entity/AttributeRelation_entity/AttributeRelation_entity.aod +++ b/entity/AttributeRelation_entity/AttributeRelation_entity.aod @@ -32,6 +32,7 @@ <name>ATTRIBUTERELATION_VALUE</name> <title>Value</title> <contentTypeProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js</contentTypeProcess> + <resolution>DAY</resolution> <valueProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/attributerelation_value/valueProcess.js</valueProcess> <onValueChange>%aditoprj%/entity/AttributeRelation_entity/entityfields/attributerelation_value/onValueChange.js</onValueChange> </entityField> diff --git a/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js b/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js index ccd7b53d9e4d0fc3179309d08ce8ff17ad651702..d916ea680e646d3f92de179bf93b33a6bbbf260c 100644 --- a/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js +++ b/entity/AttributeRelation_entity/entityfields/attributerelation_value/contentTypeProcess.js @@ -1,8 +1,6 @@ -import("system.logging"); import("system.vars"); import("system.result"); import("Attribute_lib"); var attrType = AttributeHandler.begin(vars.get("$field.AB_ATTRIBUTE_ID")).getAttributeContentType(); -logging.log("type is " + attrType) result.string(attrType); \ No newline at end of file diff --git a/entity/Attribute_entity/Attribute_entity.aod b/entity/Attribute_entity/Attribute_entity.aod index e21123c02461a590b8658b3d4b339b58aa3d69ac..e95bbe7da57a4f4285d84a7c2648efc132a85207 100644 --- a/entity/Attribute_entity/Attribute_entity.aod +++ b/entity/Attribute_entity/Attribute_entity.aod @@ -18,8 +18,8 @@ <entityField> <name>ATTRIBUTE_TYPE</name> <title>Type</title> + <consumer>KeywordAttributeType</consumer> <mandatory v="true" /> - <possibleItemsProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js</possibleItemsProcess> </entityField> <entityField> <name>AB_ATTRIBUTEID</name> @@ -73,6 +73,21 @@ <possibleItemsProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_active/possibleItemsProcess.js</possibleItemsProcess> <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/attribute_active/valueProcess.js</valueProcess> </entityField> + <entityConsumer> + <name>KeywordAttributeType</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>KeywordEntry_entity</entityName> + <fieldName>SpecificContainerKeywords</fieldName> + </dependency> + <children> + <entityParameter> + <name>containerName_param</name> + <code>%aditoprj%/entity/Attribute_entity/entityfields/keywordattributetype/children/containername_param/code.js</code> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> @@ -109,6 +124,10 @@ <name>ATTRIBUTE_ACTIVE.value</name> <recordfield>AB_ATTRIBUTE.ATTRIBUTE_ACTIVE</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ATTRIBUTE_TYPE.displayValue</name> + <expression>%aditoprj%/entity/Attribute_entity/recordcontainers/db/recordfieldmappings/attribute_type.displayvalue/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js b/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js deleted file mode 100644 index 3dc3e304437678edc609efc401378f1d2b0d84e9..0000000000000000000000000000000000000000 --- a/entity/Attribute_entity/entityfields/attribute_type/possibleItemsProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.result"); -import("Attribute_lib"); - -result.object(AttributeTypes.getTypeList()); \ No newline at end of file diff --git a/entity/Attribute_entity/entityfields/keywordattributetype/children/containername_param/code.js b/entity/Attribute_entity/entityfields/keywordattributetype/children/containername_param/code.js new file mode 100644 index 0000000000000000000000000000000000000000..437ff727d34d1243615ba8b321e0713af35ae485 --- /dev/null +++ b/entity/Attribute_entity/entityfields/keywordattributetype/children/containername_param/code.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Keyword_lib"); + +result.string($KeywordRegistry.get.AttributeType); \ No newline at end of file diff --git a/entity/Attribute_entity/recordcontainers/db/recordfieldmappings/attribute_type.displayvalue/expression.js b/entity/Attribute_entity/recordcontainers/db/recordfieldmappings/attribute_type.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..8c745d3aa3627911fb2de2138a2381f8870a32a1 --- /dev/null +++ b/entity/Attribute_entity/recordcontainers/db/recordfieldmappings/attribute_type.displayvalue/expression.js @@ -0,0 +1,5 @@ +import("system.result"); +import("Keyword_lib"); + +var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.get.AttributeType, "AB_ATTRIBUTE.ATTRIBUTE_TYPE"); +result.string(sql); \ No newline at end of file diff --git a/entity/KeywordAttributeRelation_entity/KeywordAttributeRelation_entity.aod b/entity/KeywordAttributeRelation_entity/KeywordAttributeRelation_entity.aod index c7bfef823a151b1250bf7e22ecb8c2406b763f6b..e9462ab5b45dfe3f192ff3b568efb142da122d52 100644 --- a/entity/KeywordAttributeRelation_entity/KeywordAttributeRelation_entity.aod +++ b/entity/KeywordAttributeRelation_entity/KeywordAttributeRelation_entity.aod @@ -15,18 +15,22 @@ </entityField> <entityField> <name>CHAR_VALUE</name> + <title>CHAR_VALUE</title> </entityField> <entityField> <name>NUMBER_VALUE</name> + <contentType>NUMBER</contentType> </entityField> <entityField> <name>BOOL_VALUE</name> + <contentType>BOOLEAN</contentType> </entityField> <entityField> <name>AB_KEYWORD_ATTRIBUTE_ID</name> <title>Keyword Attribute</title> <consumer>KeywordAttributes</consumer> <mandatory v="true" /> + <onValueChange>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attribute_id/onValueChange.js</onValueChange> </entityField> <entityField> <name>AB_KEYWORD_ENTRY_ID</name> @@ -34,7 +38,7 @@ <valueProcess>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_entry_id/valueProcess.js</valueProcess> </entityField> <entityProvider> - <name>SpecificContainer</name> + <name>AttributesForKeywordEntry</name> <fieldType>DEPENDENCY_IN</fieldType> <title></title> <recordContainer>db</recordContainer> @@ -49,8 +53,9 @@ </entityProvider> <entityParameter> <name>containerName_param</name> - <expose v="true" /> + <code>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/containername_param/code.js</code> <triggerRecalculation v="true" /> + <mandatory v="false" /> <description>PARAMETER</description> </entityParameter> <entityConsumer> @@ -73,25 +78,33 @@ </children> </entityConsumer> <entityParameter> - <name>keywordEntry_param</name> + <name>keywordEntryId_param</name> <expose v="true" /> <triggerRecalculation v="true" /> <mandatory v="true" /> <description>PARAMETER</description> </entityParameter> <entityField> - <name>VALUE_PROXY</name> - <documentation>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/value_proxy/documentation.adoc</documentation> - <valueProcess>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/value_proxy/valueProcess.js</valueProcess> + <name>valueProxy</name> + <documentation>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/documentation.adoc</documentation> + <title>Value</title> + <contentTypeProcess>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/contentTypeProcess.js</contentTypeProcess> + <valueProcess>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/valueProcess.js</valueProcess> + <onValueChange>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/onValueChange.js</onValueChange> + </entityField> + <entityField> + <name>attributeType</name> + <valueProcess>%aditoprj%/entity/KeywordAttributeRelation_entity/entityfields/attributetype/valueProcess.js</valueProcess> </entityField> </entityFields> <recordContainers> <dbRecordContainer> <name>db</name> <alias>Data_alias</alias> + <conditionProcess>%aditoprj%/entity/KeywordAttributeRelation_entity/recordcontainers/db/conditionProcess.js</conditionProcess> <linkInformation> <linkInformation> - <name>a52883ee-630c-4373-a4ad-9b1e8c3e8188</name> + <name>8e2938d2-e14b-403b-8ae5-875f70bc3f85</name> <tableName>AB_KEYWORD_ATTRIBUTERELATION</tableName> <primaryKey>AB_KEYWORD_ATTRIBUTERELATIONID</primaryKey> <isUIDTable v="true" /> diff --git a/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attribute_id/onValueChange.js b/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attribute_id/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..a26f98d31481d3a3bfa76a0473c1d40e34c42437 --- /dev/null +++ b/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_attribute_id/onValueChange.js @@ -0,0 +1,5 @@ +import("system.vars"); + +vars.set("$field.CHAR_VALUE", ""); +vars.set("$field.BOOL_VALUE", ""); +vars.set("$field.NUMBER_VALUE", ""); \ No newline at end of file diff --git a/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_entry_id/valueProcess.js b/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_entry_id/valueProcess.js index 6a057300b2bb369ed866518193c9282931956dfb..1cacf4fccb58c3e2e610112acb3e4d0cfa888ea1 100644 --- a/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_entry_id/valueProcess.js +++ b/entity/KeywordAttributeRelation_entity/entityfields/ab_keyword_entry_id/valueProcess.js @@ -3,6 +3,6 @@ import("system.result"); import("system.neon"); import("system.vars"); -var keywordEntryId = vars.get("$param.keywordEntry_param"); +var keywordEntryId = vars.get("$param.keywordEntryId_param"); if(keywordEntryId && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) result.string(keywordEntryId); \ No newline at end of file diff --git a/entity/KeywordAttributeRelation_entity/entityfields/attributetype/valueProcess.js b/entity/KeywordAttributeRelation_entity/entityfields/attributetype/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f6990e515424e20b5df112f89c6239bd94b8ac09 --- /dev/null +++ b/entity/KeywordAttributeRelation_entity/entityfields/attributetype/valueProcess.js @@ -0,0 +1,15 @@ +import("system.db"); +import("system.result"); +import("system.vars"); +import("Sql_lib"); + +var id = vars.get("$field.AB_KEYWORD_ATTRIBUTE_ID"); +var type = null; +if (id) +{ + type = db.cell(SqlCondition.begin() + .andPrepare("AB_KEYWORD_ATTRIBUTE.AB_KEYWORD_ATTRIBUTEID", id) + .buildSql("select AB_KEYWORD_ATTRIBUTE.TYPE from AB_KEYWORD_ATTRIBUTE")); + type = type.trim(); +} +result.string(type); \ No newline at end of file diff --git a/entity/KeywordAttributeRelation_entity/entityfields/containername_param/code.js b/entity/KeywordAttributeRelation_entity/entityfields/containername_param/code.js new file mode 100644 index 0000000000000000000000000000000000000000..9b0d81d5448db545f58206e9298bfd1c51335cfb --- /dev/null +++ b/entity/KeywordAttributeRelation_entity/entityfields/containername_param/code.js @@ -0,0 +1,10 @@ +import("system.db"); +import("system.result"); +import("system.vars"); +import("Sql_lib"); + +var entryId = vars.get("$param.keywordEntryId_param"); +var containerName = db.cell(SqlCondition.begin().andPrepare("AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID", entryId) + .buildSql("select AB_KEYWORD_ENTRY.CONTAINER from AB_KEYWORD_ENTRY")); + +result.string(containerName); \ No newline at end of file diff --git a/entity/KeywordAttributeRelation_entity/entityfields/value_proxy/valueProcess.js b/entity/KeywordAttributeRelation_entity/entityfields/value_proxy/valueProcess.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/contentTypeProcess.js b/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/contentTypeProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1da438ae339f096edc84a723f3fc182826b57f1b --- /dev/null +++ b/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/contentTypeProcess.js @@ -0,0 +1,20 @@ +import("system.result"); +import("system.vars"); + +var type = vars.get("$field.attributeType"); +switch(type) +{ + case "BOOL_VALUE": + contentType = "BOOLEAN"; + break; + case "NUMBER_VALUE": + contentType = "NUMBER"; + break; + case "CHAR_VALUE": + contentType = "TEXT"; + break; + default: + contentType = "UNKNOWN"; + break; +} +result.string(contentType); \ No newline at end of file diff --git a/entity/KeywordAttributeRelation_entity/entityfields/value_proxy/documentation.adoc b/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/documentation.adoc similarity index 100% rename from entity/KeywordAttributeRelation_entity/entityfields/value_proxy/documentation.adoc rename to entity/KeywordAttributeRelation_entity/entityfields/valueproxy/documentation.adoc diff --git a/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/onValueChange.js b/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..662991ca50fa89f59941367f5602b32d185db7f7 --- /dev/null +++ b/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/onValueChange.js @@ -0,0 +1,18 @@ +import("system.result"); +import("system.vars"); +import("Entity_lib"); + +var type = vars.get("$field.attributeType"); +var value = ProcessHandlingUtils.getOnValidationValue(vars.get("$field.valueProxy")); +switch (type) +{ + case "BOOL_VALUE": + vars.set("$field.BOOL_VALUE", value); + break; + case "NUMBER_VALUE": + vars.set("$field.NUMBER_VALUE", value); + break; + case "CHAR_VALUE": + vars.set("$field.CHAR_VALUE", value); + break; +} diff --git a/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/valueProcess.js b/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..468588cfb389a7bba039cabadf86088de6a09b51 --- /dev/null +++ b/entity/KeywordAttributeRelation_entity/entityfields/valueproxy/valueProcess.js @@ -0,0 +1,22 @@ +import("system.result"); +import("system.vars"); + +var type = vars.get("$field.attributeType"); +var value; +switch (type) +{ + case "BOOL_VALUE": + value = vars.get("$field.BOOL_VALUE"); + break; + case "NUMBER_VALUE": + value = vars.get("$field.NUMBER_VALUE"); + break; + case "CHAR_VALUE": + value = vars.get("$field.CHAR_VALUE"); + break; + default: + value = null; + break; +} + +result.string(value); \ No newline at end of file diff --git a/entity/KeywordAttributeRelation_entity/recordcontainers/db/conditionProcess.js b/entity/KeywordAttributeRelation_entity/recordcontainers/db/conditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3654d2b4d8f92c9aedc0514dc558cadc4bdbe9e6 --- /dev/null +++ b/entity/KeywordAttributeRelation_entity/recordcontainers/db/conditionProcess.js @@ -0,0 +1,9 @@ +import("system.db"); +import("system.vars"); +import("system.vars"); +import("system.result"); +import("Sql_lib"); + +var cond = SqlCondition.begin().andPrepareVars("AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ENTRY_ID", "$param.keywordEntryId_param"); +var condStr = db.translateCondition(cond.build("1 = 2")); +result.string(condStr); \ No newline at end of file diff --git a/entity/KeywordEntry_entity/KeywordEntry_entity.aod b/entity/KeywordEntry_entity/KeywordEntry_entity.aod index 6be1227f046be4e01d3026703d495f2859cfdf5c..0c83ef04ae1fc24984ad89752fd56cb99288aee3 100644 --- a/entity/KeywordEntry_entity/KeywordEntry_entity.aod +++ b/entity/KeywordEntry_entity/KeywordEntry_entity.aod @@ -232,6 +232,12 @@ <fieldName>KeywordKeywordAttributeTypes</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>078bbd52-87fa-44cc-9902-04af935b5fbc</name> + <entityName>Attribute_entity</entityName> + <fieldName>KeywordAttributeType</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> @@ -259,16 +265,12 @@ <dependency> <name>dependency</name> <entityName>KeywordAttributeRelation_entity</entityName> - <fieldName>SpecificContainer</fieldName> + <fieldName>AttributesForKeywordEntry</fieldName> </dependency> <children> <entityParameter> - <name>containerName_param</name> - <code>%aditoprj%/entity/KeywordEntry_entity/entityfields/keywordattributerelations/children/containername_param/code.js</code> - </entityParameter> - <entityParameter> - <name>keywordEntry_param</name> - <code>%aditoprj%/entity/KeywordEntry_entity/entityfields/keywordattributerelations/children/keywordentry_param/code.js</code> + <name>keywordEntryId_param</name> + <code>%aditoprj%/entity/KeywordEntry_entity/entityfields/keywordattributerelations/children/keywordentryid_param/code.js</code> </entityParameter> </children> </entityConsumer> diff --git a/entity/KeywordEntry_entity/entityfields/keywordattributerelations/children/containername_param/code.js b/entity/KeywordEntry_entity/entityfields/keywordattributerelations/children/containername_param/code.js deleted file mode 100644 index caec90defa83306ebcaa49f35ec771a94a722029..0000000000000000000000000000000000000000 --- a/entity/KeywordEntry_entity/entityfields/keywordattributerelations/children/containername_param/code.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.CONTAINER")); \ No newline at end of file diff --git a/entity/KeywordEntry_entity/entityfields/keywordattributerelations/children/keywordentry_param/code.js b/entity/KeywordEntry_entity/entityfields/keywordattributerelations/children/keywordentryid_param/code.js similarity index 100% rename from entity/KeywordEntry_entity/entityfields/keywordattributerelations/children/keywordentry_param/code.js rename to entity/KeywordEntry_entity/entityfields/keywordattributerelations/children/keywordentryid_param/code.js diff --git a/entity/KeywordEntry_entity/recordcontainers/db/onDBUpdate.js b/entity/KeywordEntry_entity/recordcontainers/db/onDBUpdate.js index a1e6133b613a59c988a2abaf9c87f81d9139b08b..0f9d6cbdbc13c88271967f572ce1709fd1ad6519 100644 --- a/entity/KeywordEntry_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/KeywordEntry_entity/recordcontainers/db/onDBUpdate.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.db"); import("system.vars"); import("system.text"); diff --git a/entity/SalesprojectMember_entity/SalesprojectMember_entity.aod b/entity/SalesprojectMember_entity/SalesprojectMember_entity.aod index de4a081641730f7e6683bc1cf2357ff5ced1636f..23aa60f339091d58fada5369299dea47c6b19252 100644 --- a/entity/SalesprojectMember_entity/SalesprojectMember_entity.aod +++ b/entity/SalesprojectMember_entity/SalesprojectMember_entity.aod @@ -30,6 +30,8 @@ <entityProvider> <name>SalesprojectMembers</name> <fieldType>DEPENDENCY_IN</fieldType> + <targetContextField>TARGETCONTEXT</targetContextField> + <targetIdField>CONTACT_ID</targetIdField> <recordContainer>db</recordContainer> <dependencies> <entityDependency> @@ -145,6 +147,10 @@ TODO: intuitive möglichkeit, auf dend Stand aus Relation zurückzusetzen... akt </entityParameter> </children> </entityConsumer> + <entityField> + <name>TARGETCONTEXT</name> + <valueProcess>%aditoprj%/entity/SalesprojectMember_entity/entityfields/targetcontext/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/SalesprojectMember_entity/entityfields/targetcontext/valueProcess.js b/entity/SalesprojectMember_entity/entityfields/targetcontext/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b8a7cf8b360661e7993c91dcaa3a9fabcbab989b --- /dev/null +++ b/entity/SalesprojectMember_entity/entityfields/targetcontext/valueProcess.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("Person_context"); //to show the preview of the person \ No newline at end of file diff --git a/neonView/KeywordAttributeRelationRows_view/KeywordAttributeRelationRows_view.aod b/neonView/KeywordAttributeRelationRows_view/KeywordAttributeRelationRows_view.aod index 93dff9fcdd7d70394716c779190074baa2eb8e5d..617f416bf487f3c1ad7fa1cbb1d18cc8d22a4337 100644 --- a/neonView/KeywordAttributeRelationRows_view/KeywordAttributeRelationRows_view.aod +++ b/neonView/KeywordAttributeRelationRows_view/KeywordAttributeRelationRows_view.aod @@ -19,8 +19,8 @@ <entityField>AB_KEYWORD_ATTRIBUTE_ID</entityField> </neonTableColumn> <neonTableColumn> - <name>04d24334-3b82-4193-b289-6a96f640e521</name> - <entityField>CHAR_VALUE</entityField> + <name>4d5656d1-a928-47d9-9d88-de8572866a79</name> + <entityField>valueProxy</entityField> </neonTableColumn> </columns> </tableViewTemplate> diff --git a/others/db_changes/data_alias/data/AditoBasic/ab_keyword_attribute.xml b/others/db_changes/data_alias/data/AditoBasic/ab_keyword_attribute.xml new file mode 100644 index 0000000000000000000000000000000000000000..c3c086c020b41f4e785473ae0de007836a4eb020 --- /dev/null +++ b/others/db_changes/data_alias/data/AditoBasic/ab_keyword_attribute.xml @@ -0,0 +1,4 @@ +<?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 relativeToChangelogFile="true" file="ab_keyword_attribute/init_SalesprojectProbability_points.xml"/> +</databaseChangeLog> diff --git a/others/db_changes/data_alias/data/AditoBasic/ab_keyword_attribute/init_SalesprojectProbability_points.xml b/others/db_changes/data_alias/data/AditoBasic/ab_keyword_attribute/init_SalesprojectProbability_points.xml new file mode 100644 index 0000000000000000000000000000000000000000..4f026375759b21e39e16f06cda5e53d3a0a3cb18 --- /dev/null +++ b/others/db_changes/data_alias/data/AditoBasic/ab_keyword_attribute/init_SalesprojectProbability_points.xml @@ -0,0 +1,11 @@ +<?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="j.goderbauer" id="a2375d469a-1eda-4b40-802b-312323d9f2e7"> + <insert tableName="AB_KEYWORD_ATTRIBUTE"> + <column name="AB_KEYWORD_ATTRIBUTEID" value="2fabbd9a-89d2-49e3-b3aa-1dcbc77252c7"/> + <column name="NAME" value="points"/> + <column name="TYPE" value="NUMBER_VALUE"/> + <column name="CONTAINER" value="SalesprojectProbability"/> + </insert> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry.xml b/others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry.xml index 75f8991f77e2a93ea463d83a66d3e15fb196306e..bf57d6e5328a16d694d400033173a33f773f3c99 100644 --- a/others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry.xml +++ b/others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry.xml @@ -1,5 +1,6 @@ <?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 relativeToChangelogFile="true" file="ab_keyword_entry/init_KeywordAttributeType.xml"/> <include relativeToChangelogFile="true" file="ab_keyword_entry/init_ContactStatus.xml"/> <include relativeToChangelogFile="true" file="ab_keyword_entry/init_ActivityDirection.xml"/> <include relativeToChangelogFile="true" file="ab_keyword_entry/init_ContractPayment.xml"/> @@ -22,5 +23,6 @@ <include relativeToChangelogFile="true" file="ab_keyword_entry/init_StockWarehouse.xml"/> <include relativeToChangelogFile="true" file="ab_keyword_entry/init_TaskStatus.xml"/> <include relativeToChangelogFile="true" file="ab_keyword_entry/init_TaskType.xml"/> - <include relativeToChangelogFile="true" file="ab_keyword_entry/init_KeywordAttributeType.xml"/> + <include relativeToChangelogFile="true" file="ab_keyword_entry/init_AttributeType.xml"/> + <include relativeToChangelogFile="true" file="ab_keyword_entry/init_SalesprojectProbability.xml"/> </databaseChangeLog> diff --git a/others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry/init_AttributeType.xml b/others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry/init_AttributeType.xml new file mode 100644 index 0000000000000000000000000000000000000000..958ebbabbff6c47cd11ca96e801f36a7963eb0fd --- /dev/null +++ b/others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry/init_AttributeType.xml @@ -0,0 +1,97 @@ +<?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="55a6a9df-5852-4bd4-ad72-8c575c0a27f6"> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="972e5eb1-a457-4b75-b966-1183896dac2c"/> + <column name="KEYID" value="TEXT"/> + <column name="TITLE" value="Text"/> + <column name="CONTAINER" value="AttributeType"/> + <column name="SORTING" valueNumeric="0"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="cb7ecaea-b4e6-460e-9006-4a3d059b9857"/> + <column name="KEYID" value="DATE"/> + <column name="TITLE" value="Date"/> + <column name="CONTAINER" value="AttributeType"/> + <column name="SORTING" valueNumeric="1"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="14de196a-aaa6-41b9-b503-3df1d45acc1e"/> + <column name="KEYID" value="NUMBER"/> + <column name="TITLE" value="${NUMBER}"/> + <column name="CONTAINER" value="AttributeType"/> + <column name="SORTING" valueNumeric="2"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="8a9791c1-655f-4340-91b4-cfdf6372fc75"/> + <column name="KEYID" value="BOOLEAN"/> + <column name="TITLE" value="Checkbox"/> + <column name="CONTAINER" value="AttributeType"/> + <column name="SORTING" valueNumeric="3"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="1390813c-6b94-4336-9986-9bcaddab69ac"/> + <column name="KEYID" value="COMBO"/> + <column name="TITLE" value="Combobox"/> + <column name="CONTAINER" value="AttributeType"/> + <column name="SORTING" valueNumeric="4"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="2c188a17-2961-45df-bd68-34b55352375c"/> + <column name="KEYID" value="GROUP"/> + <column name="TITLE" value="Group"/> + <column name="CONTAINER" value="AttributeType"/> + <column name="SORTING" valueNumeric="5"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <rollback> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="972e5eb1-a457-4b75-b966-1183896dac2c"/> + </whereParams> + </delete> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="cb7ecaea-b4e6-460e-9006-4a3d059b9857"/> + </whereParams> + </delete> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="14de196a-aaa6-41b9-b503-3df1d45acc1e"/> + </whereParams> + </delete> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="8a9791c1-655f-4340-91b4-cfdf6372fc75"/> + </whereParams> + </delete> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="1390813c-6b94-4336-9986-9bcaddab69ac"/> + </whereParams> + </delete> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="2c188a17-2961-45df-bd68-34b55352375c"/> + </whereParams> + </delete> + </rollback> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry/init_SalesprojectProbability.xml b/others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry/init_SalesprojectProbability.xml new file mode 100644 index 0000000000000000000000000000000000000000..a7a8e441bacbe747ab588f5ef7e726ea775fc327 --- /dev/null +++ b/others/db_changes/data_alias/data/AditoBasic/ab_keyword_entry/init_SalesprojectProbability.xml @@ -0,0 +1,82 @@ +<?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="j.goderbauer" id="25ab05e0-51a9-4f6b-ae62-83d0583aef3b"> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="ab44bd2c-dffa-4731-8a24-fad31f069c46"/> + <column name="KEYID" value="c5bfa55e-4e9b-4d57-88e1-e06dedb71764"/> + <column name="TITLE" value="0 %"/> + <column name="CONTAINER" value="SalesprojectProbability"/> + <column name="SORTING" valueNumeric="0"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="e59169d3-c0d9-4718-b8b6-e315857948a0"/> + <column name="KEYID" value="b981a107-7e20-42a6-baf4-3fc09a939cd7"/> + <column name="TITLE" value="25 %"/> + <column name="CONTAINER" value="SalesprojectProbability"/> + <column name="SORTING" valueNumeric="1"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="415f1cf0-8c5b-4b6e-9900-0d0d6d72381c"/> + <column name="KEYID" value="8ff82a56-af38-4f19-9dd7-21d8276bc8e4"/> + <column name="TITLE" value="50 %"/> + <column name="CONTAINER" value="SalesprojectProbability"/> + <column name="SORTING" valueNumeric="2"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="6182cc48-df2b-4ba9-893a-bcedfd0e1e4b"/> + <column name="KEYID" value="67576cf1-29b3-4832-b8fe-9c7913e34ff4"/> + <column name="TITLE" value="75 %"/> + <column name="CONTAINER" value="SalesprojectProbability"/> + <column name="SORTING" valueNumeric="3"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <insert tableName="AB_KEYWORD_ENTRY"> + <column name="AB_KEYWORD_ENTRYID" value="f5b601a5-451b-4ab6-9167-b95077e90c62"/> + <column name="KEYID" value="ea30b4c3-1767-458a-98a4-2553c25fc5f9"/> + <column name="TITLE" value="100 %"/> + <column name="CONTAINER" value="SalesprojectProbability"/> + <column name="SORTING" valueNumeric="4"/> + <column name="ISACTIVE" valueNumeric="1"/> + <column name="ISESSENTIAL" valueNumeric="0"/> + </insert> + <rollback> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="ab44bd2c-dffa-4731-8a24-fad31f069c46"/> + </whereParams> + </delete> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="e59169d3-c0d9-4718-b8b6-e315857948a0"/> + </whereParams> + </delete> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="415f1cf0-8c5b-4b6e-9900-0d0d6d72381c"/> + </whereParams> + </delete> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="6182cc48-df2b-4ba9-893a-bcedfd0e1e4b"/> + </whereParams> + </delete> + <delete tableName="AB_KEYWORD_ENTRY"> + <where>AB_KEYWORD_ENTRYID = ?</where> + <whereParams> + <param value="f5b601a5-451b-4ab6-9167-b95077e90c62"/> + </whereParams> + </delete> + </rollback> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/others/db_changes/masterChangelog.xml b/others/db_changes/masterChangelog.xml index 584d2da9e1a43543ae659cf1570af5663b365edd..c93c6d8738b5756915ce0d6cf2bd8c0f049d5167 100644 --- a/others/db_changes/masterChangelog.xml +++ b/others/db_changes/masterChangelog.xml @@ -73,8 +73,9 @@ <include file="data_alias/data/example_salesorder/SALESORDER_1004.xml"/> <include file="data_alias/data/example_task/base.xml"/> - <!--reference file for keywords:--> + <!--reference files for keywords:--> <include file="data_alias/data/AditoBasic/ab_keyword_entry.xml"/> + <include file="data_alias/data/AditoBasic/ab_keyword_attribute.xml"/> <!--special case countryinfo data--> <include file="data_alias/data/AditoBasic/ab_countryinfo/init_ab_countryinfo.xml"/> diff --git a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod index 336d6b092bda8ab38166821c8d50c82ace586ceb..3f9daeb173f0de1d87682e389317618aba75d421 100644 --- a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod +++ b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod @@ -2,7 +2,7 @@ <preferences xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="3.0.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/preferences/3.0.3"> <name>_____PREFERENCES_PROJECT</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <projectName>xRM-Basic2019</projectName> + <projectName>basic 2019</projectName> <jditoMaxContentSize v="57671680" /> <calendarCategoriesEvent> <entry> diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js index 04827e89f5fd11c2839281bc494cb43631c24f75..d8692505d9e5f89e7db063fa7b57e491e450bf1b 100644 --- a/process/Attribute_lib/process.js +++ b/process/Attribute_lib/process.js @@ -89,7 +89,7 @@ AttributeHandler.prototype._getAttributeType = function () //TODO: maybe the typ attrTypeSelect = SqlCondition.begin() .andPrepare("AB_ATTRIBUTE.AB_ATTRIBUTEID", this.attributeId) .buildSql(attrTypeSelect); - this._attributeType = db.cell(attrTypeSelect); + this._attributeType = db.cell(attrTypeSelect).trim(); } return this._attributeType; } @@ -127,63 +127,54 @@ AttributeHandler.prototype.setAttributeValue = function (pValue) * This Object is only for the general definition of attribute types and for getting * data about every type, anything that has to do with a specific attribute (= the function requires an attribute id) * should be done in AttributeUtils. - */ -var AttributeTypes = { - _attributeTypeConfig : {}, - TEXT : "TEXT", - DATE : "DATE", - NUMBER : "NUMBER", - BOOLEAN : "BOOLEAN", - COMBO : "COMBO", - GROUP : "GROUP" -}; - -/** - * These objects hold important data for the attribute types. * The values for each type are: * - * name = the displayed name when selecting the type of an attribute * contentType = the value that is returned in the contentType process for the attribute * databaseField = the database field that holds values of attributes with the type * entityField = the field in the AttributeRelation enity that holds the value of the attribute for that type + * + * The display name is controlled by the keyword 'AttributeType' */ -AttributeTypes._attributeTypeConfig[AttributeTypes.TEXT] = { //TODO: it would probably be better if the name was a keyword - name : "Text", - contentType : "TEXT", - databaseField : "CHAR_VALUE", - entityField : "CHAR_VALUE" -}; -AttributeTypes._attributeTypeConfig[AttributeTypes.DATE] = { - name : "Date", - contentType : "DATE", - databaseField : "DATE_VALUE", - entityField : "DATE_VALUE" -}; -AttributeTypes._attributeTypeConfig[AttributeTypes.NUMBER] = { - name : "${NUMBER}", - contentType : "NUMBER", - databaseField : "NUMBER_VALUE", - entityField : "NUMBER_VALUE" -}; -AttributeTypes._attributeTypeConfig[AttributeTypes.BOOLEAN] = { - name : "Checkbox", - contentType : "BOOLEAN", - databaseField : "BOOL_VALUE", - entityField : "BOOL_VALUE" -}; -AttributeTypes._attributeTypeConfig[AttributeTypes.COMBO] = { - name : "Combobox", - contentType : "TEXT", - databaseField : "ID_VALUE", - entityField : "ID_VALUE" -}; -AttributeTypes._attributeTypeConfig[AttributeTypes.GROUP] = { - name : "Group", - contentType : null, - databaseField : null, - entityField : null +var AttributeTypes = { + TEXT : { + toString : function () {return "TEXT"}, + contentType : "TEXT", + databaseField : "CHAR_VALUE", + entityField : "CHAR_VALUE" + }, + DATE : { + toString : function () {return "DATE"}, + contentType : "DATE", + databaseField : "DATE_VALUE", + entityField : "DATE_VALUE" + }, + NUMBER : { + toString : function () {return "NUMBER"}, + contentType : "NUMBER", + databaseField : "NUMBER_VALUE", + entityField : "NUMBER_VALUE" + }, + BOOLEAN : { + toString : function () {return "BOOLEAN"}, + contentType : "BOOLEAN", + databaseField : "BOOL_VALUE", + entityField : "BOOL_VALUE" + }, + COMBO : { + toString : function () {return "COMBO"}, + contentType : "TEXT", + databaseField : "ID_VALUE", + entityField : "ID_VALUE" + }, + GROUP : { + toString : function () {return "GROUP"}, + contentType : null, + databaseField : null, + entityField : null + } }; + /** * returns the required contentType for the given attribute type * @@ -193,8 +184,8 @@ AttributeTypes._attributeTypeConfig[AttributeTypes.GROUP] = { */ AttributeTypes.getContentType = function (pAttributeType) { - if (pAttributeType in AttributeTypes._attributeTypeConfig) - return AttributeTypes._attributeTypeConfig[pAttributeType].contentType; + if (pAttributeType in AttributeTypes) + return AttributeTypes[pAttributeType].contentType; return null; } @@ -207,8 +198,8 @@ AttributeTypes.getContentType = function (pAttributeType) */ AttributeTypes.getEntityField = function (pAttributeType) { - if (pAttributeType in AttributeTypes._attributeTypeConfig) - return AttributeTypes._attributeTypeConfig[pAttributeType].entityField; + if (pAttributeType in AttributeTypes) + return AttributeTypes[pAttributeType].entityField; return null; } @@ -221,8 +212,8 @@ AttributeTypes.getEntityField = function (pAttributeType) */ AttributeTypes.getDatabaseField = function (pAttributeType) { - if (pAttributeType in AttributeTypes._attributeTypeConfig) - return AttributeTypes._attributeTypeConfig[pAttributeType].databaseField; + if (pAttributeType in AttributeTypes) + return AttributeTypes[pAttributeType].databaseField; return null; } @@ -235,25 +226,7 @@ AttributeTypes.getDatabaseField = function (pAttributeType) */ AttributeTypes.getName = function (pAttributeType) { - if (pAttributeType in AttributeTypes._attributeTypeConfig) - return translate.text(AttributeTypes._attributeTypeConfig[pAttributeType].name); + if (pAttributeType in AttributeTypes) + return translate.text(AttributeTypes[pAttributeType].displayName); return null; } - -/** - * Makes a two-dimensional array of the attribute types and the corresponding names. - * This is used for the selection of the type when creating an attribute. - * - * @return {String[][]} array with attribute types and names - */ -AttributeTypes.getTypeList = function () -{ - return [ - [AttributeTypes.TEXT, AttributeTypes.getName(AttributeTypes.TEXT)], - [AttributeTypes.COMBO, AttributeTypes.getName(AttributeTypes.COMBO)], - [AttributeTypes.NUMBER, AttributeTypes.getName(AttributeTypes.NUMBER)], - [AttributeTypes.DATE, AttributeTypes.getName(AttributeTypes.DATE)], - [AttributeTypes.BOOLEAN, AttributeTypes.getName(AttributeTypes.BOOLEAN)], - [AttributeTypes.GROUP, AttributeTypes.getName(AttributeTypes.GROUP)] - ]; -} diff --git a/process/Keyword_lib/process.js b/process/Keyword_lib/process.js index f35e876b6ea492b96bd9fa34cf254bcd0b2a9521..b043f2597c2b12691d9244da8c4597c7c72455e4 100644 --- a/process/Keyword_lib/process.js +++ b/process/Keyword_lib/process.js @@ -23,6 +23,7 @@ function $KeywordRegistry(){} //static property $KeywordRegistry.get = { + AttributeType: "AttributeType", KeywordAttributeType: "KeywordAttributeType", ContractPayment: "ContractPayment", ContractStatus: "ContractStatus", @@ -43,6 +44,7 @@ $KeywordRegistry.get = { SalesorderState: "SalesorderState", SalesprojectWonLost: "SalesprojectWonLost", StockWarehouse: "StockWarehouse", + SalesprojectProbability: "SalesprojectProbability", "null": null };