Ticket #30 (closed Defect: fixed)
Aggregated composits not yet implemented
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.1 |
Component: | DeepaMehta Standard Distribution | Version: | 4.0.1 |
Keywords: | Cc: | dgf, Malte | |
Complexity: | 13 | Area: | |
Module: | deepamehta-core |
Description
Type definitions:
- compositions with a simple type as child works
- compositions with a complex type as child works
- aggregations with a simple type as child works
- aggregations with a complex type as child is NOT YET IMPLEMENTED
Simple type here means: "Text", "Number", "Boolean", "HTML"
Complex type means: "Composite"
Change History
comment:2 Changed 13 years ago by jri
- Complexity set to 13
- Module set to deepamehta-core
- Milestone changed from Release 4.1 to Release 4.2
comment:5 Changed 12 years ago by Jörg Richter
Core: update aggregated composites (#30).
The core service now processes update requests where aggreagted composite child topics are involved.
The "Aggregation of composite topic types not yet supported" exception is not thrown anymore.
However, such a request can only be used to
1) assign an existing topic as child (request contains a ref_id: or ref_uri: part)
2) create a new topic and assign it as child (request contains a simple value or a topic model whose ID is -1)
Such a request can not be used to update the *contents* of an existing child.
IMPORTANT: plugins whose model involve aggregated composite childs should provide a custom renderer (single or multi) for them. The generic Webclient renderers do not work fully for the moment. Their info rendering and form rendering capabilities do work but content changes in aggregated child topics are ignored. Only the assignments are maintained (as listed above).
See ticket 30.
comment:6 Changed 12 years ago by Jörg Richter
Core: update aggregated composites (#30).
The core service now processes update requests where aggreagted composite child topics are involved.
The "Aggregation of composite topic types not yet supported" exception is not thrown anymore.
However, such a request can only be used to
1) assign an existing topic as child (request contains a ref_id: or ref_uri: part)
2) create a new topic and assign it as child (request contains a simple value or a topic model whose ID is -1)
Such a request can not be used to update the *contents* of an existing child.
IMPORTANT: plugins whose model involve aggregated composite childs should provide a custom renderer (single or multi) for them. The generic Webclient renderers do not work fully for the moment. Their info rendering and form rendering capabilities do work but content changes in aggregated child topics are ignored. Only the assignments are maintained (as listed above).
See ticket 30.
comment:7 Changed 12 years ago by jri
- Status changed from accepted to closed
- Resolution set to fixed
Despite the restriction mentioned in the comments this issue is considered completed for the moment.
The restriction is intentional. Updating the contents of an aggregated composite is a potentially dangerous operation as this could have semantic side effects. The composite could be used in other contexts as well and the update would affect them too.
In the application semantic 2 cases have to distinguish carefully:
1) The change is intended to affect *all* contexts
2) The change is intended to affect only one context. This requires creation of another object and maintaining the references.
Looking at the sole request these cases can't be distinguished.
So, it's to the application developer to decide which case is on the hand and possibly update the composite object explicitly.
comment:8 Changed 11 years ago by Jörg Richter
Core: fix updating aggregated composites (#574).
When updating an aggregated composite no error occurs.
As a by-product of that fix you can now have aggregated composites in your model and edit such a complex topic via the Webclient. This works now for the first time with the Webclient's standard renderers (see #30).
So a first version of what we called a "Editor for aggregated composites" (see #337) is now available. However it is just in its first incarnation that will possibly not survive for long. In its current form it realizes the most cautious approach in regard of unwanted semantic side effects (see comments in #30): every time an aggregated composite is edited a new instance of the composite is created. Thus a lot of possibly useless (because unassigned) topics remain in the DB.
CHANGES
Core API: there is a new model class:
de.deepamehta.core.model.TopicReferenceModel
A reference to a topic, either by ID, or by URI.
BREAKING CHANGES
The Core Service's composite object update logic does not rely on a fallible heuristic to detect weather a TopicModel? represents actually a topic reference (based on ID and URI) but utilizes explicit TopicReferenceModel? instances for that purpose (analogous to TopicDeletionModel?).
When your plugin creates a TopicModel? object to represent a reference (e.g. to pass it to the Facet Service's updateFacet() call) you must now create a TopicReferenceModel? instead. Otherwise your update call will throw an error resp. have unexpected results.
See #574.