diff --git a/entity/Context_entity/Context_entity.aod b/entity/Context_entity/Context_entity.aod index 5348326bb64b41d175e94689ff5f2f9a8710d95d..c147151db5c5c9c725fdae33b865f821aeeb0046 100644 --- a/entity/Context_entity/Context_entity.aod +++ b/entity/Context_entity/Context_entity.aod @@ -44,6 +44,7 @@ <entityParameter> <name>ContextId_param</name> <expose v="true" /> + <triggerRecalculation v="true" /> <mandatory v="true" /> </entityParameter> </children> diff --git a/entity/Context_entity/recordcontainers/jdito/contentProcess.js b/entity/Context_entity/recordcontainers/jdito/contentProcess.js index 62ea3319494a23ed8a93d3eddd3b73996cf370ce..e0eac166061c43815765989a34a9d27e89a27fa5 100644 --- a/entity/Context_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Context_entity/recordcontainers/jdito/contentProcess.js @@ -1,7 +1,6 @@ import("system.vars"); import("system.result"); import("system.project"); -import("system.logging"); import("Context_lib"); if (vars.exists("$param.ContextId_param") && vars.get("$param.ContextId_param")) diff --git a/entity/Context_entity/titleProcess.js b/entity/Context_entity/titleProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1733703a2a64a8e0b6f083fc6b2f1b82db066ef1 --- /dev/null +++ b/entity/Context_entity/titleProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.CONTEXT_NAME")) \ No newline at end of file diff --git a/entity/ObjectRelation_entity/ObjectRelation_entity.aod b/entity/ObjectRelation_entity/ObjectRelation_entity.aod index bd8dca518e674aebeff41b0254481fb3ad25adbf..92c31b34c52f001b61575a769d541cebff17cf9e 100644 --- a/entity/ObjectRelation_entity/ObjectRelation_entity.aod +++ b/entity/ObjectRelation_entity/ObjectRelation_entity.aod @@ -23,6 +23,8 @@ <title>Object 1</title> <consumer>Objects1</consumer> <linkedContextProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1_rowid/linkedContextProcess.js</linkedContextProcess> + <stateProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1_rowid/stateProcess.js</stateProcess> + <valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1_rowid/valueProcess.js</valueProcess> </entityField> <entityField> <name>AB_OBJECTRELATIONID</name> @@ -32,6 +34,8 @@ <title>Object 2</title> <consumer>Objects2</consumer> <linkedContextProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/linkedContextProcess.js</linkedContextProcess> + <stateProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/stateProcess.js</stateProcess> + <valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/valueProcess.js</valueProcess> </entityField> <entityField> <name>OBJECT2_TYPE</name> @@ -40,6 +44,7 @@ <linkedContext>Context_context</linkedContext> <stateProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_type/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_type/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_type/displayValueProcess.js</displayValueProcess> </entityField> <entityParameter> <name>Object1Type_param</name> diff --git a/entity/ObjectRelation_entity/entityfields/object1_rowid/stateProcess.js b/entity/ObjectRelation_entity/entityfields/object1_rowid/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5f470da0cc219d8c305b419a6a832c5e7a5a3b54 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object1_rowid/stateProcess.js @@ -0,0 +1,14 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +var recordstate = vars.get("$sys.recordstate"); +if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE_EDIT) +{ + + if ((vars.exists("$param.AnyObjectRowid_param") && vars.get("$param.AnyObjectRowid_param")) + || (vars.exists("$param.Object1Rowid_param") && vars.get("$param.Object1Rowid_param"))) + { + result.string(neon.COMPONENTSTATE_READONLY); + } +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object1_rowid/valueProcess.js b/entity/ObjectRelation_entity/entityfields/object1_rowid/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d189f026bbda9b46e16b64e32c730b00dfc06b52 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object1_rowid/valueProcess.js @@ -0,0 +1,16 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +var recordstate = vars.get("$sys.recordstate"); +if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE_EDIT) +{ + if (vars.exists("$param.AnyObjectRowid_param") && vars.get("$param.AnyObjectRowid_param")) + { + result.string(vars.get("$param.AnyObjectRowid_param")); + } + else if (vars.exists("$param.Object1Rowid_param") && vars.get("$param.Object1Rowid_param")) + { + result.string(vars.get("$param.Object1Rowid_param")); + } +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object1_type/displayValueProcess.js b/entity/ObjectRelation_entity/entityfields/object1_type/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8a80d4be7ef95e71302ff88d345a95b97ad10d51 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object1_type/displayValueProcess.js @@ -0,0 +1,18 @@ +import("system.logging"); +import("system.result"); +import("system.neon"); +import("system.vars"); + +var recordstate = vars.get("$sys.recordstate"); +if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE_EDIT) +{ + if (vars.exists("$param.AnyObjectType_param") && vars.get("$param.AnyObjectType_param")) + { + logging.log(vars.get("$param.AnyObjectType_param")); + result.string("disp: " + vars.get("$param.AnyObjectType_param")); + } + else if (vars.exists("$param.Object1Type_param") && vars.get("$param.Object1Type_param")) + { + result.string("disp: " + vars.get("$param.Object1Type_param")); + } +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object1_type/stateProcess.js b/entity/ObjectRelation_entity/entityfields/object1_type/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..2160ef62efa8f525f4f17659425c717a7e595011 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object1_type/stateProcess.js @@ -0,0 +1,13 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +var recordstate = vars.get("$sys.recordstate"); +if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE_EDIT) +{ + if ((vars.exists("$param.AnyObjectType_param") && vars.get("$param.AnyObjectType_param")) + || (vars.exists("$param.Object1Type_param") && vars.get("$param.Object1Type_param"))) + { + result.string(neon.COMPONENTSTATE_READONLY); + } +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object1_type/valueProcess.js b/entity/ObjectRelation_entity/entityfields/object1_type/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..4ad606ce7581373dac0916bbc52582cead88ad7e --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object1_type/valueProcess.js @@ -0,0 +1,18 @@ +import("system.logging"); +import("system.result"); +import("system.neon"); +import("system.vars"); + +var recordstate = vars.get("$sys.recordstate"); +if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE_EDIT) +{ + if (vars.exists("$param.AnyObjectType_param") && vars.get("$param.AnyObjectType_param")) + { + logging.log(vars.get("$param.AnyObjectType_param")); + result.string(vars.get("$param.AnyObjectType_param")); + } + else if (vars.exists("$param.Object1Type_param") && vars.get("$param.Object1Type_param")) + { + result.string(vars.get("$param.Object1Type_param")); + } +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object2_rowid/stateProcess.js b/entity/ObjectRelation_entity/entityfields/object2_rowid/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b78d71076c7c186dd23123bcc8c543266a087d51 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object2_rowid/stateProcess.js @@ -0,0 +1,12 @@ +import("system.logging"); +import("system.result"); +import("system.neon"); +import("system.vars"); + +var recordstate = vars.get("$sys.recordstate"); +if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE_EDIT) +{ + logging.log(vars.exists("$param.Object2Rowid_param") && vars.get("$param.Object2Rowid_param")) + if (vars.exists("$param.Object2Rowid_param") && vars.get("$param.Object2Rowid_param")) + result.string(neon.COMPONENTSTATE_READONLY); +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object2_rowid/valueProcess.js b/entity/ObjectRelation_entity/entityfields/object2_rowid/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..710c40de475bab34407ce49a29c2015c997e9545 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object2_rowid/valueProcess.js @@ -0,0 +1,12 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +var recordstate = vars.get("$sys.recordstate"); +if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE_EDIT) +{ + if (vars.exists("$param.Object2Rowid_param") && vars.get("$param.Object2Rowid_param")) + { + result.string(vars.get("$param.Object2Rowid_param")); + } +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object2_type/displayValueProcess.js b/entity/ObjectRelation_entity/entityfields/object2_type/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e53f4ab6107d019de8397a1a4e88160ddfed18ea --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object2_type/displayValueProcess.js @@ -0,0 +1,19 @@ +import("system.project"); +import("system.result"); +import("system.neon"); +import("system.vars"); + +var recordstate = vars.get("$sys.recordstate"); +if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE_EDIT) +{ + if (vars.exists("$param.Object1Type_param") && vars.get("$param.Object1Type_param")) + { + // TODO: maybe use the Context_entity when jdito can call other entities over consumers. + result.string(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, vars.get("$param.Object1Type_param"))[1]); + } +} +else +{ + if (vars.get("$field.OBJECT1_TYPE")) + result.string(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, vars.get("$field.OBJECT1_TYPE"))[1]); +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object2_type/stateProcess.js b/entity/ObjectRelation_entity/entityfields/object2_type/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7d99ab991e0db32c5e2666c93aebe5ba80473a3f --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object2_type/stateProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +var recordstate = vars.get("$sys.recordstate"); +if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE_EDIT) +{ + if (vars.exists("$param.Object2Type_param") && vars.get("$param.Object2Type_param")) + result.string(neon.COMPONENTSTATE_READONLY); +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object2_type/valueProcess.js b/entity/ObjectRelation_entity/entityfields/object2_type/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..57711c82d252d92f76eb8583b9fa722f79711799 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object2_type/valueProcess.js @@ -0,0 +1,12 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +var recordstate = vars.get("$sys.recordstate"); +if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE_EDIT) +{ + if (vars.exists("$param.Object2Type_param") && vars.get("$param.Object2Type_param")) + { + result.string(vars.get("$param.Object2Type_param")); + } +} \ No newline at end of file diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js index 1cbfa06eaea3c2d2e05153d7cc5a7702ad797e42..e1742749814164dcc0aefeb4aab2f70f629cfd06 100644 --- a/process/Context_lib/process.js +++ b/process/Context_lib/process.js @@ -56,15 +56,15 @@ ContextUtils._getSelectMap = function() { var maskingUtils = new SqlMaskingUtils(); return { - // contextId nameField Tablename, IDField - "Organisation_context": ["\"NAME\"", "ORG", "ORGID"], - "Contact_context": [maskingUtils.concat(["FIRSTNAME", "LASTNAME"]), "PERS", "PERSID"], - "Activity_context": ["SUBJECT", "ACTIVITY", "ACTIVITYID"], - "Salesproject_context": [maskingUtils.concat([maskingUtils.cast("PROJECTCODE", SQLTYPES.VARCHAR, 10), "':'", "PROJECTTITLE"]), "SALESPROJECT", "SALESPROJECTID"], + // contextId nameField Tablename, IDField, isSystemAlias + "Organisation_context": ["\"NAME\"", "ORG", "ORGID", false], + "Contact_context": [maskingUtils.concat(["FIRSTNAME", "LASTNAME"]), "PERS", "PERSID", false], + "Activity_context": ["SUBJECT", "ACTIVITY", "ACTIVITYID", false], + "Salesproject_context": [maskingUtils.concat([maskingUtils.cast("PROJECTCODE", SQLTYPES.VARCHAR, 10), "':'", "PROJECTTITLE"]), "SALESPROJECT", "SALESPROJECTID", false], // TODO: keywords sind noch nicht in der DB somit gibt es nichts ähnliches zu getKeySQL. // maskingUtils.concat([SqlMaskingUtils.cast("CONTRACTCODE", "varchar", 10), getKeySQL("CONTRACTTYPE", "CONTRACTTYPE" )]) - "Contract_context": [maskingUtils.cast("CONTRACTCODE", SQLTYPES.VARCHAR, 10), "CONTRACT", "CONTRACTID"], - "Appointment_context": ["SUMMARY", "ASYS_CALENDARBACKEND", "UID"] + "Contract_context": [maskingUtils.cast("CONTRACTCODE", SQLTYPES.VARCHAR, 10), "CONTRACT", "CONTRACTID", false] +// "Appointment_context": ["SUMMARY", "ASYS_CALENDARBACKEND", "UID", true] } }