From 53b0e46481b4f941c34207f792f7ae03a20a0300 Mon Sep 17 00:00:00 2001 From: Johannes Hoermann <j.hoermann@adito.de> Date: Wed, 13 Mar 2019 16:42:14 +0100 Subject: [PATCH] Preview und Doku --- .../ObjectRelation_entity.aod | 2 + .../ObjectRelation_entity/documentation.adoc | 62 ++++++++++--------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/entity/ObjectRelation_entity/ObjectRelation_entity.aod b/entity/ObjectRelation_entity/ObjectRelation_entity.aod index 894976d12c5..fde766eef7f 100644 --- a/entity/ObjectRelation_entity/ObjectRelation_entity.aod +++ b/entity/ObjectRelation_entity/ObjectRelation_entity.aod @@ -70,6 +70,8 @@ <entityProvider> <name>ObjectRelations</name> <fieldType>DEPENDENCY_IN</fieldType> + <targetContextField>objectTypeProxy</targetContextField> + <targetIdField>rowIdProxy</targetIdField> <recordContainer>db</recordContainer> <dependencies> <entityDependency> diff --git a/entity/ObjectRelation_entity/documentation.adoc b/entity/ObjectRelation_entity/documentation.adoc index fa775fc28ea..687b98cb73c 100644 --- a/entity/ObjectRelation_entity/documentation.adoc +++ b/entity/ObjectRelation_entity/documentation.adoc @@ -3,45 +3,49 @@ Object Relation :toc2: left :numbered: -(how it works currently 13.02.2019) +(how it works currently 13.03.2019) -There are two possible ways for Object Relations: +== How the ObjectRelation_entity works == +The entity works with the AB_OBJECTRELATION and AB_OBJECTRELATIONTYPE db-tables. -* With the ObjectRelation_entity -* With separate entities like the ActivityLink_entity +The AB_OBJECTRELATIONTYPE defines which relations are possible. +It always defines one "side" of the relation. So for each relation you always need two of them and both have to be from the same RELATION_TYPE. -== Differences == -Relations which use a custom entity are specific for one object. -e.g. in ActivityLink are only relations between "activity" and "something". -In ObjectRelation are relations between "something" and "something". +So for example if you would like to have a relation between a child and parent you need these two types: -The activityLink could also be implemented with ObjectRelation, but as there are many activities with many relations. -So it is better to use an extra db-table. +---- +AB_OBJECTRELATIONTYPEID = UID_1 +OBJECT_TYPE = Person +RELATION_TITLE = child of +RELATION_TYPE = TypeUID_1 +SIDE = 1 -== How the ObjectRelation_entity works == -The entity works with the AB_OBJECTRELATION db-table. +and -An ObjectRelation always has two Objects which consists of an Object-type and an Object-rowid. -The object-type is the id of the context. Which you can get by ContextUtils.getCurrentContextId of the Context_lib for the current context. -The object-rowid is the id of the Object you want use. Normally it is the UID of the Object. +AB_OBJECTRELATIONTYPEID = UID_2 +OBJECT_TYPE = Person +RELATION_TITLE = parent of +RELATION_TYPE = TypeUID_1 +SIDE = 2 +---- -It provides the following providers: +Note that the RELATION_TYPE is the same. -* AnyObject -* BothObjects -* Object1 -* Object2 -AnyObject is for bidirectional relations and all relations which contain the given AnyObject..._params as Object1 or Object2 will be loaded. -BothObjects is for relations between two specific objects provided by Object(1|2)..._params. -Object1 is for unidirectional relations where the Object1 is provided as parameters. -Object2 is for unidirectional relations where the Object2 is provided as parameters. +If you create a new relation between two persons it looks like this: -For the lookups there are two Entities: Object_entity for the Object-rowids and Context_entity for the Object-type. -See the documentation for them. +---- +AB_OBJECTRELATIONID = RelUID_1 +OBJECT1_ROWID = UID_Lisa_Sommer +OBJECT2_ROWID = UID_Franz_Mueller +AB_OBJECTRELATIONTYPE1 = UID_1 +AB_OBJECTRELATIONTYPE2 = UID_2 +---- +-> So: -The provider use the targetContext-feature to show the preview of the linked objects directly. (see targetContext-docu in the ohers/guide folder) +* Most relationtypes consist of two separate types connected by the RELATION_TYPE-id +* Each type also has a SIDE, which defines, if it is for side 1 or side 2 +* If both sides are from the same type, then there is only one OBJECTRELATIONTYPE with the side 1 and Objects use the same one. -== Link-entities == -They work very similar to the ObjectRelation, but only use one Object. The lookups and targetContext-feature work the same. \ No newline at end of file +The provider use the targetContext-feature to show the preview of the linked objects directly. (see targetContext-docu in the ohers/guide folder) \ No newline at end of file -- GitLab