diff --git a/entity/ObjectRelation_entity/ObjectRelation_entity.aod b/entity/ObjectRelation_entity/ObjectRelation_entity.aod index 5aeb94ee24cd2785d4f62caf643360a7904ca453..5cf415ce65458415ad238fa58de961ae01dd0686 100644 --- a/entity/ObjectRelation_entity/ObjectRelation_entity.aod +++ b/entity/ObjectRelation_entity/ObjectRelation_entity.aod @@ -97,6 +97,7 @@ <entityParameter> <name>Object1Type_param</name> <expose v="true" /> + <mandatory v="true" /> </entityParameter> <entityParameter> <name>Object1Rowid_param</name> @@ -141,6 +142,7 @@ <entityParameter> <name>Object2Type_param</name> <expose v="true" /> + <mandatory v="true" /> </entityParameter> </children> </entityProvider> @@ -259,6 +261,7 @@ <entityParameter> <name>AnyObjectType_param</name> <expose v="true" /> + <mandatory v="true" /> </entityParameter> </children> </entityProvider> diff --git a/entity/ObjectRelation_entity/documentation.adoc b/entity/ObjectRelation_entity/documentation.adoc index 33b4681ecbdb808113aef428f5cd3792a04af1a7..5fd7202aafa4f91fef344ec57f87cfbb216655e0 100644 --- a/entity/ObjectRelation_entity/documentation.adoc +++ b/entity/ObjectRelation_entity/documentation.adoc @@ -1,7 +1,47 @@ -== Object Relation == +Object Relation +=============== +:toc2: left +:numbered: -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, ...) +(how it works currently 13.02.2019) -The Object type is the ID of the context. -Use Context_lib for this. +There are two possible ways for Object Relations: + +* With the ObjectRelation_entity +* With separate entities like the ActivityLink_entity + +== 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". + +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. + +== How the ObjectRelation_entity works == +The entity works with the AB_OBJECTRELATION db-table. + +An ObjectRelation always has two Objects which consist 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. + +It provides the following providers: + +* 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. + +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. + + +The provider use the targetContext-feature to show the preview of the linked objects directly. (see targetContext-docu in the ohers/guide folder) + +== 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 diff --git a/others/guide/TargetContex.adoc b/others/guide/TargetContex.adoc new file mode 100644 index 0000000000000000000000000000000000000000..89155b20aa2879693555d901cf1f6f5445f002ab --- /dev/null +++ b/others/guide/TargetContex.adoc @@ -0,0 +1,19 @@ +Target Context +============== + +toc2: left +:numbered: + +== What? == +The target context is for forwarding the preview and the klick-action to another context. + +== Why? == +For example the ObjectRelation entity uses this feature to open the linked object directly. + +== Where? == +It is configured by two properties of the providers. + +* targetContextField +* targetIdField + +You can provide an entity-field for each of them which contain the contextId (currently the contextName 13.02.2019) and the rowId (UID) which should be used to open the preview or main view. \ No newline at end of file