diff --git a/entity/Context_entity/Context_entity.aod b/entity/Context_entity/Context_entity.aod index 307bf15c0a2691b069c58d03cfe777b0ad42180a..31626ace6b084ed1d093124b0bc650c20df17146 100644 --- a/entity/Context_entity/Context_entity.aod +++ b/entity/Context_entity/Context_entity.aod @@ -2,6 +2,7 @@ <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>Context_entity</name> <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/entity/Context_entity/documentation.adoc</documentation> <titleProcess>%aditoprj%/entity/Context_entity/titleProcess.js</titleProcess> <recordContainer>jdito</recordContainer> <entityFields> @@ -29,6 +30,7 @@ <name>ContextId_param</name> <expose v="true" /> <mandatory v="false" /> + <documentation>%aditoprj%/entity/Context_entity/entityfields/contextid_param/documentation.adoc</documentation> <description>PARAMETER</description> </entityParameter> <entityProvider> diff --git a/entity/Context_entity/documentation.adoc b/entity/Context_entity/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..b70499460540837e47eeebbeff55abc8f2243b91 --- /dev/null +++ b/entity/Context_entity/documentation.adoc @@ -0,0 +1,9 @@ +== Context_entity == + +This Entity provides access to contexts. + +It provides: + +- the context ID (currently (12.02.2019) it is the context name) +- the context name (the name which is used in the designer) +- the context title (the title of the context which is a property of the context. If it is not defined you get the context name. \ No newline at end of file diff --git a/entity/Context_entity/entityfields/contextid_param/documentation.adoc b/entity/Context_entity/entityfields/contextid_param/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..abbd33cd243ae344ea4722cf0e6a53314f1e0f23 --- /dev/null +++ b/entity/Context_entity/entityfields/contextid_param/documentation.adoc @@ -0,0 +1 @@ +If you provide the ContextId_param only this context is provided. \ No newline at end of file diff --git a/entity/Context_entity/recordcontainers/jdito/contentProcess.js b/entity/Context_entity/recordcontainers/jdito/contentProcess.js index e0eac166061c43815765989a34a9d27e89a27fa5..07c0d727b9a576205f390d8abd058be4d540efd3 100644 --- a/entity/Context_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Context_entity/recordcontainers/jdito/contentProcess.js @@ -1,28 +1,12 @@ import("system.vars"); import("system.result"); -import("system.project"); import("Context_lib"); if (vars.exists("$param.ContextId_param") && vars.get("$param.ContextId_param")) { - result.object(_contextDataMapping(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, vars.get("$param.ContextId_param")))); + result.object(ContextUtils.getContext(vars.get("$param.ContextId_param"))); } else { - result.object(project.getDataModels(project.DATAMODEL_KIND_CONTEXT).map(_contextDataMapping).sort(function(pContext1, pContext2) { - if (pContext1[2] > pContext2[2]) - return 1; - - if (pContext1[2] < pContext2[2]) - return -1; - - return 0; - })); -} - -function _contextDataMapping(pContext) -{ - var contextName = ContextUtils.getContextName(pContext[0]); - - return [pContext[0], contextName, (pContext[1] ? pContext[1] : contextName)]; + result.object(ContextUtils.getContexts(true)); } \ No newline at end of file diff --git a/entity/ObjectRelation_entity/ObjectRelation_entity.aod b/entity/ObjectRelation_entity/ObjectRelation_entity.aod index 04821dd9afb92ac7e7bdf2708063d54eb4a257c5..cda85156d2b70c1b89df449f8aa412d5fe4af8f4 100644 --- a/entity/ObjectRelation_entity/ObjectRelation_entity.aod +++ b/entity/ObjectRelation_entity/ObjectRelation_entity.aod @@ -14,6 +14,7 @@ <title>Type 1</title> <consumer>Contexts</consumer> <linkedContext>Context_context</linkedContext> + <mandatory v="true" /> <stateProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1_type/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1_type/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1_type/displayValueProcess.js</displayValueProcess> @@ -23,6 +24,7 @@ <title>Object 1</title> <consumer>Objects1</consumer> <linkedContextProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1_rowid/linkedContextProcess.js</linkedContextProcess> + <mandatory v="true" /> <stateProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1_rowid/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1_rowid/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1_rowid/displayValueProcess.js</displayValueProcess> @@ -35,6 +37,7 @@ <title>Object 2</title> <consumer>Objects2</consumer> <linkedContextProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/linkedContextProcess.js</linkedContextProcess> + <mandatory v="true" /> <stateProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2_rowid/valueProcess.js</valueProcess> </entityField> @@ -43,6 +46,7 @@ <title>Type 2</title> <consumer>Contexts</consumer> <linkedContext>Context_context</linkedContext> + <mandatory v="true" /> <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> @@ -56,6 +60,9 @@ <entityProvider> <name>Object1</name> <fieldType>DEPENDENCY_IN</fieldType> + <targetContextField>OBJECT2_TYPE</targetContextField> + <targetIdField>OBJECT2_ROWID</targetIdField> + <documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/object1/documentation.adoc</documentation> <recordContainer>db</recordContainer> <dependencies> <entityDependency> @@ -105,6 +112,9 @@ <entityProvider> <name>Object2</name> <fieldType>DEPENDENCY_IN</fieldType> + <targetContextField>OBJECT1_TYPE</targetContextField> + <targetIdField>OBJECT1_ROWID</targetIdField> + <documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/object2/documentation.adoc</documentation> <recordContainer>db</recordContainer> <children> <entityParameter> @@ -136,6 +146,9 @@ <entityProvider> <name>BothObjects</name> <fieldType>DEPENDENCY_IN</fieldType> + <targetContextField>OBJECT2_TYPE</targetContextField> + <targetIdField>OBJECT2_ROWID</targetIdField> + <documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/bothobjects/documentation.adoc</documentation> <recordContainer>db</recordContainer> <children> <entityParameter> @@ -191,8 +204,9 @@ <entityProvider> <name>AnyObject</name> <fieldType>DEPENDENCY_IN</fieldType> - <targetContextField>OBJECT1_TYPE</targetContextField> - <targetIdField>OBJECT1_ROWID</targetIdField> + <targetContextField>AnyTargetType</targetContextField> + <targetIdField>AnyTargetRowid</targetIdField> + <documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobject/documentation.adoc</documentation> <recordContainer>db</recordContainer> <dependencies> <entityDependency> @@ -286,6 +300,14 @@ </entityParameter> </children> </entityConsumer> + <entityField> + <name>AnyTargetRowid</name> + <valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anytargetrowid/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>AnyTargetType</name> + <valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anytargettype/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/ObjectRelation_entity/documentation.adoc b/entity/ObjectRelation_entity/documentation.adoc index 8721fa7110890fc86c225c5b73458b8d716b77d0..33b4681ecbdb808113aef428f5cd3792a04af1a7 100644 --- a/entity/ObjectRelation_entity/documentation.adoc +++ b/entity/ObjectRelation_entity/documentation.adoc @@ -1,7 +1,7 @@ == Object Relation == -This entity is for contact between Objects. It should be used if everything can be related to something. -If only special objects should be connected where you always know what it is, it is better to create a custom contact table/entity which is only for this purpose. (e.g. Prod2Prod, Relation, ActitvityLink, ...) +This entity is for relation between Objects. It should be used if something can be related to something. +If only special objects should be connected where you always know what it is, it is better to create a custom relation table/entity which is only for this purpose. (e.g. Prod2Prod, Relation, ActitvityLink, ...) The Object type is the ID of the context. -Use Context_lib for this. \ No newline at end of file +Use Context_lib for this. diff --git a/entity/ObjectRelation_entity/entityfields/anyobject/documentation.adoc b/entity/ObjectRelation_entity/entityfields/anyobject/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..11ee142148f46c766d5cff09a51554b9586ae806 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/anyobject/documentation.adoc @@ -0,0 +1,10 @@ +== AnyObject provider == + +is for bidirectional Objectrelations. + +Example: +if you provide the contact "Lisa Sommer" as parameters (any..._param) you will get all relations which contain "Lisa Sommer" as Object1 OR Object2. + +You will get both: +Object1 = "Lisa Sommer", Object2 = "GFK" +Object1 = "GFK", Object2 = "Lisa Sommer" \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/anytargetrowid/valueProcess.js b/entity/ObjectRelation_entity/entityfields/anytargetrowid/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..30698cf10e59153bd413ab2cd1a62f6438142a74 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/anytargetrowid/valueProcess.js @@ -0,0 +1,25 @@ +import("system.result"); +import("system.vars"); + +var openedType; +var openedRowid; + +// any object +if (vars.exists("$param.AnyObjectType_param") && vars.get("$param.AnyObjectType_param")) +{ + openedType = vars.get("$param.AnyObjectType_param"); + if (vars.exists("$param.AnyObjectRowid_param") && vars.get("$param.AnyObjectRowid_param")) + { + openedRowid = vars.get("$param.AnyObjectRowid_param"); + // anyObject and object 1 == opened object --> target is object2 + if (vars.get("$field.OBJECT1_ROWID") == openedRowid && vars.get("$field.OBJECT1_TYPE") == openedType) + { + result.string(vars.get("$field.OBJECT2_ROWID")); + } + // anyObject and object 2 == opened object --> target is object1 + else if (vars.get("$field.OBJECT2_ROWID") == openedRowid && vars.get("$field.OBJECT2_TYPE") == openedType) + { + result.string(vars.get("$field.OBJECT1_ROWID")); + } + } +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/anytargettype/valueProcess.js b/entity/ObjectRelation_entity/entityfields/anytargettype/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c8dd2fb8c6fc3fd7d0863719e63411aa5b4564de --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/anytargettype/valueProcess.js @@ -0,0 +1,25 @@ +import("system.result"); +import("system.vars"); + +var openedType; +var openedRowid; + +// any object +if (vars.exists("$param.AnyObjectType_param") && vars.get("$param.AnyObjectType_param")) +{ + openedType = vars.get("$param.AnyObjectType_param"); + if (vars.exists("$param.AnyObjectRowid_param") && vars.get("$param.AnyObjectRowid_param")) + { + openedRowid = vars.get("$param.AnyObjectRowid_param"); + // anyObject and object 1 == opened object --> target is object2 + if (vars.get("$field.OBJECT1_ROWID") == openedRowid && vars.get("$field.OBJECT1_TYPE") == openedType) + { + result.string(vars.get("$field.OBJECT2_TYPE")); + } + // anyObject and object 2 == opened object --> target is object1 + else if (vars.get("$field.OBJECT2_ROWID") == openedRowid && vars.get("$field.OBJECT2_TYPE") == openedType) + { + result.string(vars.get("$field.OBJECT1_TYPE")); + } + } +} \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/bothobjects/documentation.adoc b/entity/ObjectRelation_entity/entityfields/bothobjects/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..12b757625cd1d43f35571bf502247121fa75bfad --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/bothobjects/documentation.adoc @@ -0,0 +1,16 @@ +== BothObject provider == + +is for getting relations between TWO SPECIFIC objects. + +Example: +if you provide the contact "Lisa Sommer" and organisation "GFK" as parameters (objectX..._param) you will get all relations which contain "Lisa Sommer" as Object1 and "GFK" as Object2. + +You will get only: +Object1 = "Lisa Sommer", Object2 = "GFK" + + +You WON'T get: +Object1 = "GFK", Object2 = "Lisa Sommer" +Object1 = "Peter Pfiffig", Object2 = "Lisa Sommer" +Object1 = "Peter Pfiffig", Object2 = "GFK" +... \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object1/documentation.adoc b/entity/ObjectRelation_entity/entityfields/object1/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..ba1539f3db1bde56a2cbc29def9c110b3402ba82 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object1/documentation.adoc @@ -0,0 +1,16 @@ +== Object1 provider == + +is for getting relations between Object1 and something. + +Example: +if you provide the contact "Lisa Sommer" as parameter (object1..._param) you will get all relations which contain "Lisa Sommer" as Object1. + +You will get: +Object1 = "Lisa Sommer", Object2 = "GFK" + + +You WON'T get: +Object1 = "GFK", Object2 = "Lisa Sommer" +Object1 = "Peter Pfiffig", Object2 = "Lisa Sommer" +Object1 = "Peter Pfiffig", Object2 = "GFK" +... \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object1_rowid/displayValueProcess.js b/entity/ObjectRelation_entity/entityfields/object1_rowid/displayValueProcess.js index 94cfeeb560e1f78da4a8344b3443a48a5272426c..f82167f8b69e5413ef49fe0d7ce1dc2cbdebc500 100644 --- a/entity/ObjectRelation_entity/entityfields/object1_rowid/displayValueProcess.js +++ b/entity/ObjectRelation_entity/entityfields/object1_rowid/displayValueProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.neon"); import("system.vars"); import("system.result"); @@ -19,10 +18,8 @@ if (recordstate == neon.OPERATINGSTATE_NEW) } else if (recordstate == neon.OPERATINGSTATE_EDIT) { - logging.log("edit") if (vars.exists("$field.OBJECT1_ROWID") && vars.get("$field.OBJECT1_ROWID") && vars.exists("$field.OBJECT1_TYPE") && vars.get("$field.OBJECT1_TYPE")) { - logging.log(db.cell(ContextUtils.getNameSql(vars.get("$field.OBJECT1_TYPE"), vars.get("$field.OBJECT1_ROWID")))) result.string(db.cell(ContextUtils.getNameSql(vars.get("$field.OBJECT1_TYPE"), vars.get("$field.OBJECT1_ROWID")))); } } \ 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 index d189f026bbda9b46e16b64e32c730b00dfc06b52..679db41733d3a5ffa393e371edb985ae2c8dc344 100644 --- a/entity/ObjectRelation_entity/entityfields/object1_rowid/valueProcess.js +++ b/entity/ObjectRelation_entity/entityfields/object1_rowid/valueProcess.js @@ -3,6 +3,7 @@ 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")) @@ -13,4 +14,8 @@ if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE { result.string(vars.get("$param.Object1Rowid_param")); } + else if (!vars.get("$field.OBJECT2_TYPE")) + { + result.string(""); + } } \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/object2/documentation.adoc b/entity/ObjectRelation_entity/entityfields/object2/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..9ce67b8769d5d8f1ae4a0e687d20c756db0572e9 --- /dev/null +++ b/entity/ObjectRelation_entity/entityfields/object2/documentation.adoc @@ -0,0 +1,17 @@ +== Object2 provider == + +is for getting relations between something and Object2. + +Example: +if you provide the contact "Lisa Sommer" as parameter (object2..._param) you will get all relations which contain "Lisa Sommer" as Object2. + +You will get: +Object1 = "GFK", Object2 = "Lisa Sommer" +Object1 = "Peter Pfiffig", Object2 = "Lisa Sommer" + + +You WON'T get: +Object1 = "Lisa Sommer", Object2 = "GFK" +Object1 = "Peter Pfiffig", Object2 = "GFK" +Object1 = "Lisa Sommer", Object2 = "Peter Pfiffig" +... \ 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 index b78d71076c7c186dd23123bcc8c543266a087d51..51c5fa78a283b5a93d4c88cdf1fa8e8f63b0b5c8 100644 --- a/entity/ObjectRelation_entity/entityfields/object2_rowid/stateProcess.js +++ b/entity/ObjectRelation_entity/entityfields/object2_rowid/stateProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.result"); import("system.neon"); import("system.vars"); @@ -6,7 +5,6 @@ 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 index 710c40de475bab34407ce49a29c2015c997e9545..907eff1114e5acdd24b9b180372e7059ede6e6db 100644 --- a/entity/ObjectRelation_entity/entityfields/object2_rowid/valueProcess.js +++ b/entity/ObjectRelation_entity/entityfields/object2_rowid/valueProcess.js @@ -9,4 +9,8 @@ if (recordstate == neon.OPERATINGSTATE_NEW || recordstate == neon.OPERATINGSTATE { result.string(vars.get("$param.Object2Rowid_param")); } + else if (!vars.get("$field.OBJECT2_TYPE")) + { + result.string(""); + } } \ No newline at end of file diff --git a/entity/ObjectRelation_entity/entityfields/objects1/children/objecttype_param/code.js b/entity/ObjectRelation_entity/entityfields/objects1/children/objecttype_param/code.js index 3b6f82bbcec81a210fd037da6fbef12cb90bfe20..0e35811c9fc30b9f87c3e4dda4235787fb0066f7 100644 --- a/entity/ObjectRelation_entity/entityfields/objects1/children/objecttype_param/code.js +++ b/entity/ObjectRelation_entity/entityfields/objects1/children/objecttype_param/code.js @@ -1,6 +1,4 @@ -import("system.logging"); import("system.vars"); import("system.result"); -logging.log("set type: " + vars.get("$field.OBJECT1_TYPE")) result.string(vars.get("$field.OBJECT1_TYPE")) \ No newline at end of file diff --git a/entity/ObjectRelation_entity/recordcontainers/db/conditionProcess.js b/entity/ObjectRelation_entity/recordcontainers/db/conditionProcess.js index 0c33f31769cf310c1a69dacfeac893cff0a75b27..fd3608bd8705e0b8cc518d06c4530b32a7e3e589 100644 --- a/entity/ObjectRelation_entity/recordcontainers/db/conditionProcess.js +++ b/entity/ObjectRelation_entity/recordcontainers/db/conditionProcess.js @@ -1,5 +1,4 @@ import("system.vars"); -import("system.logging"); import("system.result"); import("system.db"); import("Sql_lib"); diff --git a/entity/Object_entity/Object_entity.aod b/entity/Object_entity/Object_entity.aod index 09a765c26250eef7fefb1addb900245e0f0b5194..68ae8000ad6b3919290a6b4d2f36ebfc8ee53a0e 100644 --- a/entity/Object_entity/Object_entity.aod +++ b/entity/Object_entity/Object_entity.aod @@ -2,12 +2,12 @@ <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>Object_entity</name> <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/entity/Object_entity/documentation.adoc</documentation> <titleProcess>%aditoprj%/entity/Object_entity/titleProcess.js</titleProcess> <recordContainer>jdito</recordContainer> <entityFields> <entityProvider> <name>#PROVIDER</name> - <recordContainer>jdito</recordContainer> <children> <entityParameter> <name>ObjectRowId_param</name> @@ -37,6 +37,7 @@ <entityProvider> <name>OneObject</name> <fieldType>DEPENDENCY_IN</fieldType> + <documentation>%aditoprj%/entity/Object_entity/entityfields/oneobject/documentation.adoc</documentation> <recordContainer>jdito</recordContainer> <dependencies> <entityDependency> @@ -70,6 +71,7 @@ <entityProvider> <name>AllObjects</name> <fieldType>DEPENDENCY_IN</fieldType> + <documentation>%aditoprj%/entity/Object_entity/entityfields/allobjects/documentation.adoc</documentation> <recordContainer>jdito</recordContainer> <dependencies> <entityDependency> diff --git a/entity/Object_entity/documentation.adoc b/entity/Object_entity/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..85191c1903e7182355442f72983e1db87b4ece13 --- /dev/null +++ b/entity/Object_entity/documentation.adoc @@ -0,0 +1,8 @@ +== Object_entity == + +This Entity provides access to different Objects. + +It provides: + +- the object ID (the UUID of the object) +- the object title (the display name. Currently (12.02.2019) it is configured in the Context_lib. This may change! \ No newline at end of file diff --git a/entity/Object_entity/entityfields/allobjects/documentation.adoc b/entity/Object_entity/entityfields/allobjects/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..66f07aa06c5d8f91081fd547d1efbb6e5f506b6d --- /dev/null +++ b/entity/Object_entity/entityfields/allobjects/documentation.adoc @@ -0,0 +1,3 @@ +== AllObjects provider == + +This provider returns all objects of one type. \ No newline at end of file diff --git a/entity/Object_entity/entityfields/oneobject/documentation.adoc b/entity/Object_entity/entityfields/oneobject/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..628c21478017d70552888637466be8b427010c37 --- /dev/null +++ b/entity/Object_entity/entityfields/oneobject/documentation.adoc @@ -0,0 +1,3 @@ +== OneObjects provider == + +This provider returns one specific object. \ No newline at end of file diff --git a/entity/Object_entity/recordcontainers/jdito/contentProcess.js b/entity/Object_entity/recordcontainers/jdito/contentProcess.js index e5a6d3fab4c0cbbbabf3da605240b2036776d25a..fa1404cf0aa5adb9dd28c57581124986ae7deaf5 100644 --- a/entity/Object_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Object_entity/recordcontainers/jdito/contentProcess.js @@ -1,19 +1,20 @@ import("system.db"); import("system.vars"); -import("system.logging"); import("system.result"); import("Context_lib"); -logging.log(vars.get("$param.ObjectType_param").toSource()) - if (vars.exists("$param.ObjectType_param") && vars.get("$param.ObjectType_param")) { if (vars.exists("$param.ObjectRowId_param") && vars.get("$param.ObjectRowId_param")) { result.object(db.table(vars.get("$param.ObjectRowId_param"), ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param"), vars.get("$param.ObjectRowId_param")))); } - - result.object(db.table(ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param")))) -} else { - result.object([]); + else + { + result.object(db.table(ContextUtils.getContextDataSql(vars.get("$param.ObjectType_param")))) + } } +else +{ + result.object([]); +} \ No newline at end of file diff --git a/neonContext/ObjectRelation_context/ObjectRelation_context.aod b/neonContext/ObjectRelation_context/ObjectRelation_context.aod index 4e07153b0da1edb8c26414e3b1f13bf990d7f88e..e8d0ed985d84d0c0a6f9f200fd50d3ca56c22755 100644 --- a/neonContext/ObjectRelation_context/ObjectRelation_context.aod +++ b/neonContext/ObjectRelation_context/ObjectRelation_context.aod @@ -3,6 +3,7 @@ <name>ObjectRelation_context</name> <majorModelMode>DISTRIBUTED</majorModelMode> <filterview>ObjectRelationFilter_view</filterview> + <editview>ObjectRelationEdit_view</editview> <preview>ObjectRelationPreview_view</preview> <entity>ObjectRelation_entity</entity> <references> @@ -14,5 +15,9 @@ <name>dc0bd793-a472-4a7b-8394-06c4bc31258a</name> <view>ObjectRelationPreview_view</view> </neonViewReference> + <neonViewReference> + <name>30334c84-5e46-4a4e-a5c4-3c42d1cb109b</name> + <view>ObjectRelationEdit_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonView/ObjectRelationEdit_view/ObjectRelationEdit_view.aod b/neonView/ObjectRelationEdit_view/ObjectRelationEdit_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..6f701953cc85f6f89e8c69dc54bce9f37638e448 --- /dev/null +++ b/neonView/ObjectRelationEdit_view/ObjectRelationEdit_view.aod @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.0.1"> + <name>ObjectRelationEdit_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericViewTemplate> + <name>Objects</name> + <editMode v="true" /> + <entityField>#ENTITY</entityField> + <fields> + <entityFieldLink> + <name>4bb47cac-47a7-448f-a8e6-ebab641d984f</name> + <entityField>OBJECT1_TYPE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>3c548c29-1f77-47e1-bbad-b3063b71224d</name> + <entityField>OBJECT1_ROWID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>7cfab0c5-06c7-4b1d-84e8-97aa76d5e4f3</name> + <entityField>OBJECT2_TYPE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>d0b4d4b6-ab29-478f-9e07-9de07fed0c32</name> + <entityField>OBJECT2_ROWID</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + </children> +</neonView> diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js index bab9e67faf02a146175f64f033bd4d245170fec1..675e5a981f580aa1a365f18545e53ee4656cf5f7 100644 --- a/process/Context_lib/process.js +++ b/process/Context_lib/process.js @@ -36,6 +36,49 @@ ContextUtils.getContextName = function(pContextId) return pContextId; } +ContextUtils.getContexts = function(pFilter) +{ + if (pFilter == undefined) + pFilter = false; + + + var contexts = project.getDataModels(project.DATAMODEL_KIND_CONTEXT); + + if (pFilter) + { + contexts = contexts.filter(function(pContext) + { + // filter only contexts which have defined mappings in Context_lib + return ContextUtils._getSelectMap()[pContext[0]] != undefined; + }); + } + + + return contexts.map(ContextUtils._contextDataMapping).sort(function(pContext1, pContext2) + { + // sort after ContextTitle + if (pContext1[2] > pContext2[2]) + return 1; + + if (pContext1[2] < pContext2[2]) + return -1; + + return 0; + }); +} + +ContextUtils.getContext = function(pContextId) +{ + return ContextUtils._contextDataMapping(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, pContextId)); +} + +ContextUtils._contextDataMapping = function(pContext) +{ + var contextName = ContextUtils.getContextName(pContext[0]); + + return [pContext[0], contextName, (pContext[1] ? pContext[1] : contextName)]; +} + /** * TODO: !!!temporary function until you can get fields from another Entity!!! */ @@ -96,4 +139,4 @@ ContextUtils.getContextDataSql = function(pContextId, pRowId) } return cond.buildSql("select " + selectMap[pContextId][2] + ", " + selectMap[pContextId][0] + " from " + selectMap[pContextId][1], "1=1"); -} \ No newline at end of file +}